Feedo Network Python SDK
The official Developer SDK for interacting with the Feedo Network.
Feedo is a decentralized network consisting of Search, Consensus, and Storage nodes. This SDK provides a unified, asynchronous interface to interact with all layers of the Feedo Network.
Features
- Dynamic Node Routing: The SDK automatically pings seed nodes and routes your requests to the fastest available node. If a node goes offline, the router instantly falls back to another healthy node.
- Fully Asynchronous: Built on top of
httpxandasynciofor maximum performance in AI agents and backend applications. - Search Module: Execute semantic vector queries, index new documents, and manage deployed websites.
- Consensus Module: Register Decentralized Identifiers (DIDs), resolve
.feedonames, and manage network grants. - Storage Module: Upload, download, and subscribe to data streams on the decentralized storage layer.
Installation
pip install feedo-sdk
Initialization
The SDK requires an event loop since it is entirely async. You do not need to specify URLs for the nodes; the SDK auto-discovers the fastest connection.
import asyncio
from feedo import FeedoClient
async def main():
client = FeedoClient()
# Your code here
asyncio.run(main())
(Optional) Custom seed nodes for private clusters:
client = FeedoClient(
search_seeds=["https://my-search.node"],
consensus_seeds=["https://my-consensus.node"],
storage_seeds=["https://my-storage.node"]
)
Search Module (client.search)
The Search module handles semantic queries and document vectorization.
query(query_text: str, limit: int = 10)
Perform a semantic search across the network.
results = await client.search.query("DeFi protocols", limit=5)
print(results)
index_document(content: str, metadata: dict = None)
Index a raw document into the vector database.
await client.search.index_document("Bitcoin is decentralized.", {"source": "wiki"})
deploy_proxy(directory_path: str, domain: str)
Publish a local directory to the network under a specific domain.
await client.search.deploy_proxy("/path/to/build", "my-app.feedo")
unpin(cid: str)
Remove a pinned deployment from the proxy.
await client.search.unpin("Qm...")
get_stats()
Retrieve network statistics.
stats = await client.search.get_stats()
Consensus Module (client.consensus)
The Consensus module manages identity (DIDs), naming (.feedo domains), and grants.
resolve_name(name: str)
Resolve a .feedo domain to its underlying CID (IPFS hash).
info = await client.consensus.resolve_name("my-app.feedo")
print(info['cid'])
register_did(pubkey_hex: str, signature_hex: str)
Register a new Decentralized Identifier.
await client.consensus.register_did("0xabc...", "0xdef...")
get_did_balance(did: str)
Check the token balance of a specific DID.
balance = await client.consensus.get_did_balance("did:feedo:0xabc...")
register_name(name: str, did: str, cid: str, signature_hex: str)
Register a new .feedo domain.
await client.consensus.register_name("my-app", "did:feedo:...", "Qm...", "0x...")
update_name_cid(name: str, new_cid: str, signature_hex: str)
Update the CID of an existing name.
await client.consensus.update_name_cid("my-app", "QmNew...", "0x...")
Storage Module (client.storage)
The Storage module acts as a decentralized file system.
upload_file(file_path: str, filename: str = "file")
Upload a local file to the network.
response = await client.storage.upload_file("./image.png")
print("Hash:", response['hash'])
download_file(hash_id: str) -> bytes
Download a file from the network by its hash.
raw_data = await client.storage.download_file("Qm...")
with open("downloaded.png", "wb") as f:
f.write(raw_data)
ingest_json(payload: dict)
Ingest structured JSON data directly into storage.
await client.storage.ingest_json({"user": "alice", "action": "post"})
get_recent_files()
Get a list of recently uploaded files.
recent = await client.storage.get_recent_files()
Error Handling
The SDK handles node failover automatically via the NodeRouter. However, if all seed nodes are unreachable, or if a specific network validation error occurs, the SDK will raise an exception. It is highly recommended to wrap network calls in try/except blocks:
try:
results = await client.search.query("DeFi protocols")
except Exception as e:
print(f"Feedo Network Error: {e}")
Response Structures
All responses are returned as native Python dictionaries matching the JSON schema of the Feedo Network. For example, a search result typically contains:
id: Unique document identifierscore: Semantic similarity scoremetadata: Associated metadata dictionarycontent: The raw text content
Contributing
We welcome contributions to the Feedo Network SDK! GitHub Repository: https://github.com/Ashixi/feedo-sdk
- Fork the repository.
- Create your feature branch (
git checkout -b feature/amazing-feature). - Commit your changes (
git commit -m 'Add some amazing feature'). - Push to the branch (
git push origin feature/amazing-feature). - Open a Pull Request.
License
Apache License 2.0
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file feedo_sdk-0.1.5.tar.gz.
File metadata
- Download URL: feedo_sdk-0.1.5.tar.gz
- Upload date:
- Size: 8.6 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via:
twine/7.0.0 CPython/3.11.9
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
807f5d774ce17ca0f4a66c289cb8b53d861ab47cc20b3b811ab77fd36befbb61
|
|
| MD5 |
4fa121cfbd816d0c299ae68ff18f9804
|
|
| BLAKE2b-256 |
736d5a49ca4811bbf9ccfb34f66f54c5e6d2181c3fdf225c8a3c52129d9b75f5
|
File details
Details for the file feedo_sdk-0.1.5-py3-none-any.whl.
File metadata
- Download URL: feedo_sdk-0.1.5-py3-none-any.whl
- Upload date:
- Size: 7.5 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via:
twine/7.0.0 CPython/3.11.9
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
9c1cd7d6c840a01c4a89f0414101285acd7279bfd6fc31204903fef9770d207b
|
|
| MD5 |
51406ef2e515f566d72071055cd93904
|
|
| BLAKE2b-256 |
667fd5aea131ac468270760f2ad80f8c16f5fba1e8a1a16cf7f4589b70652e89
|