Skip to main content

Simple singleton to share variables across modules

Project description

https://img.shields.io/pypi/v/monist.svg https://img.shields.io/travis/datagazing/monist.svg Documentation Status

Simple singleton to share variables across modules

Features

  • Use the basic module namespace functionality

Examples

import monist
dispatch = eval(monist.dispatch())

# set singleton value
monist.thing = 1

# access singleton value with fallback
# if monist.thing exists, return it, otherwise return some_default
asdf = dispatch('thing', some_default)

Importing monist as another name works also:

import monist as stage
stage.something = 2

Limitations

  • Almost certainly not thread-safe, appropriate for concurrency, etc.

License

  • Free software: MIT license

Documentation

Credits

This package was created with Cookiecutter and the audreyr/cookiecutter-pypackage project template.

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

monist-0.1.0.tar.gz (10.3 kB view details)

Uploaded Source

Built Distribution

monist-0.1.0-py3-none-any.whl (3.2 kB view details)

Uploaded Python 3

File details

Details for the file monist-0.1.0.tar.gz.

File metadata

  • Download URL: monist-0.1.0.tar.gz
  • Upload date:
  • Size: 10.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: python-requests/2.25.1

File hashes

Hashes for monist-0.1.0.tar.gz
Algorithm Hash digest
SHA256 9ad0e8bae1331763389152153d6ff5bb6daad9749e10e7db99e3c01d657b4519
MD5 aaf0390474da2e15b5bd06183f93a7d0
BLAKE2b-256 585983ba5a76d1a7c1e47373ad3b556fcd79372f7f974c34affdf5205cffc9f2

See more details on using hashes here.

File details

Details for the file monist-0.1.0-py3-none-any.whl.

File metadata

  • Download URL: monist-0.1.0-py3-none-any.whl
  • Upload date:
  • Size: 3.2 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: python-requests/2.25.1

File hashes

Hashes for monist-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 7aa6888103de7a194b47c647d942d7c66475c2ef6e96e144e672dbc6faad7da7
MD5 a4580606ac70e35a55747afd27013664
BLAKE2b-256 26c3ed1f72843bc6d5e4d37b1e67acfe7af5084189ef3ed0b2c36e8411b7d95d

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