Story SDK
Welcome to the documents for Story Python SDK. The Python SDK provides the APIs for developers to build applications with Story. By using the SDK, developers can create the resources like IP assets and perform actions to interact with the resource.
How to use Story Protocol SDK in Your Project
Install Story Protocol core SDK
Suppose you already have a node project or created a new node project. First, you need to install story_protocol_python_sdk in your project. You can use one of the following command to install the package:
Use pip:
pip install story_protocol_python_sdk web3
Besides the Story Protocol SDK package story_protocol_python_sdk, we also require the package web3 (https://pypi.org/project/web3/) to access the DeFi wallet accounts.
Initiate SDK Client
Next we can initiate the SDK Client by first setting up our wallet and then the client itself.
Set up your wallet
The SDK supports using web3 for initiating SDK client. Create a Python file and write the following code to initiate the client with a private key:
:information-source: Make sure to have WALLET_PRIVATE_KEY set up in your .env file.
import os
from dotenv import load_dotenv
from web3 import Web3
load_dotenv()
private_key = os.getenv('WALLET_PRIVATE_KEY')
rpc_url = os.getenv('RPC_PROVIDER_URL')
# Initialize Web3
web3 = Web3(Web3.HTTPProvider(rpc_url))
# Set up the account with the private key
account = web3.eth.account.from_key(private_key)
The preceding code created the account object for creating the SDK client.
Set up SDK client
To set up the SDK client, import StoryClient from story_protocol_python_sdk. Write the following code, utilizing the account we created previously.
:information-source: Make sure to have RPC_PROVIDER_URL for your desired chain set up in your .env file. We recommend using the public default one with
RPC_PROVIDER_URL=https://aeneid.storyrpc.io.
from story_protocol_python_sdk import StoryClient
# Create StoryClient instance
aeneid_chain_id = 1315
story_client = StoryClient(web3, account, aeneid_chain_id)
Development
For detailed development setup instructions, including how to install dependencies with uv and set up pre-commit hooks, see DEVELOPMENT.md.
Running test cases
- Integration Tests
pytest
- Unit Tests
coverage run -m pytest tests/unit -v -ra -q
- Generating a Coverage Report
coverage report
Formatting
black .
Release
| Package | Description |
|---|---|
| story_protocol_python_sdk | A Python SDK for interacting with the Story Protocol. |
Contributing
Pull requests are welcome. For major changes, please open an issue first to discuss what you would like to change. Details see: CONTRIBUTING
Please make sure to update tests as appropriate.
License
Metadata
Release files for story-protocol-python-sdk 0.3.18
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| story_protocol_python_sdk-0.3.18.tar.gz | 102.2 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| story_protocol_python_sdk-0.3.18-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 258.8 kB
Release files / story_protocol_python_sdk-0.3.18.tar.gz
| Download URL | story_protocol_python_sdk-0.3.18.tar.gz |
|---|---|
| Size | 102.2 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
dcdc6e0352b193b174f581cd78838a77fad7b9003ff993a319ea993b84849e03
|
|
BLAKE2b-256 checksum How to use checksums |
7d279bd2957c071362c2993232ebf429f5b0eb06757fa1cf9e5262cb33664c55
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.2.0 CPython/3.13.12
|
Release files / story_protocol_python_sdk-0.3.18-py3-none-any.whl
| Download URL | story_protocol_python_sdk-0.3.18-py3-none-any.whl |
|---|---|
| Size | 156.6 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
58694592ad6d5080b0a3017f113eb055fbf26c168c2e1c855d59798caddc3828
|
|
BLAKE2b-256 checksum How to use checksums |
35722a6cfebed6cbf3a449589da74a9a287e0eff70b1733d385940634a1140bc
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.2.0 CPython/3.13.12
|