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 Distributions

No source distribution files available for this release.See tutorial on generating distribution archives.

Built Distributions

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

aerospike_py-0.0.1.dev0-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.dev0-pp311-pypy311_pp73-manylinux_2_28_aarch64.whl (3.9 MB view details)

Uploaded PyPymanylinux: glibc 2.28+ ARM64

aerospike_py-0.0.1.dev0-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.dev0-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.dev0-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.dev0-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.dev0-cp313-cp313-win_amd64.whl (4.2 MB view details)

Uploaded CPython 3.13Windows x86-64

aerospike_py-0.0.1.dev0-cp313-cp313-manylinux_2_28_x86_64.whl (3.8 MB view details)

Uploaded CPython 3.13manylinux: glibc 2.28+ x86-64

aerospike_py-0.0.1.dev0-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.dev0-cp313-cp313-macosx_11_0_arm64.whl (3.8 MB view details)

Uploaded CPython 3.13macOS 11.0+ ARM64

aerospike_py-0.0.1.dev0-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.dev0-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.dev0-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.dev0-cp311-cp311-manylinux_2_28_x86_64.whl (3.8 MB view details)

Uploaded CPython 3.11manylinux: glibc 2.28+ x86-64

aerospike_py-0.0.1.dev0-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.dev0-cp310-cp310-manylinux_2_28_x86_64.whl (3.8 MB view details)

Uploaded CPython 3.10manylinux: glibc 2.28+ x86-64

aerospike_py-0.0.1.dev0-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.dev0-pp311-pypy311_pp73-manylinux_2_28_x86_64.whl.

File metadata

File hashes

Hashes for aerospike_py-0.0.1.dev0-pp311-pypy311_pp73-manylinux_2_28_x86_64.whl
Algorithm Hash digest
SHA256 e46065a6f046259a6e803da08d03523f8ca9e6e55e51901723a429e9821ac492
MD5 f952df3364e040b4a0c8d50fa35e6612
BLAKE2b-256 1732c54bed7f828c51a115a81da813ca4d3aed1720437bd23585c6665489fa1c

See more details on using hashes here.

Provenance

The following attestation bundles were made for aerospike_py-0.0.1.dev0-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.dev0-pp311-pypy311_pp73-manylinux_2_28_aarch64.whl.

File metadata

File hashes

Hashes for aerospike_py-0.0.1.dev0-pp311-pypy311_pp73-manylinux_2_28_aarch64.whl
Algorithm Hash digest
SHA256 5312487d0b966c972e4e5901df49180a96c20cf579584e1623f7d4bf9ea0dcc1
MD5 4a2ff89b78312482740a94e8c338fee4
BLAKE2b-256 9103119474d0daafabf879f6eb1ab8d2ddd338fc1ebb3189e777d778fda4418f

See more details on using hashes here.

Provenance

The following attestation bundles were made for aerospike_py-0.0.1.dev0-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.dev0-cp314-cp314t-manylinux_2_28_aarch64.whl.

File metadata

File hashes

Hashes for aerospike_py-0.0.1.dev0-cp314-cp314t-manylinux_2_28_aarch64.whl
Algorithm Hash digest
SHA256 334f464536ab5c9023313208a2978c043430a15d88add8e49feaf72854fad68c
MD5 9f5734b1145110d318482335df3fc2ca
BLAKE2b-256 be1e277a4290ea1ea8bd19eeea3c125079e3ae41acd55c4b8839ff71bf65fc3d

See more details on using hashes here.

Provenance

The following attestation bundles were made for aerospike_py-0.0.1.dev0-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.dev0-cp314-cp314-manylinux_2_28_x86_64.whl.

File metadata

File hashes

Hashes for aerospike_py-0.0.1.dev0-cp314-cp314-manylinux_2_28_x86_64.whl
Algorithm Hash digest
SHA256 58c78958ca8e96bd647a725ebd3e9ebe793d56e37c8398c9843ec579c899c9ad
MD5 3d6d5f1c2a4a531496d3a88d254fcc6f
BLAKE2b-256 9c518472bde657eae21a8d8c7e4fd0dba6396476df14bcad38927f2968863f43

See more details on using hashes here.

Provenance

The following attestation bundles were made for aerospike_py-0.0.1.dev0-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.dev0-cp314-cp314-manylinux_2_28_aarch64.whl.

File metadata

