Skip to content

Latest commit

 

History

History
186 lines (127 loc) · 7.83 KB

README.md

File metadata and controls

186 lines (127 loc) · 7.83 KB

ArcadeDB Python Bindings

Moved: the Python bindings now live in ArcadeData/arcadedb-python. Install arcadedb (the native build, the default) or arcadedb-jvm (the JVM build); both use import arcadedb. Which package? explains the choice. The first releases of the new packages are 26.11.1, starting as pre-releases (pip install --pre arcadedb). arcadedb-embedded and import arcadedb_embedded are deprecated: arcadedb-embedded will get a last release that installs arcadedb. Report bindings issues and send bindings pull requests to the new repository. This repository will be archived; the benchmark tooling stays here for now.

Native Python bindings for ArcadeDB - the multi-model database that supports Graph, Document, Key/Value, Search Engine, Time Series, and Vector models.

Status: ✅ Production Ready | Platforms: 4 Supported


📚 Documentation

📖 Read the Full Documentation →


🚀 Quick Start

Installation

uv add arcadedb-embedded   # or: pip install arcadedb-embedded

Requirements:

  • Python 3.11 to 3.14 (CI runs all four on every supported platform). No Java installation required!
  • Supported Platforms: Prebuilt wheels for 4 platforms
    • Linux: x86_64, ARM64
    • macOS: Apple Silicon (ARM64)
    • Windows: x86_64

5-Minute Example

import arcadedb_embedded as arcadedb

# Create database (context manager for automatic open and close)
with arcadedb.create_database("./mydb") as db:
    # Create schema (DDL)
    db.command("sql", "CREATE DOCUMENT TYPE Person")
    db.command("sql", "CREATE PROPERTY Person.name STRING")
    db.command("sql", "CREATE PROPERTY Person.age INTEGER")

    # Insert data (requires transaction)
    with db.transaction():
        db.command("sql", "INSERT INTO Person SET name = ?, age = ?", "Alice", 30)

    # Query data
    result = db.query("sql", "SELECT FROM Person WHERE age > 25")
    for record in result:
        print(f"Name: {record.get('name')}")

👉 See full tutorial


✨ Features

  • ☕ No Java Installation Required: Bundled JRE (~44 MiB uncompressed)
  • 🌍 4 Platforms Supported: Linux (x86_64, ARM64), macOS (ARM64), Windows (x86_64)
  • 🚀 Embedded Mode: Direct database access in Python process (no network)
  • 🌐 Server Mode: Optional in-process HTTP server (HTTP API and wire protocols; the Studio web UI is not bundled, see Server Mode): it costs about 5 MB of wheel and nothing at runtime until you call create_server()
  • 📦 Self-contained: All dependencies bundled (~62 MiB current Linux wheel)
  • 🔄 Multi-model: Graph, Document, Key/Value, Vector, Time Series
  • 🔍 Multiple query languages: SQL and OpenCypher
  • ⚡ High performance: Direct JVM integration via JPype
  • 🔒 ACID transactions: Full transaction support
  • 🎯 Vector storage: Store and query vector embeddings with HNSW (JVector) indexing
  • 📥 Data import: Built-in CSV and ArcadeDB JSONL import

📦 What's Inside

The arcadedb-embedded package is platform-specific and self-contained:

Package Contents (the 26.10.1 Linux x86_64 wheel; varies by platform and version):

  • Wheel size (compressed): ~62 MiB
  • ArcadeDB JARs (uncompressed): ~39 MiB across 70 JARs
  • Bundled JRE (uncompressed): ~44 MiB (platform-specific Java 25 runtime via jlink, 15 modules)
  • Installed package size: ~83 MiB

The compressed wheel size is measured from dist/*.whl, and the installed package size is measured from the extracted site-packages/arcadedb_embedded/ directory.

Of that, the optional server stack is 11 JARs, 5.70MB uncompressed. Server Mode breaks the cost down and explains what you pay at runtime (nothing, until you start a server).

Note: Some JARs are excluded to optimize package size (e.g., gRPC wire protocol). The Studio jar is excluded because Studio bundles ApexCharts, which is not open source (ArcadeData/arcadedb#10579). See scripts/jar_exclusions.txt for details.

Import: import arcadedb_embedded as arcadedb


🧪 Testing

Tests run against the built wheel via the uv project at the repo root. No virtualenv activation is needed, and uv run works from anywhere in the repo:

# Run all tests
uv run pytest

# Run specific test file
uv run pytest tests/test_core.py -v

See testing documentation for detailed test documentation.


🔧 Building from Source (Advanced)

Linux uses Docker. macOS and Windows use a native Java 25+ JDK with jlink.

cd bindings/python/

# Install uv (one-time)
curl -LsSf https://astral.sh/uv/install.sh | sh

# Build for your current platform (auto-detected)
./scripts/build.sh

Built wheels will be in dist/. The build script also refreshes the uv dev environment at the repo root, so uv run pytest immediately tests the wheel you just built.

Build instructions

Developer Note: See build architecture docs for comprehensive documentation of the multi-platform build architecture, including how we achieve platform-specific JRE bundling across the supported platforms on GitHub Actions.

Development

Versions are automatically extracted from the main ArcadeDB pom.xml. See versioning strategy for details on development vs release mode handling.


📋 Package Structure

arcadedb_embedded/
├── async_executor.py    # Asynchronous command/query + record execution
├── core.py              # Database and DatabaseFactory
├── exceptions.py        # ArcadeDBError exception
├── exporter.py          # Data export (JSONL, CSV)
├── graph.py             # Graph wrappers
├── graph_batch.py       # GraphBatch high-throughput graph ingest wrapper
├── importer.py          # Data import (CSV, XML, ArcadeDB JSONL)
├── __init__.py          # Public API exports
├── jvm.py               # JVM lifecycle management
├── _logging.py          # Internal logging helpers
├── results.py           # ResultSet and Result wrappers
├── schema.py            # Schema management API
├── server.py            # ArcadeDBServer for optional HTTP server mode
├── transactions.py      # TransactionContext manager
├── type_conversion.py   # Python-Java type conversion utilities
└── vector.py            # Vector search and HNSW (JVector) indexing

Architecture details


🤝 Contributing

See our contributing guidelines

📄 License

Both upstream ArcadeDB (Java) and this ArcadeDB Embedded Python project are licensed under Apache 2.0, fully open and free for everyone, including commercial use.


🔗 Links