memcachio
A pure python async Memcached client with 0 dependencies with support for:
- All memcached commands
- Memcached servers serving on TCP or Unix Domain Sockets
- Memcached clusters
- SSL transport
- SASL Authentication
- Connection reuse for multiple concurrent requests
- Dynamically adjusted connection pooling
- Auto discovery with AWS ElastiCache
Installation
To install memcachio:
$ pip install memcachio
Quick start
Single Node or Cluster client
import asyncio
from memcachio import Client
async def example() -> None:
#: basic client
raw_client = Client(("localhost", 11211))
#: client that decodes the byte responses
decoding_client = Client(("localhost", 11211), decode_responses=True)
# or with a cluster
# cluster_client = Client([("localhost", 11211), ("localhost", 11212)], decode_responses=True)
await raw_client.flushall()
await raw_client.set("foo", b"1")
await raw_client.set("bar", b"2")
assert 2 == await raw_client.incr("foo", 1)
# use the raw client to get a value.
# Note the mapping returned has byte keys
assert (await raw_client.get("foo")).get(b"foo").value == b"2"
# get the values with the decoding client and touch their expiry to be 1 second.
# Note the mapping and the values are strings.
gat_and_touch_many = await decoding_client.gat("foo", "bar", expiry=1)
assert ["2", "2"] == [item.value for item in gat_and_touch_many.values()]
await asyncio.sleep(1)
assert {} == await decoding_client.get("foo", "bar")
asyncio.run(example())
See Client for detailed descriptions of available options when constructing a client.
Compatibility
memcachio is tested against memcached versions 1.6.x
Supported python versions
- 3.10
- 3.11
- 3.12
- 3.13
- PyPy 3.10
- PyPy 3.11
References
Metadata
Release files for memcachio 0.5.1
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| memcachio-0.5.1.tar.gz | 125.6 kB | With provenance | Details for memcachio-0.5.1.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| memcachio-0.5.1-py3-none-any.whl | Python 3 | none | any | Details for memcachio-0.5.1-py3-none-any.whl |
Total release size: 154.1 kB
Release files / memcachio-0.5.1.tar.gz
| Download URL | memcachio-0.5.1.tar.gz |
|---|---|
| Size | 125.6 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
e07a19938d2b8907cb83184dde3aa64a308eef7e6d5cf5eb5cbf557f4208483e
|
|
BLAKE2b-256 checksum How to use checksums |
61340e8d7a9956f10bb64102b4bc3a9e315724a915c159266c66c7d067d876f8
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/6.1.0 CPython/3.13.7
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Sep 29, 2025.
Transparency logRelease files / memcachio-0.5.1-py3-none-any.whl
| Download URL | memcachio-0.5.1-py3-none-any.whl |
|---|---|
| Size | 28.5 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
d358315c87f44c839ee2725ba8f35ad34acead4319a06a495bd839086698ec20
|
|
BLAKE2b-256 checksum How to use checksums |
5524192ac12e23e6b9ae542f1cee6592dc10104333cfd79c4b22f0e40290b7e5
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/6.1.0 CPython/3.13.7
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Sep 29, 2025.
Transparency logSecurity for memcachio 0.5.1
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
Full provenance
All 2 files in this release have been uploaded with provenance metadata.
Attestation for memcachio-0.5.1.tar.gz
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Sep 29, 2025.
Transparency logA note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.