Questions tagged [hjson]

hjson is a configuration file format loosely based on json. It is designed to be easier to type and read than json.

Hjson, the Human JSON

Hjson http://hjson.org/icon/hjson-xs.png

A configuration file format for humans. Relaxed syntax, fewer mistakes, more comments.

Intro

{
  # specify rate in requests/second (because comments are helpful!)
  rate: 1000

  // prefer c-style comments?
  /* feeling old fashioned? */

  # did you notice that rate doesn't need quotes?
  hey: look ma, no quotes for strings either!

  # best of all
  notice: []
  anything: ?

  # yes, commas are optional!

  # Obviously you can always use standard JSON syntax as well:
  favNumbers: [ 1, 2, 3, 6, 42 ]
}

For details see hjson.org.

12 questions
2
votes
1 answer

HJSON Will Only Parse Integers or 'null' Values

I am trying to parse what should be JSON into a Python dict. However, the JSON file I am working with is not valid JSON as often there will be missing quotes around the key-value pairs. HJSON seems to be what I'm looking for, however I am finding it…
alphaomega
  • 137
  • 1
  • 15
1
vote
1 answer

How can I preserve comments when editing an hjson file?

I have a configuration file in hjson format. There are a lot of values and comments in this file. Simplified file looks like this: { # Comments # comments Variants: [v1, v2, v3] # Comments # comments Values: { v1: ["asd"]} #…
Evgeny
  • 45
  • 6
1
vote
1 answer

HJSON C# library for PowerShell

I'm trying to use HJSON C# library for PowerShell: https://github.com/hjson/hjson-cs I've successfully compiled the dll, put it into a folder and added the type via standard procedure: #LOAD $scriptRoot = Split-Path…
ALIENQuake
  • 520
  • 3
  • 12
  • 28
1
vote
1 answer

How do you use HJSON with Jest in a create-react-app project?

I'm using HJSON in a create-react-app project (see answer here), but Jest doesn't use the same webpack configuration, so fails to import HJSON properly - e.g. import options from '../assets/options.hjson'; just sets options to the string…
Brian Burns
  • 20,575
  • 8
  • 83
  • 77
0
votes
0 answers

HJSON parser in R?

Does anyone have an R implementation of a HJSON parser? Shockingly, parser exist for some of the more 'obscure' languages (ehem.. lua?!) in their github repo but not for R: https://github.com/orgs/hjson/repositories. For context, undertaking some…
qubit
  • 1
  • 1
0
votes
1 answer

JSONConverter.bas throws compile error: Sub or Function not defined

Windows 10 Excel O365 VBA Imported Jsonconverter.bas into project Modulels Imported Dictionary.cls into Project Class Reference added for MS Runtime scripting I can see data in my .ResponseText, but as soon as the program calls Set Json =…
Lee
  • 3
  • 2
0
votes
1 answer

how to read a Hjson file in python (Pycharm)?

i would like to know how to read a '.Hjson' file in python ?. I have obtained a dataset in Hjson format and want to perform analysis on that using Python such as obtain x and y .The data looks like this: Project:{ centerX:0, centerY:0, scaleX:0.37,…
0
votes
1 answer

C# Hjson returns null after deserialization

I have a hjson file like this that I want to deserialize and work with: { "TestConfig": { "SecondConfig": { "ConnectionString": "Integrated Security = true; Data Source = dataPseudo; Initial Catalog = catalogPseudo; Connect Timeout = 180", …
nelion
  • 1,712
  • 4
  • 17
  • 37
0
votes
3 answers

Get JSON files from particular interval based on date field

I've a lot json file the structure of which looks like below: { key1: 'val1' key2: { 'key21': 'someval1', 'key22': 'someval2', 'key23': 'someval3', 'date': '2018-07-31T01:30:30Z', 'key25':…
0
votes
1 answer

How to parse irregular JSON response from US Census API call?

The following is the response from a US Census API call. It uses irregular JSON (or simple javascript object) format in the response. In the form of { one set of data} { second set of data}. How can one parse the second set, namely the array data…
Srid
  • 11
  • 4
0
votes
1 answer

hjson: why does close brace have to be on a separate line?

This works: (update: but not as I was thinking! it actually sets b = "c, d: e") a: [ { b: c, d: e } ] and this works: a: [ { "b": "c", "d": "e" } ] But this doesn't work. What about the hjson definition disallows the closing brace at…
Mark Harrison
  • 297,451
  • 125
  • 333
  • 465
-1
votes
1 answer

How to handle "attempted to leave type linked_hash_map::Node uninitialized" when using the hjson crate?

I want to use the hjson format with my program. However, it seems the crate is pretty old. An updated fork is at https://github.com/shi-yan/hjson-rust, which is what I used in my program. Below is my testing program. #…
Fajela Tajkiya
  • 629
  • 2
  • 10