Skip to main content

typed_envs is used to create specialized EnvironmentVariable objects that behave exactly the same as any other instance of the `typ` used to create them.

Project description

typed_envs is used for:
  • defining your envs in a readable, user friendly way

  • enhancing type hints for the returned instances

  • enhancing __repr__ of the returned instance with extra contextual information

Home-page: https://github.com/BobTheBuidler/typed-envs Author: BobTheBuidler Author-email: bobthebuidlerdefi@gmail.com License: MIT Description: typed_envs is used to create specialized EnvironmentVariable objects that behave exactly the same as any other instance of the typ used to create them.

typed_envs is used for:
  • defining your envs in a readable, user friendly way

  • enhancing type hints for the returned instances

  • enhancing __repr__ of the returned instance with extra contextual information

In the example below, some_var can be used just like as any other int object.

` import typed_envs some_var = typed_envs.create_env("SET_WITH_THIS_ENV", int, 10) >>> isinstance(some_var, int) True >>> isinstance(some_var, EnviromentVariable) True `

There are only 2 differences between some_var and int(10):
  • some_var will properly type check as an instance of both int and EnvironmentVariable

  • some_var.__repr__() will include contextual information about the EnvironmentVariable.

` >>> some_var <EnvironmentVariable[name=`SET_WITH_THIS_ENV`, type=int, default_value=10, current_value=10, using_default=True]> >>> str(some_var) "10" >>> some_var + 5 15 >>> 20 / some_var 2 `

Platform: UNKNOWN

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

typed-envs-0.0.1.dev1.tar.gz (6.8 kB view details)

Uploaded Source

Built Distribution

typed_envs-0.0.1.dev1-py3-none-any.whl (7.0 kB view details)

Uploaded Python 3

File details

Details for the file typed-envs-0.0.1.dev1.tar.gz.

File metadata

  • Download URL: typed-envs-0.0.1.dev1.tar.gz
  • Upload date:
  • Size: 6.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.1.1 pkginfo/1.4.2 requests/2.22.0 setuptools/45.2.0 requests-toolbelt/0.8.0 tqdm/4.30.0 CPython/3.8.10

File hashes

Hashes for typed-envs-0.0.1.dev1.tar.gz
Algorithm Hash digest
SHA256 7c47a305464802ab954237561c796f4f1fc0a76b009301382ae9386ce7cd2858
MD5 60d56de494ef374229d96d87fd9c1d7b
BLAKE2b-256 9bf409c4b9746a0216fa701f7e0c2369f4b4e5abfad03aedc85daceb4b64d891

See more details on using hashes here.

File details

Details for the file typed_envs-0.0.1.dev1-py3-none-any.whl.

File metadata

  • Download URL: typed_envs-0.0.1.dev1-py3-none-any.whl
  • Upload date:
  • Size: 7.0 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.1.1 pkginfo/1.4.2 requests/2.22.0 setuptools/45.2.0 requests-toolbelt/0.8.0 tqdm/4.30.0 CPython/3.8.10

File hashes

Hashes for typed_envs-0.0.1.dev1-py3-none-any.whl
Algorithm Hash digest
SHA256 16cf36706338dc5de4e1ab82b3ccbe54128a6101c8c6ce394c98cb2bb9aa8492
MD5 589d45f97f909020a478633f6f391742
BLAKE2b-256 30f91439978e7550aae2318dd24fa76210e81b1b049312a86b3157cebafd326b

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