yukinarit / envclasses Goto Github PK
View Code? Open in Web Editor NEWenvclasses is a library to map fields on dataclass object to environment variables.
Home Page: https://yukinarit.github.io/envclasses/envclasses.html
License: MIT License
envclasses is a library to map fields on dataclass object to environment variables.
Home Page: https://yukinarit.github.io/envclasses/envclasses.html
License: MIT License
I've set up a dataclass envclass, with the following attribute:
RETRIES: tuple[float, ...] = (0.1, 0.5, 2)
my .env.local
file contains:
RETRIES="[1.0, 1.0]"
When I load the configuration I get:
TypeError: 'ellipsis' object is not callable
tuple[float, float]
, this works fine.typing.Tuple
did not help.Not sure what to do here, only workaround is a List.
Python version 3.9
, envclasses 0.2.8
.
Thanks for your good work.
$ python
Python 3.9.6 (default, Jun 28 2021, 19:24:41)
[Clang 12.0.5 (clang-1205.0.22.9)] on darwin
Type "help", "copyright", "credits" or "license" for more information.
>>> import envclasses
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
ModuleNotFoundError: No module named 'envclasses'
It would be nice if we could automate publishing the package with Github Actions
Add python3.9 in CI script, and add python3.9 classifier in setup.py
The usage of CircleCI is still very little. I am not an expert on CicleCI, so I want to transfer my projects to using Github Action instead of CircleCI for the same purpose i.e. running tests :)
Just like pyserde does.
Currently load_env
function takes an instance of dataclass.
foo = Foo()
load_env(foo, ...)
This feature extends load_env
to accept a class as the first argument and create an instance from env vars
foo = load_env(Foo, ...)
@envclass
@dataclass
class Hoge:
d: Decimal
h = Hoge(d=Decimal(10))
os.environ['ENV_D'] = '20'
assert isinstance(h.d, Decimal)
assert h.d == Decimal(20)
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.