Skip to content

JuliaData/JSONTables.jl

main
Switch branches/tags

Name already in use

A tag already exists with the provided branch name. Many Git commands accept both tag and branch names, so creating this branch may cause unexpected behavior. Are you sure you want to create this branch?
Code

Latest commit

 

Git stats

Files

Permalink
Failed to load latest commit information.
Type
Name
Latest commit message
Commit time
src
 
 
 
 
 
 
 
 
 
 

JSONTables.jl

CI codecov deps version pkgeval

A package that provides a JSON integration with the Tables.jl interface, that is, it provides the jsontable function as a way to treat a JSON object of arrays, or a JSON array of objects, as a Tables.jl-compatible source. This allows, among other things, loading JSON "tabular" data into a DataFrame, or a JuliaDB.jl table, or written out directly as a csv file.

JSONTables.jl also provides two "write" functions, objecttable and arraytable, for taking any Tables.jl-comptabile source (e.g. DataFrame, CSV.File, etc.) and writing the table out either as a JSON object of arrays, or array of objects, respectively.

So in short:

# treat a json object of arrays or array of objects as a "table"
jtable = jsontable(json_source)

# turn json table into DataFrame
df = DataFrame(jtable)

# turn DataFrame back into json object of arrays
objecttable(df)

# turn DataFrame back into json array of objects
arraytable(df)