Repository navigation
Releases: nitrosh/nitro-datastore
Releases · nitrosh/nitro-datastore
Release list
v1.1.0
v1.0.5
v1.0.4
v1.0.3
v1.0.2
v1.0.1
v1.0.0
nitro-datastore v1.0.0
The first stable release of nitro-datastore - a powerful Python library for managing JSON data with multiple access patterns and advanced querying capabilities.
Highlights
Three Ways to Access Your Data:
data.site.name # Dot notation
data['site']['name'] # Dictionary access
data.get('site.name') # Path-basedChainable Query Builder:
results = (data.query('posts')
.where(lambda p: p.get('published'))
.sort(key=lambda p: p.get('views'), reverse=True)
.limit(10)
.execute())Bulk Operations:
count = data.update_where(
condition=lambda path, value: 'http://' in value,
transform=lambda value: value.replace('http://', 'https://')
)Path Introspection:
emails = data.find_paths('users.*.email') # Pattern matching
stats = data.stats() # Data analysisKey Features
- Multiple Access Patterns - Dot notation, dictionary-style, and path-based access
- Chainable Queries - Filter, sort, limit, group, and pluck with elegant API
- Bulk Operations - Transform data efficiently with conditional updates
- Path Operations - Glob patterns (
*,**) and deep searching - File I/O - Load/merge JSON files and directories with deep merging
- Data Introspection - Analyse structure, compare versions, track changes
- Transformations - Immutable transformations for keys and values
- Security - Path traversal protection, file size limits, circular reference detection
- Performance - 1.8M+ ops/sec, intelligent caching, sub-millisecond queries
Performance (5MB Dataset)
- get() operations: 1.8M ops/sec
- has() operations: 2.9M ops/sec
- Query 3,402 items: 0.0011s
- Bulk update 3,401 values: 0.0796s
Installation
pip install nitro-datastoreQuick Start
from nitro_datastore import NitroDataStore
data = NitroDataStore.from_directory('configs/')
active_users = data.query('users').where(lambda u: u.get('active')).execute()
data.set('app.version', '1.0.0')
data.save('output.json')What's Included
- 0 Dependencies - Pure Python implementation
- Type Hints - Full type annotations with PEP 561 compliance
- 205 Tests - 100% test coverage
- 8 Examples - 2,589 lines of example code
- Security - Production-ready protection mechanisms
Documentation
See README.md for complete documentation and examples/ for detailed usage examples.
Requirements
- Python 3.7+
- No external dependencies
Get Started: pip install nitro-datastore