Skip to main content

No project description provided

Project description

promulgate

Simple single threaded event library. Inspired by this[https://stackoverflow.com/a/2022629] stackoverflow answer.

Example

from dataclasses import dataclass
from promulgate import Promulgation

@dataclass
class RegisterUserPromulgation(Promulgation)
    email: str
    password: str


def handle_register_user(prmlg : RegisterUserPromulgation) -> None:
    print(f"New user with email {prmlg.email} and password ***")


RegisterUserPromulgation.subscribe(handle_register_user)

event = RegisterUserPromulgation("test@test.com", "super.1.secret!")
event.promulgate()

# New user with email test@test.com and password *** 

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

promulgate-0.1.2.tar.gz (1.4 kB view details)

Uploaded Source

Built Distribution

promulgate-0.1.2-py3-none-any.whl (1.8 kB view details)

Uploaded Python 3

File details

Details for the file promulgate-0.1.2.tar.gz.

File metadata

  • Download URL: promulgate-0.1.2.tar.gz
  • Upload date:
  • Size: 1.4 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: pdm/2.4.0 CPython/3.11.1

File hashes

Hashes for promulgate-0.1.2.tar.gz
Algorithm Hash digest
SHA256 ec188e288f22ac66f7cb501c31eed8e442374c08193da06a4013863e28498649
MD5 0effcda45f94a5ec8236e051b847b225
BLAKE2b-256 358f1a8054e47f4cb6f6ed5132bdd813b5796e1f87523ef82e52ea4c7f825d2c

See more details on using hashes here.

File details

Details for the file promulgate-0.1.2-py3-none-any.whl.

File metadata

  • Download URL: promulgate-0.1.2-py3-none-any.whl
  • Upload date:
  • Size: 1.8 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: pdm/2.4.0 CPython/3.11.1

File hashes

Hashes for promulgate-0.1.2-py3-none-any.whl
Algorithm Hash digest
SHA256 8a851e9a475c8835a9ffc17cddf1e540330b8947606780bc5bf68aaa6d8d1064
MD5 43afbf3858e656072657c7ecf3bd5e2a
BLAKE2b-256 8d6e5e4a77f9ba73e6b7aff79ecc354864ffab11843c981e9057d4bb33b3bfad

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