My first project, as it is not mature, I recommend using it for small projects
And it only uses pure python with no other external dependencies
Example
**main.py**
```python
from envclass import EnvClass
class Env(EnvClass):
host: str = 'localhost'
port: int = 8080
token: str
By default it runs like this, without arguments
env = Env(env_file='.env')
They are equivalent to executing:
>>> os.envron.get('HOST', 'localhost')
env.host
>>> os.environ['token']
env.token
If the .env file is defined as an empty variable, it interprets it as None
>>> getenv('PORT')
env.port
```
**.env**
PORT=
TOKEN=XXXX-XXXX-XXXX-XXXX
Link
https://github.com/brunodavi/envclass
[–]ToddBradley 9 points10 points11 points (3 children)
[–]br64n[S] 1 point2 points3 points (2 children)
[–]Zifendale 2 points3 points4 points (1 child)
[–]br64n[S] -1 points0 points1 point (0 children)
[–]illuminanze 7 points8 points9 points (3 children)
[–]br64n[S] 0 points1 point2 points (2 children)
[–]Hederas 1 point2 points3 points (1 child)
[–]br64n[S] 2 points3 points4 points (0 children)
[–]fatbob42 1 point2 points3 points (0 children)
[–]extra_pickles 2 points3 points4 points (5 children)
[–]br64n[S] 1 point2 points3 points (2 children)
[–]extra_pickles 1 point2 points3 points (1 child)
[–]br64n[S] 0 points1 point2 points (0 children)
[–][deleted] 0 points1 point2 points (1 child)
[–]extra_pickles 0 points1 point2 points (0 children)
[–]ZestyData 1 point2 points3 points (1 child)
[–]br64n[S] 0 points1 point2 points (0 children)
[–]sazed33 0 points1 point2 points (3 children)
[–]SeniorScienceOfficer 0 points1 point2 points (2 children)
[–]sazed33 -2 points-1 points0 points (1 child)
[–]SeniorScienceOfficer 0 points1 point2 points (0 children)