Skip to content

v1.0.0

Choose a tag to compare

@sn sn released this 18 Nov 13:57
· 19 commits to main since this release

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-based

Chainable 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 analysis

Key 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-datastore

Quick 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