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

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


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.0.tar.gz (4.1 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.0-py3-none-any.whl (5.3 kB view details)

Uploaded Python 3

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

Hashes for pystratos-0.1.0.tar.gz
Algorithm Hash digest
SHA256 e0df9a9a197d959dbbd5903df78bf7d7db5d08ed8990d0c64135c9e687f1dc63
MD5 2a37c4017e8272727ff24be4507f0001
BLAKE2b-256 6bb83e8cadafeba1faafd2988ba64d17c161bf998dd7879d1f7d3bee32dc3e07

See more details on using hashes here.

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

Hashes for pystratos-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 e0a5a5ff002eaa25d630eff02599fdf9d261bafb502238ff76dab55d7fd41365
MD5 262bda3c7c9270d25f4d23a8d0f08357
BLAKE2b-256 2a6dcca21d756da0dc3b4369247840a015754b3ad6c2b5f2456591bfd10b690d

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