Skip to main content

Python bindings for aijsondb

The idea behind aijsondb is rather simple:

  • Use a single json data file as data source.
  • Declare the content of json data with json schema.
  • Query the data with a JavaScript expression.

Writing a JavaScript expression to query a json data is not very convenient for humans. On the other hand letting an LLM creating the JavaScript expression using the json schema works well.

Thus using aijsondb in an agentic workflow is a good option to "talk with data".

Python package aijsondb is only a wrapper for the aijsondb library.

Installation

aijsondb is available for Linux and Windows.

Supported Python versions: Python 3.7 and above are recommended.

pip install aijsondbpy

Usage

Import the package.

import aijsondb

Load and validate the json data into an in memory data structure.

path_data="data/500 KB_V2.json"
path_schema="data/employeeSchemaDescription_V2.json"
aijsondb.init_db(path_data,path_schema)

Now you can query the data.

res=aijsondb.query_data_javascript("var result=data.employees.length;")
print(res)

By convention the root json object is accessible as data in the query. Also, the result of the query must be stored in the variable result.

The return value is a JSON string containing the result.

Sample data are available on aijsondb.

Python script test_agent.py shows you how to create an langchain agent to talk with your JSON data in python using the aijsonpy package.

Sample json data

The file 500_KB_V2.json in the data folder is derived from the dataset "Employees { 10 } Level Nested Formatted Versions", specifically the "500 KB 10 Level Formatted" variant available at page.

The files test.json and 500_KB_V2Err.json are also based on this dataset.

The JSON schema employeeSchemaDescription_V2.json was automatically generated from 500_KB_V2.json and subsequently edited by hand.

Metadata

Release files for aijsondbpy 0.11.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for aijsondbpy 0.11.0
File Size Uploaded Provenance Actions
aijsondbpy-0.11.0.tar.gz 4.3 MB Without provenance Details for aijsondbpy-0.11.0.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for aijsondbpy 0.11.0
File Interpreter ABI Platform Actions
aijsondbpy-0.11.0-py3-none-any.whl Python 3 none any Details for aijsondbpy-0.11.0-py3-none-any.whl

Total release size: 8.5 MB

Release files / aijsondbpy-0.11.0.tar.gz

Download URL aijsondbpy-0.11.0.tar.gz
Size 4.3 MB
Tags Source
SHA-256 checksum
How to use checksums
26d9c9b2977c474391ab2bb00f7f9b533a2f1c10e64bba6ac69628237d7f2e23
BLAKE2b-256 checksum
How to use checksums
18f9be5073f0542c25b0102d8b4448ba30b9404824a5118fe50f5a97cd7d1e20
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.13.3

Release files / aijsondbpy-0.11.0-py3-none-any.whl

Download URL aijsondbpy-0.11.0-py3-none-any.whl
Size 4.3 MB
Tags Python 3
SHA-256 checksum
How to use checksums
c5bdd1858bbba20ad932a4175da94e5ccc0852434a86bc9ac02634219fd0b366
BLAKE2b-256 checksum
How to use checksums
221a4cb09269a4e432c454490741cb22eaee3c57a3a1bfc19034bf7b8e724546
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.13.3

Security for aijsondbpy 0.11.0

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page