Python edition of RumbleDB, a JSONiq engine
Project description
RumbleDB for Python
by Abishek Ramdas and Ghislain Fourny
This is the Python version of RumbleDB. It is currently only a prototype (alpha) and probably unstable.
Install with
pip install jsoniq
Sample code:
from jsoniq import RumbleSession
# The syntax to start a session is similar to Spark.
rumble = RumbleSession.builder.appName("PyRumbleExample").getOrCreate();
# Create a data frame also similar to Spark (but using the rumble object).
data = [("Alice", 30), ("Bob", 25), ("Charlie", 35)];
columns = ["Name", "Age"];
df = rumble.createDataFrame(data, columns);
# This is how to bind a JSONiq variable to a dataframe. You can bind as many variables as you want.
rumble.bindDataFrameAsVariable('$a', df);
# This is how to run a query (declaring the external variable). This is similar to spark.sql().
res = rumble.jsoniq('declare variable $a external; $a.Name');
# returns a list containing one or several of "DataFrame", "RDD", "PUL", "Local"
modes = res.availableOutputs();
###### Parallel access ######
# This returns a regular data frame
df = res.getAsDataFrame();
df.show();
# This returns an RDD containing JSONiq item objects (does not work yet with transformations)
rdd = res.getAsRDD();
print(rdd.count());
for item in rdd.take(10):
print(item.getStringValue());
##### Local access ######
# This materializes the rows as items.
# The items are access with the RumbleDB Item API.
list = res.getAsList();
for result in list:
print(result.getStringValue())
# This streams through the items one by one
res.open();
while (res.hasNext()):
print(res.next().getStringValue());
res.close();
###### Native Python/JSON Access for bypassing the Item API (but losing on the richer JSONiq type system) ######
# This method directly gets the result as JSON (dict, list, strings, ints, etc).
jlist = res.getAsJSONList();
for str in jlist:
print(str);
# This streams through the JSON values one by one.
res.open();
while(res.hasNext()):
print(res.nextJSON());
res.close();
# There is still a problem to solve to make RDDs work across Python and Java
#rdd = res.getAsJSONRDD();
#print(rdd.count());
#for str in rdd.take(10):
# print(str);
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file jsoniq-0.1.0a5.tar.gz.
File metadata
- Download URL: jsoniq-0.1.0a5.tar.gz
- Upload date:
- Size: 25.5 MB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.12.9
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
8132322fd146bbc5cf1ab28bda48f90a7868530e5d581f18db4493cefe3bcf89
|
|
| MD5 |
f9959a794d6cc892134a70179c094409
|
|
| BLAKE2b-256 |
45037677499064046fbdc0a06c4ad873d714d5a36811def4055dbc9f6664143c
|
Provenance
The following attestation bundles were made for jsoniq-0.1.0a5.tar.gz:
Publisher:
deploy.yml on RumbleDB/python-jsoniq
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
jsoniq-0.1.0a5.tar.gz -
Subject digest:
8132322fd146bbc5cf1ab28bda48f90a7868530e5d581f18db4493cefe3bcf89 - Sigstore transparency entry: 271547059
- Sigstore integration time:
-
Permalink:
RumbleDB/python-jsoniq@f500e3b6dd19b948c9eaabe58d6ba7ce5f95a6d7 -
Branch / Tag:
refs/tags/0.1.0a5 - Owner: https://github.com/RumbleDB
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
deploy.yml@f500e3b6dd19b948c9eaabe58d6ba7ce5f95a6d7 -
Trigger Event:
push
-
Statement type:
File details
Details for the file jsoniq-0.1.0a5-py3-none-any.whl.
File metadata
- Download URL: jsoniq-0.1.0a5-py3-none-any.whl
- Upload date:
- Size: 25.5 MB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.12.9
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
da4383916206aa177d7a004437794d08011c95b558fe99f216b1be1abbc073c3
|
|
| MD5 |
042290f95fa05ac8a8a0ccc6f47acd48
|
|
| BLAKE2b-256 |
e2f5851aa2ebe57b8096d6424b7c2d4eea40716e21f8ba66e2a8cc5c6f86d746
|
Provenance
The following attestation bundles were made for jsoniq-0.1.0a5-py3-none-any.whl:
Publisher:
deploy.yml on RumbleDB/python-jsoniq
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
jsoniq-0.1.0a5-py3-none-any.whl -
Subject digest:
da4383916206aa177d7a004437794d08011c95b558fe99f216b1be1abbc073c3 - Sigstore transparency entry: 271547060
- Sigstore integration time:
-
Permalink:
RumbleDB/python-jsoniq@f500e3b6dd19b948c9eaabe58d6ba7ce5f95a6d7 -
Branch / Tag:
refs/tags/0.1.0a5 - Owner: https://github.com/RumbleDB
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
deploy.yml@f500e3b6dd19b948c9eaabe58d6ba7ce5f95a6d7 -
Trigger Event:
push
-
Statement type: