Skip to main content

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

Project description


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

  • Failed
  • NotStarted
  • InProgress(progress)
  • Succeeded


$ pip install statuses


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)

        self.status = Succeeded()

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


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.

Files for statuses, version 0.5.2
Filename, size File type Python version Upload date Hashes
Filename, size statuses-0.5.2-py3-none-any.whl (4.1 kB) File type Wheel Python version py3 Upload date Hashes View
Filename, size statuses-0.5.2.tar.gz (7.5 kB) File type Source Python version None Upload date Hashes View

Supported by

Pingdom Pingdom Monitoring Google Google Object Storage and Download Analytics Sentry Sentry Error logging AWS AWS Cloud computing DataDog DataDog Monitoring Fastly Fastly CDN DigiCert DigiCert EV certificate StatusPage StatusPage Status page