Skip to main content

Aerospike Python Client - PyO3 + Rust binding

Project description

aerospike-py

CI Python Rust PyO3 License

Aerospike Python Client built with PyO3 + Rust. Drop-in replacement for aerospike-client-python powered by the Aerospike Rust Client v2.

Features

  • Sync and Async (AsyncClient) API
  • CRUD, Batch, Query/Scan, UDF, Admin, Index, Truncate
  • CDT List/Map Operations, Expression Filters
  • Full type stubs (.pyi) for IDE autocompletion

API details: docs/api/ | Usage guides: docs/guides/

Quickstart

Install (from source)

git clone https://github.com/KimSoungRyoul/aerospike-py.git
cd aerospike-py

python -m venv .venv && source .venv/bin/activate
pip install maturin && maturin develop

Start Aerospike Server

podman run -d --name aerospike \
  -p 3000:3000 -p 3001:3001 -p 3002:3002 \
  --shm-size=1g \
  -e "NAMESPACE=test" \
  -e "DEFAULT_TTL=2592000" \
  -v ./scripts/aerospike.template.conf:/etc/aerospike/aerospike.template.conf \
  aerospike:ce-8.1.0.3_1

scripts/aerospike.template.confaccess-address 127.0.0.1이 설정되어 있습니다. Rust 기반 client는 서버가 알려주는 컨테이너 내부 IP로 재연결을 시도하므로, 이 설정이 필수입니다.

Sync Client

import aerospike_py as aerospike

with aerospike.client({
    "hosts": [("127.0.0.1", 3000)],
    "cluster_name": "docker",
}).connect() as client:

    key = ("test", "demo", "user1")
    client.put(key, {"name": "Alice", "age": 30})

    _, meta, bins = client.get(key)
    print(bins)  # {'name': 'Alice', 'age': 30}

    client.increment(key, "age", 1)
    client.remove(key)

Async Client

import asyncio
from aerospike_py import AsyncClient

async def main():
    async with AsyncClient({
        "hosts": [("127.0.0.1", 3000)],
        "cluster_name": "docker",
    }) as client:
        await client.connect()

        key = ("test", "demo", "user1")
        await client.put(key, {"name": "Bob", "age": 25})
        _, _, bins = await client.get(key)
        print(bins)

        # Concurrent operations
        tasks = [client.put(("test", "demo", f"item_{i}"), {"idx": i}) for i in range(10)]
        await asyncio.gather(*tasks)

asyncio.run(main())

Performance

Benchmark: 5,000 ops x 100 rounds, Aerospike CE (Docker), Apple M4 Pro

Operation aerospike-py (Rust) official (C) async (Rust) Async vs C
put 0.140 0.139 0.058 2.4x faster
get 0.141 0.141 0.063 2.2x faster

Sync performance is on par with the official C client. AsyncClient + asyncio.gather improves throughput by 2.2-2.4x. Full results: bash benchmark/run_all.sh 5000 100

Contributing

Setup

git clone https://github.com/KimSoungRyoul/aerospike-py.git
cd aerospike-py

python -m venv .venv && source .venv/bin/activate
pip install maturin pytest pytest-asyncio
maturin develop

Running Tests

Aerospike 서버가 필요합니다 (unit 테스트 제외). 위의 Start Aerospike Server를 참고하세요.

# Unit tests (no server needed)
uvx --with tox-uv tox -e py312

# Integration tests
uvx --with tox-uv tox -e integration

# Concurrency / Feasibility tests
uvx --with tox-uv tox -e concurrency
uvx --with tox-uv tox -e fastapi
uvx --with tox-uv tox -e gunicorn

# Official client compatibility tests
uvx --with tox-uv tox -e compat

# All tests
uvx --with tox-uv tox -e all

Making Changes

  1. Rust code (rust/src/): Edit, then maturin develop to rebuild.
  2. Python code (src/aerospike_py/): Changes apply immediately.
  3. Tests: Add to tests/unit/ or tests/integration/ as appropriate.

