taskGNU Astronomy Utilities - Tasks: task #15895, JSON support

 
 

You are not allowed to post comments on this tracker with your current authentication level.

task #15895: JSON support

Submitter:  Mohammad Akhlaghi <makhlaghi>
Submitted:  Sat 30 Jan 2021 03:27:08 PM UTC
   
 
Should Start On:  Sat 30 Jan 2021 12:00:00 AM UTC Should be Finished on:  Sat 30 Jan 2021 12:00:00 AM UTC
Category:  Libraries Priority:  5 - Normal
Item Group:  Enhancement Status:  Postponed
Privacy:  Public Assigned to:  None
Percent Complete:  0% Open/Closed:  Open
Effort:  0.00

Tue 02 Apr 2024 10:22:02 PM UTC, comment #1: 

SQLite3 could read and write JSON files documentation here. If there is a plan to use SQLite3 library internally, it could be put into good use.

Quick example for JSON output:

$ sqlite3 ex1
SQLite version 3.45.2 2024-03-12 11:06:23
Enter ".help" for usage hints.
sqlite> create table tbl1(one text, two int);
sqlite> insert into tbl1 values('hello!',10);
sqlite> insert into tbl1 values('goodbye', 20);
sqlite> select * from tbl1;
hello!|10
goodbye|20
sqlite> .mode json
sqlite> select * from tbl1;
[{"one":"hello!","two":10},
{"one":"goodbye","two":20}]
sqlite>


There are examples on json_insert and other functions as well.

Pedram Ashofteh-Ardakani <pedram>
Group Member
Sat 30 Jan 2021 03:27:08 PM UTC, original submission:  

JSON is a commonly used format to store metadata or configuration files. For example some servers (that the Query program is planned to contact) provide outputs in this format.

One way is to write our own internal parser, but its better to use a good library. On the main JSON webpage there are a list of libraries for various languages, including C: https://www.json.org

Unfortunately some (like GNOME's json-glib) depend on Python!!! So we need to find one that doesn't depend on anything beyond ISO C.

I had a fast look at some of them and these seems possible potentials (although I just looked at their README, and haven't actually looked into the code at this stage to confirm):



  • http://lloyd.github.io/yajl (officially claims to only need ANSI C, permissive license, almost 300 commits, seems like a good choice)












Mohammad Akhlaghi <makhlaghi>
Group administrator

 

(Note: upload size limit is set to 16384 kB, after insertion of the required escape characters.)

No files currently attached

 

Depends on the following items: None found

Items that depend on this one: None found

 

Carbon-Copy List
  • -email is unavailable- added by pedram (Posted a comment)
  • -email is unavailable- added by makhlaghi (Submitted the item)
  •  

    There are 0 votes so far. Votes easily highlight which items people would like to see resolved in priority, independently of the priority of the item set by tracker managers.

     

    No changes have been made to this item

    Back to the top

    Powered by Savane 3.13-4b48.
    Corresponding source code