Skip to main content

The `Status` class represents the status of some event.

Project description

statuses

The Status class represents the status of some event. It is one of either:

  • Failed
  • NotStarted
  • InProgress(progress)
  • Succeeded

Installation

$ pip install statuses

Example

from typing import Iterable

from status import InProgress, Failed, NotStarted, Succeeded

class Report:
    def __init__(self: "Report"):
        self.status = NotStarted()

    def run(self: "Report", foo: str, bar: Iterable[int]):
        if foo == "badstring":
            self.status = Failed()

        for i, b in enumerate(bar):
            self.status = InProgress(i / len(bar) * 100)
            print(self.status)

        self.status = Succeeded()

r = Report()
print(r.status)
r.run("goodstring", range(10))
print(r.status)

Documentation

Ugly looking documentation can be located at docs/index.html.

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

statuses-0.5.2.tar.gz (7.5 kB view details)

Uploaded Source

Built Distribution

statuses-0.5.2-py3-none-any.whl (4.1 kB view details)

Uploaded Python 3

File details

Details for the file statuses-0.5.2.tar.gz.

File metadata

  • Download URL: statuses-0.5.2.tar.gz
  • Upload date:
  • Size: 7.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.13.0 pkginfo/1.5.0.1 requests/2.21.0 setuptools/40.8.0 requests-toolbelt/0.9.1 tqdm/4.31.1 CPython/3.7.3

File hashes

Hashes for statuses-0.5.2.tar.gz
Algorithm Hash digest
SHA256 5a19729a12e05a4d1e0fff8ff52c582e2875fea633f11b2c2c662312b28ba380
MD5 ae06b8e6aad9699b7cb5178a4978e5b5
BLAKE2b-256 3ac33f54146c66a1ca46e9698b7e1a2039978819d574651f7ef06f14105458b9

See more details on using hashes here.

File details

Details for the file statuses-0.5.2-py3-none-any.whl.

File metadata

  • Download URL: statuses-0.5.2-py3-none-any.whl
  • Upload date:
  • Size: 4.1 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.13.0 pkginfo/1.5.0.1 requests/2.21.0 setuptools/40.8.0 requests-toolbelt/0.9.1 tqdm/4.31.1 CPython/3.7.3

File hashes

Hashes for statuses-0.5.2-py3-none-any.whl
Algorithm Hash digest
SHA256 c750648e86c4fce81732a5e5c3c3238312cb1dfd74356339aa49e9f411e121ad
MD5 6ac6854cc6cea4c2646508795ca37580
BLAKE2b-256 4619633b8a4fd907ee2d20f4b858d89cd35428a8ffe67facb41124ec6a307a10

See more details on using hashes here.

Supported by

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