Architecture details: docs/contributing.md

License

Apache License 2.0 — see LICENSE for details.

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

aerospike_py-0.0.1.dev2.tar.gz (64.3 kB view details)

Uploaded Source

Built Distributions

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

aerospike_py-0.0.1.dev2-pp311-pypy311_pp73-manylinux_2_28_x86_64.whl (3.9 MB view details)

Uploaded PyPymanylinux: glibc 2.28+ x86-64

aerospike_py-0.0.1.dev2-pp311-pypy311_pp73-manylinux_2_28_aarch64.whl (3.9 MB view details)

Uploaded PyPymanylinux: glibc 2.28+ ARM64

aerospike_py-0.0.1.dev2-cp314-cp314t-manylinux_2_28_aarch64.whl (3.9 MB view details)

Uploaded CPython 3.14tmanylinux: glibc 2.28+ ARM64

aerospike_py-0.0.1.dev2-cp314-cp314-manylinux_2_28_x86_64.whl (3.9 MB view details)

Uploaded CPython 3.14manylinux: glibc 2.28+ x86-64

aerospike_py-0.0.1.dev2-cp314-cp314-manylinux_2_28_aarch64.whl (3.9 MB view details)

Uploaded CPython 3.14manylinux: glibc 2.28+ ARM64

aerospike_py-0.0.1.dev2-cp313-cp313t-manylinux_2_28_aarch64.whl (3.9 MB view details)

Uploaded CPython 3.13tmanylinux: glibc 2.28+ ARM64

aerospike_py-0.0.1.dev2-cp313-cp313-win_amd64.whl (4.2 MB view details)

Uploaded CPython 3.13Windows x86-64

aerospike_py-0.0.1.dev2-cp313-cp313-manylinux_2_28_x86_64.whl (3.9 MB view details)

Uploaded CPython 3.13manylinux: glibc 2.28+ x86-64

aerospike_py-0.0.1.dev2-cp313-cp313-manylinux_2_28_aarch64.whl (3.9 MB view details)

Uploaded CPython 3.13manylinux: glibc 2.28+ ARM64

aerospike_py-0.0.1.dev2-cp313-cp313-macosx_11_0_arm64.whl (3.8 MB view details)

Uploaded CPython 3.13macOS 11.0+ ARM64

aerospike_py-0.0.1.dev2-cp313-cp313-macosx_10_12_x86_64.whl (4.0 MB view details)

Uploaded CPython 3.13macOS 10.12+ x86-64

aerospike_py-0.0.1.dev2-cp312-cp312-manylinux_2_28_x86_64.whl (3.9 MB view details)

Uploaded CPython 3.12manylinux: glibc 2.28+ x86-64

aerospike_py-0.0.1.dev2-cp312-cp312-manylinux_2_28_aarch64.whl (3.9 MB view details)

Uploaded CPython 3.12manylinux: glibc 2.28+ ARM64

aerospike_py-0.0.1.dev2-cp311-cp311-manylinux_2_28_x86_64.whl (3.9 MB view details)

Uploaded CPython 3.11manylinux: glibc 2.28+ x86-64

aerospike_py-0.0.1.dev2-cp311-cp311-manylinux_2_28_aarch64.whl (3.9 MB view details)

Uploaded CPython 3.11manylinux: glibc 2.28+ ARM64

aerospike_py-0.0.1.dev2-cp310-cp310-manylinux_2_28_x86_64.whl (3.9 MB view details)

Uploaded CPython 3.10manylinux: glibc 2.28+ x86-64

aerospike_py-0.0.1.dev2-cp310-cp310-manylinux_2_28_aarch64.whl (3.9 MB view details)

Uploaded CPython 3.10manylinux: glibc 2.28+ ARM64

File details

Details for the file aerospike_py-0.0.1.dev2.tar.gz.

