Skip to main content

Read and query compressed .egg database files

Project description

eggdb

Read and query compressed .egg database files from Python.

EggDB converts SQLite databases into highly compressed columnar .egg files. This package lets you query them directly — no decompression step needed.

Install

pip install eggdb

Usage

import eggdb

# Open an .egg file
egg = eggdb.open("data.egg")

# List tables
print(egg.tables)  # ['users', 'orders', ...]

# File summary
print(egg.summary())
# {'file_size': 176000000, 'original_size': 1500000000, 'compression_ratio': '8.5x', ...}

# Query with SQL
rows = egg.query("SELECT * FROM users WHERE status = 'active' LIMIT 10")
for row in rows:
    print(row)  # {'id': 1, 'name': 'Alice', 'status': 'active'}

# Query with YQL (a friendlier syntax)
rows = egg.query("count orders by status")
for row in rows:
    print(row)  # {'status': 'shipped', 'count': 4200}

# Column metadata
cols = egg.columns("users")
for col in cols:
    print(f"{col['name']}: {col['encoding']}")  # id: Delta, name: Dict, ...

Encrypted files

egg = eggdb.open("encrypted.egg", passphrase="secret")
rows = egg.query("SELECT * FROM users LIMIT 5")

Development

To build from source and test locally:

cd python
python3 -m venv .venv
source .venv/bin/activate
pip install maturin
maturin develop --release

Then run the test script from the repo root with any .egg file:

python test_python.py path/to/file.egg

This prints a full summary (tables, row counts, schema, encoding details, sample data) and drops into an interactive SQL/YQL query prompt:

=== Summary ===
  Tables:      11
  Total rows:  1,497,017
  Ratio:       8.5x

=== Tables ===
  Book: 2,601 rows
  Chapter: 46,104 rows
  ChapterVerse: 1,219,609 rows
  ...

=== Interactive Query ===
Enter SQL or YQL queries (empty line to quit):
> SELECT count(*) AS cnt FROM ChapterVerse WHERE bookId = 'ROM'
  {'cnt': 9320}
  (1 row)

> count Book by translationId sort count desc limit 5
  {'translationId': 'eng_abt', 'count': 84}
  ...

Requirements

  • Python 3.9+ (CPython only)
  • Platforms: Linux (x86_64, aarch64), macOS (Apple Silicon, Intel)
  • Memory: The entire .egg file is loaded into memory when opened. For a 300 MB .egg file, expect ~300 MB of RAM usage. Plan accordingly for multi-GB files.

How it works

Under the hood, eggdb uses a SQLite virtual table extension compiled from Rust. When you call query(), it:

  1. Opens an in-memory SQLite connection
  2. Registers the egg virtual table module
  3. Creates virtual tables pointing to your .egg file
  4. Runs your query through SQLite's optimizer
  5. Only decompresses the columns you actually reference

This means joins, aggregations, window functions — everything SQLite supports — works out of the box. Column pruning ensures only referenced columns are decompressed.

License

MIT OR Apache-2.0

Project details


Download files

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

Source Distribution

eggdb-0.1.0.tar.gz (84.6 kB view details)

Uploaded Source

Built Distributions

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

eggdb-0.1.0-pp310-pypy310_pp73-manylinux_2_17_aarch64.manylinux2014_aarch64.whl (1.5 MB view details)

Uploaded PyPymanylinux: glibc 2.17+ ARM64

eggdb-0.1.0-pp39-pypy39_pp73-manylinux_2_17_aarch64.manylinux2014_aarch64.whl (1.5 MB view details)

Uploaded PyPymanylinux: glibc 2.17+ ARM64

eggdb-0.1.0-cp39-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (1.7 MB view details)

Uploaded CPython 3.9+manylinux: glibc 2.17+ x86-64

eggdb-0.1.0-cp39-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl (1.5 MB view details)

Uploaded CPython 3.9+manylinux: glibc 2.17+ ARM64

eggdb-0.1.0-cp39-abi3-macosx_11_0_arm64.whl (1.4 MB view details)

Uploaded CPython 3.9+macOS 11.0+ ARM64

eggdb-0.1.0-cp39-abi3-macosx_10_12_x86_64.whl (1.6 MB view details)

Uploaded CPython 3.9+macOS 10.12+ x86-64

File details

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

File metadata

  • Download URL: eggdb-0.1.0.tar.gz
  • Upload date:
  • Size: 84.6 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for eggdb-0.1.0.tar.gz
Algorithm Hash digest
SHA256 3e33184c5d3f1746d231f8e74ec4c350f4adadea64838643d5a87188fb719832
MD5 8a5f86bc178e49ac2d81b202b65a7c94
BLAKE2b-256 355a3f108f9f2ac381c781b1d828742e6d4abaaa908efbcdb4abdd7240f2b39b

See more details on using hashes here.

Provenance

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

Publisher: publish-python.yml on Nazareneism/eggdb

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

File details

