Skip to main content

[MVP] The official, high-performance Python client for ShadeDB cloud instances. ShadeDB provides a streamlined, developer-first approach to cloud data management. This library is designed to be the permanent interface for ShadeDB, ensuring a seamless transition from development to full-scale production.

Project description

The fastest way to interact with shadeDB — a machine-native, semi-structured database built for real-time systems, autonomous agents, and sub-millisecond ingestion.

shadedb mvp (premium server trial)

shadedb mvp (serverless)

Reach out via instagram for (premium server)

🧠 Agent-native
📡 Ultra-low latency
🧩 Minimal & composable
⚙️ Sync execution model
🐧 Structured Native Language (SNL)

PyPI - Version PyPI Downloads Platform License Facebook YouTube WhatsApp Instagram


Table of contents


Why shadeDB?

Traditional databases were built for humans.
shadeDB is built for machines.

Modern systems — AI agents, real-time pipelines, autonomous services — require:

  • deterministic execution
  • minimal parsing overhead
  • high-frequency ingestion
  • predictable latency

shadeDB introduces a command-based execution model optimized for speed, not syntax.


What is shadedb-api?

shadedb-api is a synchronous subcommunicator between your application and a remote shadeDB instance.

It is designed to:

  • relay commands efficiently
  • minimize transport overhead
  • preserve execution determinism
  • integrate cleanly into production systems

Installation

pip install shadedb-api

30‑Second Quickstart

from shadedb_api.frame.sync import syncFrame

db = syncFrame(
    endpoint="https://your-endpoint",
    token="your-db-token",
    inspection=True,
    query_timeout=60
)

Usage

Insert

result = db.snlComplexQuery(
    command="insert",
    context={"username": "shade", "age": 12}
)
print(result)

Update (Full Overwrite)

result = db.snlComplexQuery(
    command="update;id::int(1)",
    context={"username": "zeus", "age": 56, "email": "zeus@mail.com"}
)
print(result)

Query (SNL)

result = db.snlQuery("Fetch;id::int(1)")
print(result)

Structured Native Language (SNL)

SNL is a delimiter-based command language designed for:

  • ⚡ Fast parsing
  • 🔐 Safer execution
  • 🧠 Machine-native interaction

Below are common SNL patterns and examples.

Fetch

Direct record retrieval via indexed fields.

Fetch;username::sherifdeen

Record comparison/verification

Fetch;username::sherifdeen;verify(field='value')

Selective fields

Fetch;username::sherifdeen;get(username,role)

Atomic update

Fetch;username::sherifdeen;update(age='int(21)')

Where (Filtering)

Query non-unique fields.

Where;gender::male;get(username,role)

Pagination & Ordering

Modifiers:

  • page(x,y) — slice results from index X to Y
  • ascend — sort ascending
  • descend — sort descending

Example:

Where;status::active;start 1, limit 50;order(descend)

Insert / Update / Lifecycle

Insert — requires a valid JSON string. No overwrites by default.

Insert;jsonString({ "username":"admin", "id":56 })

Atomic field update:

Fetch;username::sherifdeen;update(age='int(43)')

Full record overwrite:

Update;username::sherifdeen;jsonString({ "username":"shade", "role":"admin" })

Data lifecycle commands:

  • Fold (soft delete, reversible)
Fold;id::int(17)
  • Unfold (restore)
Unfold;id::int(17)
  • Delete (permanent, storage reclaimed during compaction)
Delete;id::int(17)

⚠️Note : Fold and unfold are unavailable in mvp version.

Unique Fields

Default unique key:

[id]

Architecture

[ Application ]
       │
       ▼
[ shadedb-api (Sync Layer) ]
       │
       ▼
[ Network Transport ]
       │
       ▼
[ Remote shadeDB Instance ]

Module Overview

  • shadedb_api.frame.sync
    • Core execution engine: synchronous query dispatch, transport coordination, response handling
  • shadedb_api.frame.excepts
    • Custom exception system: structured errors, predictable failure modes, debugging clarity

CLI

# initialize with endpoint and token - saved as default config
shadedb-api-init https://endpoint YOUR_TOKEN

# Re-initialize with endpoint and token - not saved
shadedb-api https://endpoint YOUR_TOKEN

# start an interactive client / CLI with saved config
shadedb-api  

# run snl queries from api cli
[API] $/ fetch;id::int(12)

# navigate to console for robust options
[API] $/ console

# navigated to console 
CONSOLE $/ 