File metadata

  • Download URL: aerospike_py-0.0.1.dev2.tar.gz
  • Upload date:
  • Size: 64.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for aerospike_py-0.0.1.dev2.tar.gz
Algorithm Hash digest
SHA256 47a5088162d30bf8f528cefc3c0c4ce7607e44aac59c2915e13630fcc8a32c63
MD5 32624cab1730e694a1eb2dd80109c514
BLAKE2b-256 506c95302961a97e395e8117739181701f70160dfad29783e7d7ad336ff6757c

See more details on using hashes here.

Provenance

The following attestation bundles were made for aerospike_py-0.0.1.dev2.tar.gz:

Publisher: publish.yaml on KimSoungRyoul/aerospike-py

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

File details

Details for the file aerospike_py-0.0.1.dev2-pp311-pypy311_pp73-manylinux_2_28_x86_64.whl.

File metadata

File hashes

Hashes for aerospike_py-0.0.1.dev2-pp311-pypy311_pp73-manylinux_2_28_x86_64.whl
Algorithm Hash digest
SHA256 e49b61d1ca7937917da6403a0b5c2dee7be647f130c49d6afab37bb013891791
MD5 452d623e2f7b49d23edfae300c3fecbd
BLAKE2b-256 5bf49a9dcf44bbd72b5a7a3a5cc46e9fed53f4d00f3ef8547efe2473aca961b3

See more details on using hashes here.

Provenance

The following attestation bundles were made for aerospike_py-0.0.1.dev2-pp311-pypy311_pp73-manylinux_2_28_x86_64.whl:

Publisher: publish.yaml on KimSoungRyoul/aerospike-py

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

File details

Details for the file aerospike_py-0.0.1.dev2-pp311-pypy311_pp73-manylinux_2_28_aarch64.whl.

File metadata

File hashes

Hashes for aerospike_py-0.0.1.dev2-pp311-pypy311_pp73-manylinux_2_28_aarch64.whl
Algorithm Hash digest
SHA256 8e8621fc8fc8ee5b46710a76d7f08fe5b21ee763c1e9a708c7ea0bf65c047d6d
MD5 0a5ec1bb8de3f43c0041211a8b4b2545
BLAKE2b-256 c2e3e780c14397b25cf39bd2a013cf304f2efb5eef1e4d2729b6d5ce90047989

See more details on using hashes here.

Provenance

The following attestation bundles were made for aerospike_py-0.0.1.dev2-pp311-pypy311_pp73-manylinux_2_28_aarch64.whl:

Publisher: publish.yaml on KimSoungRyoul/aerospike-py

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

File details

Details for the file aerospike_py-0.0.1.dev2-cp314-cp314t-manylinux_2_28_aarch64.whl.

File metadata

File hashes

Hashes for aerospike_py-0.0.1.dev2-cp314-cp314t-manylinux_2_28_aarch64.whl
Algorithm Hash digest
SHA256 a867322463da1eb105405008c89a8085c2672ef4feb83597d011e17cb78565f4
MD5 960e67c548bffccb34d62df3e772faf6
BLAKE2b-256 fa498f2f01d5d69dc6c7cca7f601f3cdc7e24543bd70c9d447ff9f2c26aa7d5e

See more details on using hashes here.

Provenance

The following attestation bundles were made for aerospike_py-0.0.1.dev2-cp314-cp314t-manylinux_2_28_aarch64.whl:

Publisher: publish.yaml on KimSoungRyoul/aerospike-py

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

File details

Details for the file aerospike_py-0.0.1.dev2-cp314-cp314-manylinux_2_28_x86_64.whl.

File metadata

File hashes

