Wallet Attached Storage Client
Python client library for the Wallet Attached Storage specification.
Installation
pip install wallet-attached-storage-client
Usage
import json
from wallet_attached_storage_client import Ed25519Signer, StorageClient
# Generate a new Ed25519 key pair (or pass your own Ed25519PrivateKey)
signer = Ed25519Signer()
print(f"Signer DID: {signer.id}") # did:key:z6Mk...
with StorageClient("https://your-was-server.example") as client:
# 1. Create a space (auto-generates a urn:uuid)
space = client.space(signer=signer)
print(f"Space: {space.id}")
print(f"Path: {space.path}")
# 2. Write a resource into the space
resource = space.resource("/hello.txt")
put_resp = resource.put(b"Hello from Python!", "text/plain")
print(f"PUT {resource.path} -> {put_resp.status}") # 204
# 3. Read it back
get_resp = resource.get()
print(f"GET {resource.path} -> {get_resp.status}") # 200
print(f"Body: {get_resp.text()}") # Hello from Python!
# 4. Overwrite with JSON
doc = json.dumps({"greeting": "hi", "from": "python"}).encode()
resource.put(doc, "application/json")
print(f"JSON: {resource.get().json()}")
# 5. Delete the resource
del_resp = resource.delete()
print(f"DEL {resource.path} -> {del_resp.status}") # 204
# 6. Confirm it's gone
gone_resp = resource.get()
print(f"GET {resource.path} -> {gone_resp.status}") # 404
Custom Signers
Ed25519Signer is built in, but any object that satisfies the Signer protocol
works — you are not locked into a specific cryptography library:
class MySigner:
@property
def id(self) -> str:
"""Return a DID key identifier, e.g. did:key:z6Mkh..."""
...
def sign(self, data: bytes) -> bytes:
"""Sign raw bytes and return the raw signature bytes."""
...
API
StorageClient(base_url)— entry point; createsSpacehandlesSpace— represents a WAS space (get(),put(),delete(),resource())Resource— represents a resource within a space (get(),put(),post(),delete())StorageResponse— wraps HTTP responses (status,ok,headers,content(),json(),text())
Scripts
uv run safety scan
uv run ruff check
uv run flake8 src tests
uv run bandit -r src
uv run bandit -r tests -s B101
uv run -m pytest -vv --cov=src --cov-report=term --cov-report=xml
uv version --bump patch
git add . && git commit -m "Bump patch version" && git tag -sm "New feature" $version
rm -rf dist && uv build
uv publish -t $(keyring get https://upload.pypi.org/legacy/ __token__)
References
Metadata
Release files for wallet-attached-storage-client 0.2.0
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 |
|---|---|---|---|---|
| wallet_attached_storage_client-0.2.0.tar.gz | 11.6 kB | Without provenance | Details for wallet_attached_storage_client-0.2.0.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| wallet_attached_storage_client-0.2.0-py3-none-any.whl | Python 3 | none | any | Details for wallet_attached_storage_client-0.2.0-py3-none-any.whl |
Total release size: 21.8 kB
Release files / wallet_attached_storage_client-0.2.0.tar.gz
| Download URL | wallet_attached_storage_client-0.2.0.tar.gz |
|---|---|
| Size | 11.6 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
499091459adb701a95975cc591d26061c89a9dd93f29272170d529fab182cc8e
|
|
BLAKE2b-256 checksum How to use checksums |
ff909d7104417e9bd09a0359a93ea9bc8224fa6754071b82ef68e43ac55b8b41
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
uv/0.10.2 {"installer":{"name":"uv","version":"0.10.2","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}
|
Release files / wallet_attached_storage_client-0.2.0-py3-none-any.whl
| Download URL | wallet_attached_storage_client-0.2.0-py3-none-any.whl |
|---|---|
| Size | 10.3 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
fd9a6c7fc3530afd8c77543aa52e7aee592b453e3fe7c3f045bd387bb0cd8541
|
|
BLAKE2b-256 checksum How to use checksums |
75918d4f17e03c1a3cc4829c801b807174cca3638c876350e28b6a0265ebe097
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
uv/0.10.2 {"installer":{"name":"uv","version":"0.10.2","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}
|
Security for wallet-attached-storage-client 0.2.0
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.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A 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.