Safe Kit (Python)
A Python implementation of the Safe Protocol Kit, designed to mirror the developer experience of the official Node.js SDK.
Features
- DX First: Intuitive API for interacting with Safe smart accounts.
- Type Safe: Built with Pydantic and fully typed for robust development.
- Modern Stack: Uses Web3.py, Eth-account, and Python 3.10+.
- Full Protocol Support: Supports Safe deployment, transaction creation, signing (EIP-712 & eth_sign), and execution.
- Advanced Features: MultiSend (batching), Safe Transaction Service integration, and more.
Installation
You can install safe-kit via pip:
pip install safe-kit
Or with Poetry:
poetry add safe-kit
Usage
Initialization
from web3 import Web3
from eth_account import Account
from safe_kit.safe import Safe
from safe_kit.adapter import Web3Adapter
# Setup Web3 and Signer
w3 = Web3(Web3.HTTPProvider("RPC_URL"))
owner = Account.from_key("PRIVATE_KEY")
adapter = Web3Adapter(web3=w3, signer=owner)
# Initialize Safe
safe = Safe(eth_adapter=adapter, safe_address="0xSafeAddress")
Creating and Signing Transactions
from safe_kit.types import SafeTransactionData
# Create a transaction (e.g., send ETH)
tx_data = SafeTransactionData(
to="0xRecipient",
value=1000000000000000000, # 1 ETH
data="0x"
)
safe_tx = safe.create_transaction(tx_data)
# Sign the transaction
# Supports "eth_sign_typed_data" (default, EIP-712) or "eth_sign" (legacy)
signed_tx = safe.sign_transaction(safe_tx)
Executing Transactions
# Execute the transaction on-chain
tx_hash = safe.execute_transaction(signed_tx)
print(f"Transaction executed: {tx_hash}")
For more advanced usage (Batching, Transaction Service, Deployment), please refer to the User Guide.
Development
Setup
# Install dependencies
poetry install
Running Tests
poetry run pytest
Linting
poetry run ruff check .
poetry run mypy .
Roadmap
See docs/roadmap.md for the current implementation status.
Metadata
Release files for safe-kit 0.0.14
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 | |
|---|---|---|---|---|
| safe_kit-0.0.14.tar.gz | 20.2 kB | With provenance | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| safe_kit-0.0.14-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 47.6 kB
Release files / safe_kit-0.0.14.tar.gz
| Download URL | safe_kit-0.0.14.tar.gz |
|---|---|
| Size | 20.2 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
fef00490500162e25ad3e7303c7ab7006f363442e8b3bb837f343e5d00960a52
|
|
BLAKE2b-256 checksum How to use checksums |
62a9c66fef6050244417ce1a2033df791f6fb5cfb83b23b0409a4655360c3017
|
| 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 Jan 23, 2026.
Transparency logRelease files / safe_kit-0.0.14-py3-none-any.whl
| Download URL | safe_kit-0.0.14-py3-none-any.whl |
|---|---|
| Size | 27.4 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
e3f990db4b82f6667f86ef0570bc41ac47aab7358b55da635ea65c6bd7ace7b0
|
|
BLAKE2b-256 checksum How to use checksums |
1c8ddbb3c015c9e87be51be80cbe3dd1d5720847b48ba998d797ed8d3159bb3d
|
| 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 Jan 23, 2026.
Transparency logSecurity for safe-kit 0.0.14
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 safe_kit-0.0.14.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 Jan 23, 2026.
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.