Hashes for aerospike_py-0.0.1.dev2-cp314-cp314-manylinux_2_28_x86_64.whl
Algorithm Hash digest
SHA256 c87afed87a2f83e25292ab828e8ea8cffaba7e123893c7a9ac9c1a73aeda5ec3
MD5 358ab54b4af40d7b06e679eae6559f7e
BLAKE2b-256 85d69593564e33f6eca026992c8c39de3765c4db2921d3a036d3d6a333a941d0

See more details on using hashes here.

Provenance

The following attestation bundles were made for aerospike_py-0.0.1.dev2-cp314-cp314-manylinux_2_28_x86_64.whl:

Publisher: publish.yaml on KimSoungRyoul/aerospike-py

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

File details

Details for the file aerospike_py-0.0.1.dev2-cp314-cp314-manylinux_2_28_aarch64.whl.

File metadata

File hashes

Hashes for aerospike_py-0.0.1.dev2-cp314-cp314-manylinux_2_28_aarch64.whl
Algorithm Hash digest
SHA256 cc42d48454346285bceb74c42e13b841084fa171accc15495ce17158ed4bfd5b
MD5 15d84aea80add78f9a6c22bfd7a621d4
BLAKE2b-256 858e535ede584a136c77fd3984ac5f8229aece713d492e0ca914e6fbd28a79e0

See more details on using hashes here.

Provenance

The following attestation bundles were made for aerospike_py-0.0.1.dev2-cp314-cp314-manylinux_2_28_aarch64.whl:

Publisher: publish.yaml on KimSoungRyoul/aerospike-py

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

File details

Details for the file aerospike_py-0.0.1.dev2-cp313-cp313t-manylinux_2_28_aarch64.whl.

File metadata

File hashes

Hashes for aerospike_py-0.0.1.dev2-cp313-cp313t-manylinux_2_28_aarch64.whl
Algorithm Hash digest
SHA256 95ec4cbe31d4d1e428cb9863b259619f877b43a87cb364cd3ad584f9d3233a58
MD5 0ac68f9dfb98b8af9d8822858bca481f
BLAKE2b-256 cdcd96dadff5e236c18a46e4f78457b7d04954bf5c269385192e580383e1c310

See more details on using hashes here.

Provenance

The following attestation bundles were made for aerospike_py-0.0.1.dev2-cp313-cp313t-manylinux_2_28_aarch64.whl:

Publisher: publish.yaml on KimSoungRyoul/aerospike-py

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

File details

Details for the file aerospike_py-0.0.1.dev2-cp313-cp313-win_amd64.whl.

File metadata

File hashes

Hashes for aerospike_py-0.0.1.dev2-cp313-cp313-win_amd64.whl
Algorithm Hash digest
SHA256 c5becf901c3c5c44988adfd0533d3462ec87d7aadec0364f53b18171c04d8962
MD5 74ee249161a79e04934f9cca0948a97f
BLAKE2b-256 9a72b9f37ae28d67c63fc5b36df2283f64889bb00c7407ef721d119bbbcc1a39

See more details on using hashes here.

Provenance

The following attestation bundles were made for aerospike_py-0.0.1.dev2-cp313-cp313-win_amd64.whl:

Publisher: publish.yaml on KimSoungRyoul/aerospike-py

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

File details

Details for the file aerospike_py-0.0.1.dev2-cp313-cp313-manylinux_2_28_x86_64.whl.

File metadata

File hashes

Hashes for aerospike_py-0.0.1.dev2-cp313-cp313-manylinux_2_28_x86_64.whl
Algorithm Hash digest
SHA256 8b9d8fd23af566a6f0fd605d95c6edc1e27e7689b84c939d3538ae2d34041d3b
MD5 0d1342b8c68d663e10ae85a924d7c745
BLAKE2b-256 3438640761db6cd6360e11466e36971b8070d897c3d11c2bc1b8be357de19475

See more details on using hashes here.

Provenance

The following attestation bundles were made for aerospike_py-0.0.1.dev2-cp313-cp313-manylinux_2_28_x86_64.whl:

Publisher: publish.yaml on KimSoungRyoul/aerospike-py

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

