Skip to main content

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

Documentation

https://pystratos.readthedocs.io/en/latest/

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) as client:
        with open("<your_file_path>", "rb") as f:
            encryption_key = b"wZcZyNXewdPeFdpv19SAlOTgfsM4aBY27ZKREReuFfM="
            resp = await client.add(f, filename="test", encryption_key=encryption_key)
            content = await client.cat(resp["Hash"], encryption_key=encryption_key)
            print(f"{content=}")


asyncio.run(main())

NOTE: You need to install optional dep pystratos[crypto] for encryption

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

pystratos-0.1.1.tar.gz (4.3 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

pystratos-0.1.1-py3-none-any.whl (5.5 kB view details)

Uploaded Python 3

File details

Details for the file pystratos-0.1.1.tar.gz.

File metadata

  • Download URL: pystratos-0.1.1.tar.gz
  • Upload date:
  • Size: 4.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/2.1.3 CPython/3.10.8 Darwin/22.1.0

File hashes

Hashes for pystratos-0.1.1.tar.gz
Algorithm Hash digest
SHA256 43f3ad1d62ef0df5f12a70de13a936cc5b4ce2402aef2abb54971c8ce67166f7
MD5 53004caabd1c25b7290e6651457d6b31
BLAKE2b-256 9596134b2d839329a32b5899f793df04adc6520770aebd48375c0ef42048c503

See more details on using hashes here.

File details

Details for the file pystratos-0.1.1-py3-none-any.whl.

File metadata

  • Download URL: pystratos-0.1.1-py3-none-any.whl
  • Upload date:
  • Size: 5.5 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

Hashes for pystratos-0.1.1-py3-none-any.whl
Algorithm Hash digest
SHA256 bd2153bed58162a9a3e5d5bc3ea5268f8b5bf4d9b5c8ab7e04208645f4c9b905
MD5 b1111b9a16476f13951c92d35818b512
BLAKE2b-256 41d9d26b6be566407ab65eca7b4e401e35369075c051bcd54a3d99f89c97e75c

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page