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 hashes)

Uploaded Source

Built Distribution

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

Uploaded Python 3

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