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 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, EnvironmentVariable) 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 `

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.2.3.dev0.tar.gz (33.2 kB view details)

Uploaded Source

File details

Details for the file typed_envs-0.2.3.dev0.tar.gz.

File metadata

  • Download URL: typed_envs-0.2.3.dev0.tar.gz
  • Upload date:
  • Size: 33.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.14.2

File hashes

Hashes for typed_envs-0.2.3.dev0.tar.gz
Algorithm Hash digest
SHA256 e9c4033bd8992a1eb8ba2ddb7c2516c9fc55df0c8241c6ec5f1dc26691091704
MD5 364f327476de56fb2a2f88b961a70a49
BLAKE2b-256 da1694baba9f4ac5aaa99b5616426fcabb1ae0cfcb2094f7674aea8d45217f53

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page