Skip to main content

JsonIBase

Typed JSONL records with derived SQLite, FTS5, and built-in local embeddings.

PyPI Python CI License: MIT

JsonIBase turns local JSONL source files into a validated, searchable record base. JSONL is the source of truth. SQLite is the derived local index.

Features

  • Pydantic-backed collection specs for typed JSONL records.
  • Canonical JSONL reads and transactional source mutations.
  • Derived SQLite index with FTS5 lexical search.
  • Bundled Model2Vec embedding provider for local vector and hybrid search.
  • Validation for duplicate ids, schema errors, and relationships.
  • JSON-only CLI designed for agents and scripts.
  • No hosted service, database server, or network call required for normal use.

Install

pip install jsonibase

Requires Python 3.13 or newer.

For development from a source checkout:

uv sync --extra dev
uv run pytest
uv run jsonibase guide

Quickstart

from pydantic import BaseModel

from jsonibase import CollectionSpec, JsonIBase


class Standard(BaseModel):
    id: str
    title: str
    body: str
    status: str


standards = CollectionSpec[Standard](
    name="standards",
    path="data/standards.jsonl",
    model=Standard,
    fts_fields=["title", "body"],
    embedding_fields=["title", "body"],
    filter_fields=["status"],
)

store = JsonIBase.open(".", [standards])
store.init()
store.add(
    "standards",
    Standard(
        id="std_001",
        title="Managed services",
        body="Prefer managed services.",
        status="active",
    ),
)
results = store.search("standards", "managed services")
print(results[0].record_id)

CLI

The CLI returns one pretty-printed JSON envelope per command. The guide is machine-readable and intended to bootstrap agents like Codex:

jsonibase guide

Common workflow:

jsonibase init --root . --collection standards --path data/standards.jsonl --fts title --fts body
jsonibase validate --root . --collection standards --path data/standards.jsonl --fts title --fts body
jsonibase build --root . --collection standards --path data/standards.jsonl --fts title --fts body
jsonibase search --root . --collection standards --path data/standards.jsonl --fts title --fts body --query "managed services"

In a source checkout, prefix commands with uv run.

Boundaries

JsonIBase is VCS-neutral. Git workflows are external. The library does not inspect Git state, create commits, create branches, open pull requests, call GitHub APIs, or provide Git adapters.

Embeddings

The standard package includes a bundled Model2Vec resource manifest and default local embedding provider. The provider performs no network calls during normal operation. Applications can pass a custom provider to JsonIBase.open when they need a domain-specific model or want to disable semantic behavior in their own wrapper.

Internet Ingestion Examples

Additional examples ingest public structured sources:

  • examples/ingest_peps.py for Python PEP metadata.
  • examples/ingest_cisa_kev.py for CISA Known Exploited Vulnerabilities.
  • examples/ingest_rfc_index.py for the RFC Editor XML index.

See docs/ingestion-sources.md for the source catalog and run commands.

Development

uv sync --extra dev
uv run ruff check src tests scripts
uv run pyright
uv run python scripts/verify_model_manifest.py
uv run pytest
uv run python -m build
uv run twine check dist/*

Releasing

JsonIBase uses PyPI trusted publishing through .github/workflows/publish.yml. The PyPI publisher must be configured for:

  • Repository: ThomasRohde/jsonibase
  • Workflow: publish.yml
  • Environment: pypi

Cut a release from a clean tree:

python scripts/release.py 0.1.0
git push origin master v0.1.0

The tag triggers GitHub Actions to build, check, upload to PyPI, and create a GitHub Release. After the release, open the next development cycle:

python scripts/release.py --post-release 0.2.0.dev0
git push origin master

License

MIT. The bundled potion-base-8M model declares MIT licensing in its model card and is hash-pinned in MODEL-MANIFEST.json.

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

jsonibase-0.1.0.tar.gz (28.4 MB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

jsonibase-0.1.0-py3-none-any.whl (28.4 MB view details)

Uploaded Python 3

File details

Details for the file jsonibase-0.1.0.tar.gz.

File metadata

  • Download URL: jsonibase-0.1.0.tar.gz
  • Upload date:
  • Size: 28.4 MB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.13

File hashes

Hashes for jsonibase-0.1.0.tar.gz
Algorithm Hash digest
SHA256 38786327200f7e4684c707d13cb0a92df7bfacc5ea7ab43bbab09761ab1612b9
MD5 7854cbe74bf8d9f8948431c374122231
BLAKE2b-256 6f04bd8c38121132b8725796593131ce0db08d75484e4c42d637dbbf5340b743

See more details on using hashes here.

Provenance

The following attestation bundles were made for jsonibase-0.1.0.tar.gz:

Publisher: publish.yml on ThomasRohde/jsonibase

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file jsonibase-0.1.0-py3-none-any.whl.

File metadata

  • Download URL: jsonibase-0.1.0-py3-none-any.whl
  • Upload date:
  • Size: 28.4 MB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.13

File hashes

Hashes for jsonibase-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 1f40866bfb6437ab18a03422922e3f16f980af680f73cfe6633e788e51143b2f
MD5 79cb718315fee725b0a96d68c80ba3a8
BLAKE2b-256 fc8206795f177834268a50dc968c6fc46ba1f225b8f1a2f51f88c1d78977ac40

See more details on using hashes here.

Provenance

The following attestation bundles were made for jsonibase-0.1.0-py3-none-any.whl:

Publisher: publish.yml on ThomasRohde/jsonibase

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Release history Release notifications | RSS feed

This release

0.1.0 This release

2 files

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page