Skip to content

Commit 85fbd7d

Browse files
authored
Update README.md
1 parent 9268017 commit 85fbd7d

File tree

1 file changed

+19
-0
lines changed

1 file changed

+19
-0
lines changed

README.md

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1 +1,20 @@
11
# JSONTables.jl
2+
3+
A package that provides a JSON integration with the [Tables.jl](https://github.com/JuliaData/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 table, or written out directly as a csv file.
4+
5+
JSONTables.jl also provides two "write" functions, `objecttable` and `arraytable`, for taking any Tables.jl-comptabile source (e.g. DataFrame, ODBC.Query, etc.) and writing the table out either as a JSON object of arrays, or array of objects, respectively.
6+
7+
So in short:
8+
```julia
9+
# treat a json object of arrays or array of objects as a "table"
10+
jtable = jsontable(json_source)
11+
12+
# turn json table into DataFrame
13+
df = DataFrame(jtable)
14+
15+
# turn DataFrame back into json object of arrays
16+
objecttable(df)
17+
18+
# turn DataFrame back into json array of objects
19+
arraytable(df)
20+
```

0 commit comments

Comments
 (0)