Skip to main content
Pre-release

This release is a pre-release and may not be stable for production use.

safepy: safety belt for Python distributed services

https://img.shields.io/pypi/v/safepy.svg https://img.shields.io/:license-Apache_2_License-blue.svg https://img.shields.io/pypi/pyversions/safepy.svg https://api.shippable.com/projects/587b8d9379509c10004a444b/badge?branch=master https://api.shippable.com/projects/587b8d9379509c10004a444b/coverageBadge?branch=master

Safepy (rhymes with safety) is a latency and fault tolerance library for Python 3.5 (or greater) inspired by Hystrix, Cloud Design Patterns, AWS Architecture Blog and many others.

How to use the library

You can either use the mechanisms as decorators:

from safety import retry

class ProfileService(object):
    @retry(attempts=3, base_delay=1)
    async def get_profile(self, username):
        ...

Or to dynamically recreate protected methods:

from safety import retry

class ProfileService(object):
    def __init__(self):
        self.get_profile = retry(attempts=3, base_delay=1)(
            self.get_profile
        )

    async def get_profile(self, username):
        ...

Retry

from safepy import retry

class ServiceA(object):
    @retry(attempts=3, base_delay=1)
    async def call():
        ...

Notes

  • The default retry is an alias for retry_with_jitter_backoff, a retry mechanism which uses jitter backoff. For exponential backoff use retry_with_exponential_backoff.

Metadata

Release files for safepy 0.1.0a0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for safepy 0.1.0a0
File Size Uploaded Provenance Actions
safepy-0.1.0a0.tar.gz 5.9 kB Without provenance Details for safepy-0.1.0a0.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for safepy 0.1.0a0
File Interpreter ABI Platform Actions
safepy-0.1.0a0-py3-none-any.whl Python 3 none any Details for safepy-0.1.0a0-py3-none-any.whl

Total release size: 15.8 kB

Release files / safepy-0.1.0a0.tar.gz

Download URL safepy-0.1.0a0.tar.gz
Size 5.9 kB
Tags Source
SHA-256 checksum
How to use checksums
2d99abe0ec5a231f6e962ff7793f63f076c8c3d2d35b98b8a3270535b5a2b62e
BLAKE2b-256 checksum
How to use checksums
43e03a847f3982b5715a0ca42665cd4b1af357acf1ce8d3d8bab3e7a26952c93
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No

Release files / safepy-0.1.0a0-py3-none-any.whl

Download URL safepy-0.1.0a0-py3-none-any.whl
Size 9.9 kB
Tags Python 3
SHA-256 checksum
How to use checksums
a43d045fec380b8cbe7924ffd7325de672b69d7e3b16c74c7804330b16871f19
BLAKE2b-256 checksum
How to use checksums
5e6f35804cd7530eb8086d61254325781c6e83d5262d8e2f47a441afe1838805
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No

Security for safepy 0.1.0a0

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page