File details

Details for the file aerospike_py-0.0.1.dev2-cp313-cp313-manylinux_2_28_aarch64.whl.

File metadata

File hashes

Hashes for aerospike_py-0.0.1.dev2-cp313-cp313-manylinux_2_28_aarch64.whl
Algorithm Hash digest
SHA256 ebcd4efd72391c4e0f2d23dab46f0a5c8ac09c4d88eaa2151f86fdc590999eff
MD5 1a6bfe56b8564c687dc167f45077571e
BLAKE2b-256 6e77371a08288ced5fb115ff7f17af2b9ab7af778ac56ccce16dd0bc80f64cec

See more details on using hashes here.

Provenance

The following attestation bundles were made for aerospike_py-0.0.1.dev2-cp313-cp313-manylinux_2_28_aarch64.whl:

Publisher: publish.yaml on KimSoungRyoul/aerospike-py

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

File details

Details for the file aerospike_py-0.0.1.dev2-cp313-cp313-macosx_11_0_arm64.whl.

File metadata

File hashes

Hashes for aerospike_py-0.0.1.dev2-cp313-cp313-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 62b74f9a21ce367793028938c577b7e28cf05efd6647b1003cecd7fbf248f290
MD5 6d436b5578784e842a9d759336000b90
BLAKE2b-256 25cb58cb57f00fd12ba252441bac30bc3b6046a091b841b874998a2ef52ebbf5

See more details on using hashes here.

Provenance

The following attestation bundles were made for aerospike_py-0.0.1.dev2-cp313-cp313-macosx_11_0_arm64.whl:

Publisher: publish.yaml on KimSoungRyoul/aerospike-py

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

File details

Details for the file aerospike_py-0.0.1.dev2-cp313-cp313-macosx_10_12_x86_64.whl.

File metadata

File hashes

Hashes for aerospike_py-0.0.1.dev2-cp313-cp313-macosx_10_12_x86_64.whl
Algorithm Hash digest
SHA256 5bd18f058b01748ef857fc0bccfcbbb74f8c2ba392682632281f8cc9c3197786
MD5 f157d188c178e4eecc09111123d3ce28
BLAKE2b-256 4a42ebff780b2a1cddb3e9da8fb198aaf96079e625211e1507a43231ec1dd856

See more details on using hashes here.

Provenance

The following attestation bundles were made for aerospike_py-0.0.1.dev2-cp313-cp313-macosx_10_12_x86_64.whl:

Publisher: publish.yaml on KimSoungRyoul/aerospike-py

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

File details

Details for the file aerospike_py-0.0.1.dev2-cp312-cp312-manylinux_2_28_x86_64.whl.

File metadata

File hashes

Hashes for aerospike_py-0.0.1.dev2-cp312-cp312-manylinux_2_28_x86_64.whl
Algorithm Hash digest
SHA256 65b94952121e5bcdb88f124bb40a890a78c922ba1a3f59d6c5e0db33bc37bcbd
MD5 bbf0960cdc1607c2929b1ede4fd881c3
BLAKE2b-256 c244930b1735c08d355231fea08758d57d5c537c7c5c93b958cae5ee5fd94cb3

See more details on using hashes here.

Provenance

The following attestation bundles were made for aerospike_py-0.0.1.dev2-cp312-cp312-manylinux_2_28_x86_64.whl:

Publisher: publish.yaml on KimSoungRyoul/aerospike-py

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

File details

Details for the file aerospike_py-0.0.1.dev2-cp312-cp312-manylinux_2_28_aarch64.whl.

File metadata

File hashes

Hashes for aerospike_py-0.0.1.dev2-cp312-cp312-manylinux_2_28_aarch64.whl
Algorithm Hash digest
SHA256 303fb5941a477a159aacc121cbc00f8f617baa7a7817807002112277aaf50409
MD5 7fd47b78ca3256177c61bc33bd23c826
BLAKE2b-256 866c42ca8391febf5c7b2fedb5023d80e0b66d717182a23df4ee2828940d4c67

