owattr
owattr overwrites attributes.
Example
config.py:
import sys
import owattr
REDIS_URL = "redis://localhost:6379/0"
IS_DEV_ENV = True
owattr.from_dict(sys.modules[__name__], dict(os.environ))
The config module has REDIS_URL as attribute. You might want to change the value for your production environment. In this example, if you have defined REDIS_URL in environment variables, when you load config module, it is overwritten. If you don’t define REDIS_URL, you can use the original value.
When owattr read the dict, it casts dict value to type of the original value. So in environment variable, everything is str type. In this example, if you have defined IS_DEV_ENV=False in environment variable, IS_DEV_ENV of config has False as bool type.
Booleans are cast as follows:
'false','False'and''are cast to False'true'and'True'are cast to Trueanything else raises a
'ValueError'
If your object has __all__, owattr overwrites only variables which written in __all__.
Metadata
Release files for owattr 0.10.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| owattr-0.10.0.tar.gz | 2.5 kB | Without provenance | Details for owattr-0.10.0.tar.gz |
Release files / owattr-0.10.0.tar.gz
| Download URL | owattr-0.10.0.tar.gz |
|---|---|
| Size | 2.5 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
410cc7a30013c3afa5334e96a15400e42ebeaefc5e465907a2ed906fcc9345dd
|
|
BLAKE2b-256 checksum How to use checksums |
42fed6cbac5d96e67277d8bc285e1ec36ab251b961ecaea0fa2ce7eee303f728
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
Python-urllib/3.7
|
Security for owattr 0.10.0
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.