A Python client library for interacting with Stratos APIs. ...
Project description
Pystratos
Pystratos is a fully-featured Python 3 client library for interacting with Stratos services.
Install Pystratos using pip:
$ pip install pystratos
Usage examples
Simple high-level interface for SPFS:
import asyncio
import pystratos
async def main():
async with pystratos.AsyncSpfsClient(timeout=10) as client:
data = b"test data"
resp = await client.add(data, filename="test")
print(resp)
asyncio.run(main())
or with file encryption
import asyncio
import pystratos
async def main():
async with pystratos.AsyncSpfsClient(timeout=10, encryption_key=b"wZcZyNXewdPeFdpv19SAlOTgfsM4aBY27ZKREReuFfM=") as client:
with open("<your_file_path>", "rb") as f:
resp = await client.add(f, filename="test")
content = await client.cat(resp["Hash"])
print(f"{content=}")
asyncio.run(main())
NOTE: You need to install optional dep pystratos[crypto] for encryption
Project details
Release history Release notifications | RSS feed
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 pystratos-0.1.0.tar.gz.
File metadata
- Download URL: pystratos-0.1.0.tar.gz
- Upload date:
- Size: 4.1 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: poetry/2.1.3 CPython/3.10.8 Darwin/22.1.0
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
e0df9a9a197d959dbbd5903df78bf7d7db5d08ed8990d0c64135c9e687f1dc63
|
|
| MD5 |
2a37c4017e8272727ff24be4507f0001
|
|
| BLAKE2b-256 |
6bb83e8cadafeba1faafd2988ba64d17c161bf998dd7879d1f7d3bee32dc3e07
|
File details
Details for the file pystratos-0.1.0-py3-none-any.whl.
File metadata
- Download URL: pystratos-0.1.0-py3-none-any.whl
- Upload date:
- Size: 5.3 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: poetry/2.1.3 CPython/3.10.8 Darwin/22.1.0
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
e0a5a5ff002eaa25d630eff02599fdf9d261bafb502238ff76dab55d7fd41365
|
|
| MD5 |
262bda3c7c9270d25f4d23a8d0f08357
|
|
| BLAKE2b-256 |
2a6dcca21d756da0dc3b4369247840a015754b3ad6c2b5f2456591bfd10b690d
|