Skip to main content

You define a class, we load it up from environment in a type safe way

Project description

load-environ-typed

This library lets you declare a NamedTuple or dataclass with field types, and gives you a function that will load the values from the environment, validating your types for you.

Getting started

from load_environ_typed import load

from dataclasses import dataclass

@dataclass
class MyEnviron:
	DB_HOST: str
	DB_PORT: int

environ = load(MyEnviron)

Contributing

Check out this repo, and then use the following steps to test it:

python3 -m venv venv
venv/bin/pip install -r requirements-dev.txt
make test

Deploying

venv/bin/python -m build
venv/bin/python -m twine upload dist/*

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

load_environ_typed-0.1.1.tar.gz (4.1 kB view details)

Uploaded Source

Built Distribution

load_environ_typed-0.1.1-py3-none-any.whl (4.1 kB view details)

Uploaded Python 3

File details

Details for the file load_environ_typed-0.1.1.tar.gz.

File metadata

  • Download URL: load_environ_typed-0.1.1.tar.gz
  • Upload date:
  • Size: 4.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.10.6

File hashes

Hashes for load_environ_typed-0.1.1.tar.gz
Algorithm Hash digest
SHA256 f8f17bfbd12d6b0857b835b388969743b6611ed166644c41c13f4b6d55c7c693
MD5 6ed238c5dc3bf420beadc504937b69d6
BLAKE2b-256 593422dc3be02ca73155618fa033677e16705bc4b92f9beed14e3466d8cef15f

See more details on using hashes here.

File details

Details for the file load_environ_typed-0.1.1-py3-none-any.whl.

File metadata

File hashes

Hashes for load_environ_typed-0.1.1-py3-none-any.whl
Algorithm Hash digest
SHA256 ee772b1c48bedc920ced290b4c6621a349d47a32d849d84dbba1dc61e9fb7963
MD5 7431a33a96201cd7c811079e6f2328d0
BLAKE2b-256 60e2e85647169bc6f37536c77d92338be43b8a59d6997d07931991cbf407da14

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