File hashes

Hashes for aerospike_py-0.0.1.dev0-cp314-cp314-manylinux_2_28_aarch64.whl
Algorithm Hash digest
SHA256 95ee0e2278a67b9d9a87107f36fd3776be1b49a74483bef76155b414794a9379
MD5 894f607e72a1b9060640fbfe02f698a8
BLAKE2b-256 8f49589b565fb3bdb0e95ac9672efbec9d907e9bd9ec515dae77c7039f5441cf

See more details on using hashes here.

Provenance

The following attestation bundles were made for aerospike_py-0.0.1.dev0-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.dev0-cp313-cp313t-manylinux_2_28_aarch64.whl.

File metadata

File hashes

Hashes for aerospike_py-0.0.1.dev0-cp313-cp313t-manylinux_2_28_aarch64.whl
Algorithm Hash digest
SHA256 7861f16c1cd7557d2e72c83642567ac8e5a8c2f3790addde97fbfcd8a2bd3a22
MD5 7b59acf54cf4e36a4bad1b3e69d33c0d
BLAKE2b-256 5629d9ef2e4fbbb501c2312dfcdeb254885ea9b76e49b249e81defb2f1326c58

See more details on using hashes here.

Provenance

The following attestation bundles were made for aerospike_py-0.0.1.dev0-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.dev0-cp313-cp313-win_amd64.whl.

File metadata

File hashes

Hashes for aerospike_py-0.0.1.dev0-cp313-cp313-win_amd64.whl
Algorithm Hash digest
SHA256 1782789891cdc0d6a1512b2a159d66066fd680ebea612e2c75a2604d6dcc4f15
MD5 892ade19f79c740c49efc0915dcf6ca9
BLAKE2b-256 0828b30f667688e211a7021b36ac58fec2d18ced8faefebd836924e6f877cd1c

See more details on using hashes here.

Provenance

The following attestation bundles were made for aerospike_py-0.0.1.dev0-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.dev0-cp313-cp313-manylinux_2_28_x86_64.whl.

File metadata

File hashes

Hashes for aerospike_py-0.0.1.dev0-cp313-cp313-manylinux_2_28_x86_64.whl
Algorithm Hash digest
SHA256 b6459c37f99a0211a78d10d9f1567f5bf227c159bb2c984bdc3413bd2f0f5709
MD5 3bd59e54734032f605c1385b0b5213b8
BLAKE2b-256 9988408241e21f6d08cd4016f187493eb3c117f275168a24a1f5cf4010756e58

See more details on using hashes here.

Provenance

The following attestation bundles were made for aerospike_py-0.0.1.dev0-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.dev0-cp313-cp313-manylinux_2_28_aarch64.whl.

File metadata

File hashes

Hashes for aerospike_py-0.0.1.dev0-cp313-cp313-manylinux_2_28_aarch64.whl
Algorithm Hash digest
SHA256 9745d79718ad1768c380db4bc8183cd904bcb3e6f88d6f87ea38a3d27814735f
MD5 1e2a16ef1f812dfc0d7d9b65e1f3dd75
BLAKE2b-256 c0afcb306ca830ffe7a59fa5fcfdf3eba7e42b65f5d697bc30e2b0622137b5e8

See more details on using hashes here.

Provenance

The following attestation bundles were made for aerospike_py-0.0.1.dev0-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.dev0-cp313-cp313-macosx_11_0_arm64.whl.

File metadata

File hashes

Hashes for aerospike_py-0.0.1.dev0-cp313-cp313-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 a4d92923d77fa022097ee84aa34f118eeb0998fc1a89bf0b39a0b5666820379c
MD5 f5fe4d720e8a68748549f94868982692
BLAKE2b-256 1ef2c184b0e10c58cd2f7dc08fabb79d6183bdb8c7f7c208e422aed6eaac5e08

See more details on using hashes here.

Provenance

The following attestation bundles were made for aerospike_py-0.0.1.dev0-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.dev0-cp313-cp313-macosx_10_12_x86_64.whl.

File metadata

File hashes

Hashes for aerospike_py-0.0.1.dev0-cp313-cp313-macosx_10_12_x86_64.whl
Algorithm Hash digest
SHA256 4bf074bbb717ad4dbed22873ac0582d14b228af9edfca582b700a01f13804812
MD5 5912f34818d5bbb0dd55624cc2080626
BLAKE2b-256 b75a9d2b78929d65a9d88955195e515684bb0b6db3c2f6d1e4a820baed9f4abf

