Skip to main content

A Rust reimplementation of the TinyDB library

Project description

tinydb-rust

English | 简体中文

A high-performance Rust reimplementation of the TinyDB library, providing memory safety and improved performance while maintaining API compatibility with the original Python implementation.

🎉 Version 0.9.0 - Beta Release

This project is in Beta and ready for use. All core TinyDB functionality is implemented.

Features

✅ Fully Implemented

  • Complete TinyDB API: 100% API compatible with the original TinyDB library
  • High Performance: Core operations implemented in Rust, providing better performance than pure Python
  • Storage Backends:
    • JSONStorage: Persistent JSON file storage
    • MemoryStorage: In-memory storage for testing
  • Query System: Full query API with support for complex conditions (==, !=, <, <=, >, >=, matches, search, test, exists, etc.)
  • Table Operations: Complete CRUD operations (insert, search, update, remove, all, get, contains, count, etc.)
  • Middleware Support: CachingMiddleware and other middleware support
  • Utilities: LRUCache, FrozenDict, freeze() function
  • Performance Optimizations:
    • Rust-side table caching to reduce Python-Rust conversions
    • Fast-path query evaluation for Rust Query objects
    • Optimized document matching and filtering

Installation

pip install tinydb-rust

Requirements

  • Python >= 3.8

Performance

Benchmark results demonstrate that tinydb-rust delivers improved performance compared to the pure Python TinyDB:

  • Search operations: ~11% faster - Query operations show significant improvement
  • Full table scans: ~6% faster - Efficient document matching and filtering
  • Overall operations: ~10% faster - Balanced performance across all operations
  • Memory efficient: Rust-side caching reduces Python-Rust conversion overhead

License

This project is licensed under the MIT License - see the LICENSE file for details.

Acknowledgments

  • TinyDB - The original Python implementation

Author

morninghao (morning.haoo@gmail.com)

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

tinydb_rust-0.9.0.tar.gz (80.7 kB view details)

Uploaded Source

Built Distribution

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

tinydb_rust-0.9.0-cp38-abi3-manylinux_2_34_aarch64.whl (1.0 MB view details)

Uploaded CPython 3.8+manylinux: glibc 2.34+ ARM64

File details

Details for the file tinydb_rust-0.9.0.tar.gz.

File metadata

  • Download URL: tinydb_rust-0.9.0.tar.gz
  • Upload date:
  • Size: 80.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: maturin/1.10.2

File hashes

Hashes for tinydb_rust-0.9.0.tar.gz
Algorithm Hash digest
SHA256 27a8070ab680be44a284399d43614eaf2b13efbf0bdeb11fd34be323b2eda809
MD5 5b469e9d5d219bd94bb801f9d66aec53
BLAKE2b-256 e736a0a38bb6da1a5a960e8b484138547514262758b55a24bf9428a8a65e9ce3

See more details on using hashes here.

File details

Details for the file tinydb_rust-0.9.0-cp38-abi3-manylinux_2_34_aarch64.whl.

File metadata

File hashes

Hashes for tinydb_rust-0.9.0-cp38-abi3-manylinux_2_34_aarch64.whl
Algorithm Hash digest
SHA256 1852040fb7117016c0b2838f237ef9fabff9deddc4479160ea00e78b52ff3e2f
MD5 feeef47c4fb6fecc8a4cefdcff7fad39
BLAKE2b-256 6f9525932cb3b768b495070bcfcf6f252743b2ac6cbb9cef07f84b9abf3d89c0

See more details on using hashes here.

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