Details for the file eggdb-0.1.0-pp310-pypy310_pp73-manylinux_2_17_aarch64.manylinux2014_aarch64.whl.

File metadata

File hashes

Hashes for eggdb-0.1.0-pp310-pypy310_pp73-manylinux_2_17_aarch64.manylinux2014_aarch64.whl
Algorithm Hash digest
SHA256 54aecca1a2656d5eb6ecbf8d46c04162a4c04710ef886427a25c1f1e1ccfc2d5
MD5 275add7ef6d8adbc65a947ac7b6feb85
BLAKE2b-256 49418f7e81e745ea7a1c1e802675da01e39bf804036e934dae6256127a095da5

See more details on using hashes here.

Provenance

The following attestation bundles were made for eggdb-0.1.0-pp310-pypy310_pp73-manylinux_2_17_aarch64.manylinux2014_aarch64.whl:

Publisher: publish-python.yml on Nazareneism/eggdb

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

File details

Details for the file eggdb-0.1.0-pp39-pypy39_pp73-manylinux_2_17_aarch64.manylinux2014_aarch64.whl.

File metadata

File hashes

Hashes for eggdb-0.1.0-pp39-pypy39_pp73-manylinux_2_17_aarch64.manylinux2014_aarch64.whl
Algorithm Hash digest
SHA256 a1e91c73e619fd6cabd39282449d2cd9292a368886bda81dd46d721c2d658034
MD5 e92c07b7ccd31a71398323955f0af4b3
BLAKE2b-256 8a3b38269ce2a149a7c2e6f0288f8e95a431daf11339d5000df289a6641fc50a

See more details on using hashes here.

Provenance

The following attestation bundles were made for eggdb-0.1.0-pp39-pypy39_pp73-manylinux_2_17_aarch64.manylinux2014_aarch64.whl:

Publisher: publish-python.yml on Nazareneism/eggdb

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

File details

Details for the file eggdb-0.1.0-cp39-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.

File metadata

File hashes

Hashes for eggdb-0.1.0-cp39-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 7cd59914ef95e1cf9b62c4d2dc54973d37ba85c48ffad971323c3172623ee1bf
MD5 219a5ae01dd8ae54de7c0faaad5d9dec
BLAKE2b-256 9104c0285c34aaaff0469a78b074f7f1854bf60f898b8b35f9d6cf374982b633

See more details on using hashes here.

Provenance

The following attestation bundles were made for eggdb-0.1.0-cp39-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl:

Publisher: publish-python.yml on Nazareneism/eggdb

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

File details

Details for the file eggdb-0.1.0-cp39-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl.

File metadata

File hashes

Hashes for eggdb-0.1.0-cp39-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl
Algorithm Hash digest
SHA256 245189c04bdd7858a1a126d947134db46df311aff8639e9c8b1bdf4d51f8e477
MD5 251b17908fe429a667dc499c63aa8451
BLAKE2b-256 88f9dc4a97774d6cd32a9bde12152751ac7dc267b15df9fa536f6b10d005f489

See more details on using hashes here.

Provenance

The following attestation bundles were made for eggdb-0.1.0-cp39-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl:

Publisher: publish-python.yml on Nazareneism/eggdb

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

File details

Details for the file eggdb-0.1.0-cp39-abi3-macosx_11_0_arm64.whl.

File metadata

  • Download URL: eggdb-0.1.0-cp39-abi3-macosx_11_0_arm64.whl
  • Upload date:
  • Size: 1.4 MB
  • Tags: CPython 3.9+, macOS 11.0+ ARM64
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for eggdb-0.1.0-cp39-abi3-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 0d394b342e439c9f81863c3a7489e0be0d96677d3fca981b9620b332c6855eea
MD5 80341a7a64924af48f52ecf3fae424e0
BLAKE2b-256 ac3bef58e876e229ffc56bda3097283429d196b0927f72bc277dde990c4d963a

See more details on using hashes here.

Provenance

The following attestation bundles were made for eggdb-0.1.0-cp39-abi3-macosx_11_0_arm64.whl:

Publisher: publish-python.yml on Nazareneism/eggdb

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

File details

Details for the file eggdb-0.1.0-cp39-abi3-macosx_10_12_x86_64.whl.

File metadata

File hashes

Hashes for eggdb-0.1.0-cp39-abi3-macosx_10_12_x86_64.whl
Algorithm Hash digest
SHA256 6cfe2cdd075519c5eb4bb4fa70c3c4c35efbc306504fa55ad0b4cab3739b2b5b
MD5 fb4adf3bfc29e435e06043b515531aa1
BLAKE2b-256 63e11864a2c02e509bcb1dac8728dbe79981c3d1cb0e16194c913a238c987eff

See more details on using hashes here.

Provenance

The following attestation bundles were made for eggdb-0.1.0-cp39-abi3-macosx_10_12_x86_64.whl:

Publisher: publish-python.yml on Nazareneism/eggdb

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

Supported by

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