See more details on using hashes here.

Provenance

The following attestation bundles were made for aerospike_py-0.0.1.dev0-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.dev0-cp312-cp312-manylinux_2_28_x86_64.whl.

File metadata

File hashes

Hashes for aerospike_py-0.0.1.dev0-cp312-cp312-manylinux_2_28_x86_64.whl
Algorithm Hash digest
SHA256 839efd95947dd745f0a126ddac809cf8cff229054bf68bb7684af3641bb21259
MD5 5ef0949b0045737dbd08459fc9bd7696
BLAKE2b-256 9445efb8f813b11c855e61d373baae79fcac7f73d8d724f65d01121a4010299e

See more details on using hashes here.

Provenance

The following attestation bundles were made for aerospike_py-0.0.1.dev0-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.dev0-cp312-cp312-manylinux_2_28_aarch64.whl.

File metadata

File hashes

Hashes for aerospike_py-0.0.1.dev0-cp312-cp312-manylinux_2_28_aarch64.whl
Algorithm Hash digest
SHA256 57fcab8fca4597bd8db4f11eb4595e32092095502e37968ec9a2a90a1e291f19
MD5 9873dadcb058c220ec749998807014e7
BLAKE2b-256 149f9bcee5e38861d13b1b558ced44ed9e97c0095cb6a0b2ce24bbebaf8aa4c7

See more details on using hashes here.

Provenance

The following attestation bundles were made for aerospike_py-0.0.1.dev0-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.dev0-cp311-cp311-manylinux_2_28_x86_64.whl.

File metadata

File hashes

Hashes for aerospike_py-0.0.1.dev0-cp311-cp311-manylinux_2_28_x86_64.whl
Algorithm Hash digest
SHA256 7d5309f7aa9e9e45d208b4f0d721affefe48553f6da8838435aaa9b220221c6c
MD5 c9fab7747191e77f1c3de7802a9baa81
BLAKE2b-256 8b2e14c6070698df0b9422079925b6bb3eebb7dc017024bc9b5fb4000a94cf6a

See more details on using hashes here.

Provenance

The following attestation bundles were made for aerospike_py-0.0.1.dev0-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.dev0-cp311-cp311-manylinux_2_28_aarch64.whl.

File metadata

File hashes

Hashes for aerospike_py-0.0.1.dev0-cp311-cp311-manylinux_2_28_aarch64.whl
Algorithm Hash digest
SHA256 8d416cb5183ceb425f025188760f404f1e4bb80d14ed29f126ae43838af6e8f0
MD5 d5151750a7b04f19e9b995b35d0e9e73
BLAKE2b-256 90283c7aa11d2f7e71740e4c6062a78127156bd2ee624c108fb23d90a35a92d9

See more details on using hashes here.

Provenance

The following attestation bundles were made for aerospike_py-0.0.1.dev0-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.dev0-cp310-cp310-manylinux_2_28_x86_64.whl.

File metadata

File hashes

Hashes for aerospike_py-0.0.1.dev0-cp310-cp310-manylinux_2_28_x86_64.whl
Algorithm Hash digest
SHA256 40043ec044bc81af8a0f79326efe86ac65e6b6427c7ac398c09171f3d8926570
MD5 9b8b0232aa3df42edef774a130ed1322
BLAKE2b-256 8910b15fa4be70953f7b7fd8be2be1828f5b9979293b2674b4d4ea3b6dd957c2

See more details on using hashes here.

Provenance

The following attestation bundles were made for aerospike_py-0.0.1.dev0-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.dev0-cp310-cp310-manylinux_2_28_aarch64.whl.

File metadata

File hashes

Hashes for aerospike_py-0.0.1.dev0-cp310-cp310-manylinux_2_28_aarch64.whl
Algorithm Hash digest
SHA256 9c7e64bce4f9fc5e81573e7b9d6588c9b3ba8291dfd909de7f678f8c521087b0
MD5 e62f684489062761849a5fb62036fa26
BLAKE2b-256 0da4817c19f02aee156e1632789c195de32f6df18a5d6b565c2d3f4e8cd7081a

See more details on using hashes here.

Provenance

The following attestation bundles were made for aerospike_py-0.0.1.dev0-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