Skip to main content

Python SDK for Antfly distributed key-value store and search engine

Project description

Antfly Python SDK

PyPI version Python

Python SDK for Antfly - a distributed key-value store and search engine.

For the nightly version, visit the TestPyPI page.

Installation

pip install antfly-sdk

Quick Start

from antfly import AntflyClient

# Initialize client
client = AntflyClient(
    base_url="http://localhost:8080",
    username="admin",
    password="password"
)

# Create a table
client.create_table(
    name="users",
    num_shards=4,
    schema={
        "key": "user_id",
        "document_types": {
            "user": {
                "fields": {
                    "name": {"type": "string"},
                    "email": {"type": "keyword"},
                    "age": {"type": "int"},
                    "created_at": {"type": "time"}
                }
            }
        }
    }
)

# Insert data
client.batch(
    table="users",
    inserts={
        "user:1": {
            "name": "John Doe",
            "email": "john@example.com",
            "age": 30
        },
        "user:2": {
            "name": "Jane Smith",
            "email": "jane@example.com",
            "age": 25
        }
    }
)

# Query data
results = client.query(
    table="users",
    full_text_search={"query": "John"},
    limit=10
)

# Get specific record
user = client.get(table="users", key="user:1")

Features

  • Simple API: Intuitive interface for all Antfly operations
  • Type Safety: Full type hints for better IDE support
  • Authentication: Built-in support for basic authentication
  • Error Handling: Comprehensive error handling with custom exceptions
  • Auto-generated Client: Based on OpenAPI specification for accuracy

Development

Setup

  1. Clone the repository
  2. Install development dependencies:
uv sync

Generate Client

The SDK uses an auto-generated client based on the Antfly OpenAPI specification:

make generate

Run Tests

make test

Build Package

make build

Documentation

make docs will generate the documentation in the docs/ folder.

Full documentation is available at https://antfly-sdk-python.readthedocs.io

License

Apache License 2.0

Warning

Some models cannot be autogenerated from the spec

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

antfly_sdk-0.0.2.dev2.tar.gz (315.3 kB view details)

Uploaded Source

Built Distribution

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

antfly_sdk-0.0.2.dev2-py3-none-any.whl (659.9 kB view details)

Uploaded Python 3

File details

Details for the file antfly_sdk-0.0.2.dev2.tar.gz.

File metadata

  • Download URL: antfly_sdk-0.0.2.dev2.tar.gz
  • Upload date:
  • Size: 315.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for antfly_sdk-0.0.2.dev2.tar.gz
Algorithm Hash digest
SHA256 bb69866e6be16525667b28fa58577a69e78abc267ae63246dd139f6e6dccc6fa
MD5 7f284e06aa057e53442a9adb7fff1366
BLAKE2b-256 b6a7e7cacd8b4a9e22e575b56e41d74d59c2c5a59ae6deaf0528c3af7360317a

See more details on using hashes here.

Provenance

The following attestation bundles were made for antfly_sdk-0.0.2.dev2.tar.gz:

Publisher: py-pypi-publish.yml on antflydb/antfly

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file antfly_sdk-0.0.2.dev2-py3-none-any.whl.

File metadata

  • Download URL: antfly_sdk-0.0.2.dev2-py3-none-any.whl
  • Upload date:
  • Size: 659.9 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for antfly_sdk-0.0.2.dev2-py3-none-any.whl
Algorithm Hash digest
SHA256 03e1cd3283a51c8e69d4c8592884ae1b29d69ec84f4252c6629a2ce256ab2ab6
MD5 6f6d43ba6edc53a32336d6c48e948b53
BLAKE2b-256 af2a92cf8527e34ce7fabe791e6336552345b8b14dcdd8941748ce6d93abf256

See more details on using hashes here.

Provenance

The following attestation bundles were made for antfly_sdk-0.0.2.dev2-py3-none-any.whl:

Publisher: py-pypi-publish.yml on antflydb/antfly

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

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