lapa_commons
About
Lapa commons used for reading the configuration file.
Installation
pip install lapa_commons
Env
- python>=3.12.0
Usage
Create sample config.ini
[ENVIRONMENT]
log_level = INFO
[DATABASE]
Db_Host = localhost
Db_Port = 5432
Db_Name = my_database
Db_User = my_user
Db_Password = my_password
[API]
API_KEY = abcdef1234567890
BASE_URL = https://api.example.com/v1
Sample code
# import lapa_commons
from lapa_commons.main import read_configuration_from_file_path
# call the read_configuration_from_file_path() and provide file path
ldict_configuration = read_configuration_from_file_path('/home/lavsharma/python-project/temp/config.ini')
Output
{'API': {'API_KEY': 'abcdef1234567890', 'BASE_URL': 'https://api.example.com/v1'}, 'DATABASE': {'Db_Host': 'localhost', 'Db_Name': 'my_database', 'Db_Password': 'my_password', 'Db_Port': '5432', 'Db_User': 'my_user'}, 'ENVIRONMENT': {'log_level': 'INFO'}}
Changelog
v0.0.3
- treat all sections as environment variables.
- import read_configuration_from_file_path in init file.
- update repo link in setup.py.
v0.0.2
- bug fix when reading environment variables.
v0.0.1
- configparser added in the dependency.
- Function read_configuration_from_file_path() added which reads the configuration from a filepath.
- Support for any number of sections in the configuration file.
- Environment section variables will be first checked in the OS, if not found in the OS then it will be read from the configuration file.
- MODULE_NAME added in the init.py
- Errors are raised in the module instead of logging.
Metadata
Release files for lapa-commons 0.0.3
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 |
|---|---|---|---|---|
| lapa_commons-0.0.3.tar.gz | 3.3 kB | Without provenance | Details for lapa_commons-0.0.3.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| lapa_commons-0.0.3-py3-none-any.whl | Python 3 | none | any | Details for lapa_commons-0.0.3-py3-none-any.whl |
Total release size: 7.1 kB
Release files / lapa_commons-0.0.3.tar.gz
| Download URL | lapa_commons-0.0.3.tar.gz |
|---|---|
| Size | 3.3 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
91dfce1cd8c41d4250cd7661b016337854bd74fdde7f6c0f99339f350356e650
|
|
BLAKE2b-256 checksum How to use checksums |
00ed476b1d81c05e8da3223b515e061b70c8706f781d214ff13a30c46465e100
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/5.1.0 CPython/3.9.19
|
Release files / lapa_commons-0.0.3-py3-none-any.whl
| Download URL | lapa_commons-0.0.3-py3-none-any.whl |
|---|---|
| Size | 3.8 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
63c3d174f8ce2070c45487e868214882d057c53954b3bd8a9f198689413f9153
|
|
BLAKE2b-256 checksum How to use checksums |
f71f31e9055a183b5fcc20ae8d5fc4ae6d1daf36a2d2df359b8a327e71281262
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/5.1.0 CPython/3.9.19
|
Security for lapa-commons 0.0.3
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.