Metadata-Version: 2.4
Name: kaspa
Version: 2.0.2rc1
Classifier: Development Status :: 5 - Production/Stable
Classifier: Intended Audience :: Developers
Classifier: License :: OSI Approved :: ISC License (ISCL)
Classifier: Operating System :: OS Independent
Classifier: Programming Language :: Python
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.10
Classifier: Programming Language :: Python :: 3.11
Classifier: Programming Language :: Python :: 3.12
Classifier: Programming Language :: Python :: 3.13
Classifier: Programming Language :: Python :: 3.14
Classifier: Programming Language :: Rust
Classifier: Topic :: Software Development :: Libraries :: Python Modules
Requires-Dist: maturin>=1.0,<2.0 ; extra == 'dev'
Requires-Dist: pytest>=8.0 ; extra == 'dev'
Requires-Dist: pytest-asyncio>=0.23 ; extra == 'dev'
Requires-Dist: click==8.2.1 ; extra == 'docs'
Requires-Dist: mkdocs>=1.6 ; extra == 'docs'
Requires-Dist: mkdocs-material>=9.5 ; extra == 'docs'
Requires-Dist: mkdocstrings[python]>=0.26 ; extra == 'docs'
Requires-Dist: mkdocs-gen-files>=0.5 ; extra == 'docs'
Requires-Dist: mkdocs-literate-nav>=0.6 ; extra == 'docs'
Requires-Dist: mike>=2.1 ; extra == 'docs'
Provides-Extra: dev
Provides-Extra: docs
License-File: LICENSE
Summary: Kaspa Python SDK
Keywords: kaspa,cryptocurrency,blockchain,blockdag,sdk,wallet,rpc
Author: Kaspa developers
License-Expression: ISC
Requires-Python: >=3.10, <3.15
Description-Content-Type: text/markdown; charset=UTF-8; variant=GFM
Project-URL: Changelog, https://kaspanet.github.io/kaspa-python-sdk/latest/CHANGELOG/
Project-URL: Documentation, https://kaspanet.github.io/kaspa-python-sdk/latest
Project-URL: Homepage, https://github.com/kaspanet/kaspa-python-sdk
Project-URL: Issues, https://github.com/kaspanet/kaspa-python-sdk/issues
Project-URL: Repository, https://github.com/kaspanet/kaspa-python-sdk

# Kaspa Python SDK

The Kaspa Python SDK provides bindings to Rust & [Rusty-Kaspa](https://github.com/kaspanet/rusty-kaspa) source, allowing Python developers to interact with the Kaspa BlockDAG.

A native extension module, `kaspa`, is built from these bindings using [PyO3](https://pyo3.rs/) and [Maturin](https://www.maturin.rs).

> [!IMPORTANT]
> This project has moved! Welcome to the new home of Kaspa Python SDK, which historically lived [here](https://github.com/aspectron/rusty-kaspa/tree/python).
> 
> Versions < 1.1.0 were built from the old repository.
>
> Versions >= 1.1.0 are/will be built from this repository.


## Features

This SDK provides features across the following categories:

- RPC Client — RPC API for the Kaspa node using WebSockets.
- Wallet SDK — Bindings for wallet-related primitives such as key management, derivation, and transactions.
- Managed Wallet — A fully managed interface for the Rusty Kaspa Wallet API bundled into one Python class.
- SilverScript — Experimental SilverScript contract compilation, locking scripts, and unlocking scripts.
- ZK Scripts — Experimental builder that turns RISC Zero zero-knowledge proofs into Kaspa locking and unlocking scripts, verified on-chain.

This package strives to mirror the [Kaspa WASM32 SDK](https://kaspa.aspectron.org/docs/) from a feature and API perspective, while respecting Python conventions.

## Documentation

Full documentation is available on the [documentation site](https://kaspanet.github.io/kaspa-python-sdk/dev/), including (but not limited to):

- [Installation Guide](https://kaspanet.github.io/kaspa-python-sdk/dev/getting-started/installation/)
- [Examples](https://kaspanet.github.io/kaspa-python-sdk/dev/getting-started/examples/)
- [API Reference](https://kaspanet.github.io/kaspa-python-sdk/dev/reference/)

The documentation site is versioned:
- `dev` refers to the latest in `main` branch
- `latest` refers to the most recent production release
- Specific version tags are available


Documentation is not available for versions prior to 1.1.0. However, the API is very close, if not the exact same, for those versions and 1.1.0.

## Quick Install

The Kaspa Python SDK is available on PyPI ([link](https://pypi.org/project/kaspa/)). As such, it can be installed from PyPI via:

```bash
pip install kaspa
```

Security-critical applications should consider building and installing from source. Instructions can be found [here](https://kaspanet.github.io/kaspa-python-sdk/dev/getting-started/installation/#installation-from-source) on the documentation site.

## Example

A very basic RPC example:

```python
import asyncio
from kaspa import Resolver, RpcClient

async def main():
    # Connect to Public Node Network (PNN) with Resolver
    client = RpcClient(resolver=Resolver())
    await client.connect()

    # Execute RPC Call
    print(await client.get_block_dag_info())

if __name__ == "__main__":
    asyncio.run(main())
```

Additional detailed examples can be found in the following locations:
- The [Examples section of the documentation site](https://kaspanet.github.io/kaspa-python-sdk/dev/getting-started/examples/)
- The [examples directory of this project](https://github.com/kaspanet/kaspa-python-sdk/tree/main/examples)


## Core Concepts & Contributing

The [Contributing Guide](https://kaspanet.github.io/kaspa-python-sdk/dev/contributing/) details various technical core concepts and information about this project.

## License

This project is licensed under the ISC License.

