Skip to main content

Class-based environment variables typed specification

Project description

named-env

Class-based environment variables typed specification.

Installation

pip install named-env

Usage example

from named_env import EnvironmentNamespace, RequiredInteger
import os


class WebApplicationEnvironmentNamespace(EnvironmentNamespace):
    WEB_SERVER_PORT = RequiredInteger()


env = WebApplicationEnvironmentNamespace()

if __name__ == "__main__":
    os.environ["WEB_SERVER_PORT"] = "80"
    print(env.WEB_SERVER_PORT)  # 80
    print(type(env.WEB_SERVER_PORT))  # int

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

named_env-2.3.2.tar.gz (5.6 kB view hashes)

Uploaded Source

Built Distribution

named_env-2.3.2-py3-none-any.whl (5.8 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