Python SDK for Antfly distributed key-value store and search engine
Project description
Antfly Python SDK
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
- Clone the repository
- 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
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
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
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
bb69866e6be16525667b28fa58577a69e78abc267ae63246dd139f6e6dccc6fa
|
|
| MD5 |
7f284e06aa057e53442a9adb7fff1366
|
|
| BLAKE2b-256 |
b6a7e7cacd8b4a9e22e575b56e41d74d59c2c5a59ae6deaf0528c3af7360317a
|
Provenance
The following attestation bundles were made for antfly_sdk-0.0.2.dev2.tar.gz:
Publisher:
py-pypi-publish.yml on antflydb/antfly
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
antfly_sdk-0.0.2.dev2.tar.gz -
Subject digest:
bb69866e6be16525667b28fa58577a69e78abc267ae63246dd139f6e6dccc6fa - Sigstore transparency entry: 1714605400
- Sigstore integration time:
-
Permalink:
antflydb/antfly@28b3f6a6d3ab77fbc85812e12879505a2cd1dd80 -
Branch / Tag:
refs/tags/py/antfly/sdk/v0.0.2-dev2 - Owner: https://github.com/antflydb
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
py-pypi-publish.yml@28b3f6a6d3ab77fbc85812e12879505a2cd1dd80 -
Trigger Event:
push
-
Statement type:
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
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
03e1cd3283a51c8e69d4c8592884ae1b29d69ec84f4252c6629a2ce256ab2ab6
|
|
| MD5 |
6f6d43ba6edc53a32336d6c48e948b53
|
|
| BLAKE2b-256 |
af2a92cf8527e34ce7fabe791e6336552345b8b14dcdd8941748ce6d93abf256
|
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
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
antfly_sdk-0.0.2.dev2-py3-none-any.whl -
Subject digest:
03e1cd3283a51c8e69d4c8592884ae1b29d69ec84f4252c6629a2ce256ab2ab6 - Sigstore transparency entry: 1714605502
- Sigstore integration time:
-
Permalink:
antflydb/antfly@28b3f6a6d3ab77fbc85812e12879505a2cd1dd80 -
Branch / Tag:
refs/tags/py/antfly/sdk/v0.0.2-dev2 - Owner: https://github.com/antflydb
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
py-pypi-publish.yml@28b3f6a6d3ab77fbc85812e12879505a2cd1dd80 -
Trigger Event:
push
-
Statement type: