A Python library for managing configuration parameters and constants, centralizing access to application-wide settings and global constants
Project description
paramlib
paramlib is a specialised Python package designed for centralised parameter and configuration management. It provides a structured approach to handling global parameters, configuration settings, and commonly used constants across projects.
Features
- Global Parameters:
- Time-related format strings
- Mathematical constants
- Programming concepts
- Socio-economical parameters
- Configuration Management:
- Database credentials handling
- Error code mappings
- User information storage
- System-wide constants
Installation Guide
Dependency Notice
This package has minimal dependencies and is designed to be lightweight. No additional third-party libraries are required for basic functionality.
Installation Instructions
Install the package using pip:
pip install paramlib
Package Updates
To stay up-to-date with the latest version of this package, simply run:
pip install --upgrade paramlib
Project Structure
The package is organised into the following components:
-
global_parameters.py: Core parameter definitions
- Time format strings
- Mathematical constants
- Programming concepts
- Socio-economical parameters
-
config_params.py: Configuration settings
- Database credentials
- Error code mappings
- User information paths
For detailed version history and changes, please refer to:
CHANGELOG.md: Comprehensive list of changes for each versionVERSIONING.md: Versioning policy and guidelines
Usage Examples
Time Format Strings
from paramlib import global_parameters
# Access basic time format strings
basic_format = global_parameters.BASIC_TIME_FORMAT_STRS["H"] # "%Y-%m-%d %H:%M:%S"
date_format = global_parameters.BASIC_TIME_FORMAT_STRS["D"] # "%Y-%m-%d"
# Access custom time format strings
excel_format = global_parameters.CUSTOM_TIME_FORMAT_STRS["CT_EXCEL_SPANISH_H"] # "%d/%m/%y %H:%M:%S"
Configuration Parameters
from paramlib import config_params
# Access database credentials
db_creds = config_params.DATABASE_CREDENTIALS
username = db_creds["username"]
password = db_creds["password"]
# Access error code mappings
error_message = config_params.DB_ERROR_CODE_DICT["1045"] # "Wrong username"
Best Practices
-
Parameter Organisation:
- Group related parameters together
- Use clear, descriptive names
- Follow Python naming conventions
-
Configuration Management:
- Keep sensitive information secure
- Use environment variables for sensitive data
- Document all configuration options
-
Version Control:
- Track changes in CHANGELOG.md
- Follow semantic versioning
- Document breaking changes
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
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file paramlib-3.4.1.tar.gz.
File metadata
- Download URL: paramlib-3.4.1.tar.gz
- Upload date:
- Size: 4.9 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.11.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
1ddb4579cccd91e6c363de130ba1454c8b135249258539bd564fe794b66516f8
|
|
| MD5 |
5da19f0c0368041138923e2f9b66ffe7
|
|
| BLAKE2b-256 |
b00600ee9ce897a2c0470dc3491f954c86afd33f8e5e86788a86c05dc1c312ae
|
File details
Details for the file paramlib-3.4.1-py3-none-any.whl.
File metadata
- Download URL: paramlib-3.4.1-py3-none-any.whl
- Upload date:
- Size: 5.2 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.11.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
e432438cece116720903292621644a792df31647ae04a96dbcf143eb303b0de7
|
|
| MD5 |
ed44203dd044d0a6999db014b91af97a
|
|
| BLAKE2b-256 |
5a82cdfbb7ed66a22cbfd23a48030e9a6dd852813235f830421da09f5906167f
|