Skip to main content

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. Currently in mvp stage

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 :: page(1,50) :: 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'], 'Use cache': True}

# 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 :: page :: 1,30
[server ~ console]: {'message': 'Paged resized'}

# 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'}
# deactivate your database cache system
mydb $/ stat :: cache :: deactivate
{'message': 'cache deactivated', 'success': True}

# activate your database cache system
mydb $/ stat :: cache :: activate
{'message': 'cache activated', 'success': True}

# 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.1.8.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.1.8-py3-none-any.whl (24.6 kB view details)

Uploaded Python 3

File details

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

File metadata

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

File hashes

Hashes for shadedb_api-0.1.8.tar.gz
Algorithm Hash digest
SHA256 6f33d1500779ce46f277a9483a3ce696be6798020d04f118f39e002ee5748199
MD5 80d71650a6d5964b198e283b0ca693c2
BLAKE2b-256 f02fb38bc14225936c354db1e5028d91c055785682c41cd8c93914d0f938a434

See more details on using hashes here.

File details

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

File metadata

  • Download URL: shadedb_api-0.1.8-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.3

File hashes

Hashes for shadedb_api-0.1.8-py3-none-any.whl
Algorithm Hash digest
SHA256 f80fad6fa30051089b73893a232a1c59172c3ed4630e445cd2a57ae6a2715c23
MD5 39b5084cb0ef3cb6d61040a287b464f8
BLAKE2b-256 2c8be88b76a47fcbb16b996c7c8172f0b0cdc586bb9aa0cf0989694c88fc89f3

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