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

Uploaded PyPymanylinux: glibc 2.28+ ARM64

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

Uploaded CPython 3.13Windows x86-64

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

Uploaded CPython 3.13macOS 11.0+ ARM64

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

File metadata

File hashes

Hashes for aerospike_py-0.0.1.dev1-pp311-pypy311_pp73-manylinux_2_28_x86_64.whl
Algorithm Hash digest
SHA256 b8542ecccced8e31164f4cd95315e5809cba492f2fef782b91cb63a1680f5113
MD5 2c9ba65ae17c0fcf3a4be06194377d53
BLAKE2b-256 e209f460929e0554eaf8fa74f5f2b4d42c932a50afef80b4d052b7896074f852

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for aerospike_py-0.0.1.dev1-pp311-pypy311_pp73-manylinux_2_28_aarch64.whl
Algorithm Hash digest
SHA256 088eb73d1c389afcf225083bd8edcff162673c5917351dfc178618e0f11e8615
MD5 bb6765a559f7e4d04cb8bfeec57f767e
BLAKE2b-256 fbec7ff495b961afaafbc7e807c37d3add4a8491719e6d6da0daccac9e671cb7

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for aerospike_py-0.0.1.dev1-cp314-cp314t-manylinux_2_28_aarch64.whl
Algorithm Hash digest
SHA256 9a9dd3870ede3f240ea2a5ef62b7e007a4baa55fd799a7485915f5c4eb1513fd
MD5 13a7962323c2b7ace13b93b10a397b40
BLAKE2b-256 0029578a3b5884cd691adb26df83471b8f2ad5612e7ffa0172ac9e4b2fe358c3

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for aerospike_py-0.0.1.dev1-cp314-cp314-manylinux_2_28_x86_64.whl
Algorithm Hash digest
SHA256 8593f8c515f2522716e4ffd976ff8c8b8fc944e24b4ff04510d23bbce7d4cdb7
MD5 bcbed312a452489fd38e0d745e2e898b
BLAKE2b-256 b3c2c1d81b9ed312cee09c62190dba082d6175766873c6d5ef583790966e30b8

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for aerospike_py-0.0.1.dev1-cp314-cp314-manylinux_2_28_aarch64.whl
Algorithm Hash digest
SHA256 d10dd4cc9017000128b7538d565f55ffab023ed631990095d7dc040e4965d40d
MD5 7916bc04a0957df78757f1667807d27a
BLAKE2b-256 1f4f61559b61787762adeb948003935462d6023594726c99c186cea372f339b0

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for aerospike_py-0.0.1.dev1-cp313-cp313t-manylinux_2_28_aarch64.whl
Algorithm Hash digest
SHA256 0e5b566f49faeec3bd3fc776755a18bbdfb228cd1cc11727b509ddb8771b0293
MD5 0a9434019c146d06e2308987a343a059
BLAKE2b-256 1fbe6f664e714280c2c62be9f37b35def412962bd4b74d84abefca024c203ff0

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for aerospike_py-0.0.1.dev1-cp313-cp313-win_amd64.whl
Algorithm Hash digest
SHA256 0d781dd82eaf8c941a1e4909a125c6dd99e35d521a96bb6b55a6cdd0d38dd734
MD5 ce19a25661da949f19f8286acd845df2
BLAKE2b-256 388f21a979e0263ed14512872d54162e81366865d73a1acae93c812a746df5d2

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for aerospike_py-0.0.1.dev1-cp313-cp313-manylinux_2_28_x86_64.whl
Algorithm Hash digest
SHA256 81b0c02006aede9d91db538adb0826e92ee97ce19fefce552ef94ce19da0fce5
MD5 bc63720b2e2b559de6a883cba57b79ab
BLAKE2b-256 6bcd477af4f5c5cc8c4ddae42451db39486a47a1284d44bff7dad35c58d9c431

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for aerospike_py-0.0.1.dev1-cp313-cp313-manylinux_2_28_aarch64.whl
Algorithm Hash digest
SHA256 b16d9cc621ee1f5a65c202f86300b6d76bc6be8e103b7fcabf08c2fcfd3ffcd4
MD5 d8759978f71e48ffd9abbadd59bc8fa5
BLAKE2b-256 d1777fab865466eb5eb0e5dc6d5843ff20a6264671b28bcc9b53d2f44d083772

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for aerospike_py-0.0.1.dev1-cp313-cp313-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 e15c32456cf3cf3680853672619570d41ac7cb61408f23ca77fa3f14320dc6ca
MD5 2eedde6c060bcd956147303110bef3db
BLAKE2b-256 7d5949c802a3f38edd1554d8ee9c335166cdb81898febf9b580c9727faf0726b

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for aerospike_py-0.0.1.dev1-cp313-cp313-macosx_10_12_x86_64.whl
Algorithm Hash digest
SHA256 2ee6d7c1d74f7509a341e0cd67cfcaebfb532e1c2685f02cef3c77ff4269aaac
MD5 911e7dda90ab9dba74ab1810cf119332
BLAKE2b-256 6e8e1a8078fea0ec16fbc7e48902faa924a9321d2f5f55a1cc876e8b7158c2fa

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for aerospike_py-0.0.1.dev1-cp312-cp312-manylinux_2_28_x86_64.whl
Algorithm Hash digest
SHA256 50851ca1f3aeb7dd322b045aabdc94f419101a11aafb533f2ce6ebb85ca10cdc
MD5 7604ed5fc950e1486b14e1ab52734bce
BLAKE2b-256 3f66f7fb29afdce0724b1240b815fb08dcbdaefe14cd8e77d8c74006dd35611a

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for aerospike_py-0.0.1.dev1-cp312-cp312-manylinux_2_28_aarch64.whl
Algorithm Hash digest
SHA256 29f98618820f0a9b926def06fdaa6fdcd235fa06de68bd605aac9aec58b8ee79
MD5 59bc8c976c0c8e963e38838d250d6d10
BLAKE2b-256 aa5623ac8afd59641ed4c997f4dec15b69065683b734977ea27711efd76ee791

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for aerospike_py-0.0.1.dev1-cp311-cp311-manylinux_2_28_x86_64.whl
Algorithm Hash digest
SHA256 161132484e8c60324f392a287dc6a6ebd15a9eff20159e971bde2a77a6f2d5d5
MD5 bc72b9a58ac3274eabeb12c6d00a15f9
BLAKE2b-256 f58eb68a768c3f99d9a453ff675823bb57b7bf97bdf9a68ccf332e38c7cda39e

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for aerospike_py-0.0.1.dev1-cp311-cp311-manylinux_2_28_aarch64.whl
Algorithm Hash digest
SHA256 47b0c177959aae5eefb57e85d76c2c116343bc32e19c4f39678ab8cb8db79ec5
MD5 5037171f05366ecaf594caeb58bd4ac9
BLAKE2b-256 7d4ee5bde5eaa1e481d35b45d040c44ee3f2b4c6e5fea13ca6b29c3e37fb6b6e

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for aerospike_py-0.0.1.dev1-cp310-cp310-manylinux_2_28_x86_64.whl
Algorithm Hash digest
SHA256 435ce1bb2f26558f60e7c838cc3624dfdeacffb7c66ff2adc8b9728394522b14
MD5 4a3be0214cdb5112922a335cdade5945
BLAKE2b-256 8c31bc3c5e6451fcca71c39b0790275903231275384117df4f0b9cd5bbd8c619

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for aerospike_py-0.0.1.dev1-cp310-cp310-manylinux_2_28_aarch64.whl
Algorithm Hash digest
SHA256 b9cf42c9244948c7e8e313f301d900ab4c6144ff8126fad090cc8ba2bf532e4f
MD5 8a787ff13eaea4df0df5819d725fa3f8
BLAKE2b-256 4b462305647ffff95a5d74cec66a1e3fd25f518439ef26cb490eb4c0d2825c43

See more details on using hashes here.

Provenance

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