See more details on using hashes here.

Provenance

The following attestation bundles were made for aerospike_py-0.0.1.dev2-cp312-cp312-manylinux_2_28_aarch64.whl:

Publisher: publish.yaml on KimSoungRyoul/aerospike-py

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

File details

Details for the file aerospike_py-0.0.1.dev2-cp311-cp311-manylinux_2_28_x86_64.whl.

File metadata

File hashes

Hashes for aerospike_py-0.0.1.dev2-cp311-cp311-manylinux_2_28_x86_64.whl
Algorithm Hash digest
SHA256 ec5d495fbf223de855901424ce68d6cd98c8f5f44e1e1110dca7f067a6328311
MD5 67e4e1c8bf836563e2ae6812d686f8be
BLAKE2b-256 4167a5eeb971ad1d1a005d70a16b90ad95534cbd19b62808ecbd839b32472abd

See more details on using hashes here.

Provenance

The following attestation bundles were made for aerospike_py-0.0.1.dev2-cp311-cp311-manylinux_2_28_x86_64.whl:

Publisher: publish.yaml on KimSoungRyoul/aerospike-py

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

File details

Details for the file aerospike_py-0.0.1.dev2-cp311-cp311-manylinux_2_28_aarch64.whl.

File metadata

File hashes

Hashes for aerospike_py-0.0.1.dev2-cp311-cp311-manylinux_2_28_aarch64.whl
Algorithm Hash digest
SHA256 3b3b28415da30b4999d3b913544673f4001e2ea3057b787eb5df2151b4b7da56
MD5 e8649f82d2f967e0994abf83059fe9d0
BLAKE2b-256 6d1c570d8f1db34b681a2993516a3b63c1ba69f059065304d6cff1915d5896b1

See more details on using hashes here.

Provenance

The following attestation bundles were made for aerospike_py-0.0.1.dev2-cp311-cp311-manylinux_2_28_aarch64.whl:

Publisher: publish.yaml on KimSoungRyoul/aerospike-py

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

File details

Details for the file aerospike_py-0.0.1.dev2-cp310-cp310-manylinux_2_28_x86_64.whl.

File metadata

File hashes

Hashes for aerospike_py-0.0.1.dev2-cp310-cp310-manylinux_2_28_x86_64.whl
Algorithm Hash digest
SHA256 5d2903d872cdecbb7ba903f9578550943637825df826a16c0b253c86ba1989ca
MD5 6f9fd37be0ab3fc7c8b510bf48f288f3
BLAKE2b-256 02b54ac3419436d93d908c085ebc0975f57f373bc2b8bbc30a73b16cba93f92a

See more details on using hashes here.

Provenance

The following attestation bundles were made for aerospike_py-0.0.1.dev2-cp310-cp310-manylinux_2_28_x86_64.whl:

Publisher: publish.yaml on KimSoungRyoul/aerospike-py

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

File details

Details for the file aerospike_py-0.0.1.dev2-cp310-cp310-manylinux_2_28_aarch64.whl.

File metadata

File hashes

Hashes for aerospike_py-0.0.1.dev2-cp310-cp310-manylinux_2_28_aarch64.whl
Algorithm Hash digest
SHA256 55669f75ebfd003469474d4414f6125ce71b327cc135e9686c66d3a0e9139707
MD5 a82ee3e667ceb961e06e0f8d5920d644
BLAKE2b-256 a871509e0ac32ba4a294a310f7a1de52ae0120efc77d29e83b93e143ef04eaf4

See more details on using hashes here.

Provenance

The following attestation bundles were made for aerospike_py-0.0.1.dev2-cp310-cp310-manylinux_2_28_aarch64.whl:

Publisher: publish.yaml on KimSoungRyoul/aerospike-py

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