# change database name 
CONSOLE $/ name ::mydb
{'database name': 'mydb', 'message': 'database name changed', 'success': True}

# retrieve your database information
mydb $/ info
{'Default pagination': [1, 15], 'Name': 'mydb', 'Total size': '0.000000 / 2.0MB', 'Unique keys': ['id']}

# check your database storage size
mydb $/ stat :: volume
0.000000 / 2.0MB

# check your database unique fields
mydb $/ stat :: unique
[server ~ console]: {'unique keys': ['id']}

# modify your database unique fields
mydb $/ stat ::unique ::username,email,phone number
{'message': "Unique keys updated : ['username', 'email', 'phone number', 'id']", 'success': True}

# modify default page size during filter queries
mydb $/ stat :: limit :: 50
[server ~ console]: {'message': 'Limit changed'}

# insert to your database from console (snl) 
mydb $/ snl :: insert; {"username":"shade","email":"test@gmail.com"}
Database latency: 0.0037282

{'email': 'test@gmail.com', 'id': 1, 'username': 'shade'}

# fetch from your database from console (snl
mydb $/ snl :: fetch;id::int(1)
Database latency: 0.0008728

{'email': 'test@gmail.com', 'id': 1, 'username': 'shade'}

# update to your database from console (snl)
mydb $/ snl :: update;id::int(1); {"username":"sherifdeen","email":"test2@gmail.com"}
Database latency: 0.0017347

{'email': 'test2@gmail.com', 'id': 1, 'username': 'sherifdeen'}

# delete your remote database instance
mydb $/ stat :: terminate
{'message': 'Deleted'}

# close session from console
mydb $/ exit 2

Configuration

Example programmatic configuration:

db = syncFrame(
    endpoint="https://your-endpoint",
    token="your-token",
    inspection=True,
    query_timeout=60
)

Error Handling

Use the provided exception types to catch and inspect errors:

from shadedb_api.frame.excepts import URLEndpointMissingError, TokenMissingError, SNLMissingError, SNLContextMissingError


try:
    db.snlQuery("fetch;id::int(23)")
except TokenMissingError as e:
    print(f"shadeDB error: {e}")

Performance Philosophy

Execution speed scales with simplicity. shadeDB removes unnecessary abstraction layers:

  • fewer allocations
  • faster parsing
  • deterministic execution
  • increased uptime availability

Result: predictable, ultra-low latency at scale.


Use Cases

  • Autonomous AI agents
  • Real-time ingestion pipelines
  • High-frequency event systems
  • Edge data layers
  • Experimental database architectures

Requirements

  • Python 3.10+
  • A running shadeDB instance ( remote )

Contributing

  1. Fork the repository
  2. Create a feature branch (git checkout -b feat/your-feature)
  3. Make changes, add tests
  4. Open a pull request and describe your changes

Please follow the repository's code style and include tests where applicable.


Vision

shadeDB represents a shift from human-centric data systems.
The future isn’t dashboards. The future is agents thinking and executing at lightning speed.


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

shadedb_api-0.4.9.tar.gz (26.5 kB view details)

Uploaded Source

Built Distribution

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

shadedb_api-0.4.9-py3-none-any.whl (24.6 kB view details)

Uploaded Python 3

File details

Details for the file shadedb_api-0.4.9.tar.gz.

File metadata

  • Download URL: shadedb_api-0.4.9.tar.gz
  • Upload date:
  • Size: 26.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.14.5

File hashes

Hashes for shadedb_api-0.4.9.tar.gz
Algorithm Hash digest
SHA256 0db469b18f1af6d3afa643d9cb9294fe92510873716dadae62d89ff12c106112
MD5 b2a2d654cb248e19f1eb326cd674eb14
BLAKE2b-256 48e2ead2c0332c9bf8c6f7de21362322935a6fe295a9c25c904e405e686be26f

See more details on using hashes here.

File details

Details for the file shadedb_api-0.4.9-py3-none-any.whl.

File metadata

  • Download URL: shadedb_api-0.4.9-py3-none-any.whl
  • Upload date:
  • Size: 24.6 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.14.5

File hashes

Hashes for shadedb_api-0.4.9-py3-none-any.whl
Algorithm Hash digest
SHA256 9eb24703cd7697a24a47f6abb55b527593ad14812cac796c95c751be8e4e07f3
MD5 4cd3f56b309665b128e4289be49d24fb
BLAKE2b-256 3a942c793d6fec80ef806d9d3a9613a2991e6bfc9e8926df412b9dc01f869cd8

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