RootKit custom PyYaml Lib
Project description
rkt_config_lib - Python library
This Python library is based only on built-in Python libraries and one (1) non-build-in library : PyYaml
Python Version 3.7.2
PyYaml Version 5.4.1 (Released Jan 20, 2021)
What is Python?
Python is an interpreted high-level general-purpose programming language. Python's design philosophy emphasizes code readability with its notable use of significant indentation. Its language constructs as well as its object-oriented approach aim to help programmers write clear, logical code for small and large-scale projects.
What is PyYaml?
YAML is a data serialization format designed for human readability and interaction with scripting languages. PyYAML is a YAML parser and emitter for Python.
PyYAML features a complete YAML 1.1 parser, Unicode support, pickle support, capable extension API, and sensible error messages. PyYAML supports standard YAML tags and provides Python-specific tags that allow to represent an arbitrary Python object.
PyYAML is applicable for a broad range of tasks from complex configuration files to object serialization and persistence.
Libraries
- Config: overlay of PyYaml library (read-only), use Tool and Logger library (rkt_tool_lib, rkt_logger_lib)
Use it
Install
(venv) my_project> pip install rkt_config_lib [--index-url https://gitlab.tprc.ovh/api/v4/groups/python/-/packages/pypi]
Example
from rkt_config_lib import Config
c = Config()
# by default search folder named "config" in root project folder
# for load all yaml files
c.get_data()
print(f"{c.data}")
Output (as file, sdtout or both)
03/03/2022 16:44:09 :: [Logger] :: INFO :: Create logger for 'Config'
03/03/2022 16:44:09 :: [Logger] :: INFO :: add 'StreamHandler' in 'Config' logger
03/03/2022 16:44:09 :: [Logger] :: INFO :: add 'FileHandler' in 'Config' logger
03/03/2022 16:44:09 :: [Config] :: INFO :: Load 'database' file ...
{'database': {'connect_id': {'dbms': 'mariadb'}}}
^^^^^^^^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
| |
| data: file content
file name without extension
Contributing
If you find this library useful here's how you can help:
- Send a merge request with your kickass new features and bug fixes
- Help new users with issues they may encounter
- Support the development of this library and star this repo!
Project details
Release history Release notifications | RSS feed
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
Hashes for rkt_config_lib-1.3.0-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 0447b6c7e85179b518483cec4de92f7bb8d4f4b3cafe4f6dfbca1563e9b8eaae |
|
MD5 | 7bdb720bc7beb824a1dfeea708fce238 |
|
BLAKE2b-256 | 6043963c291127011fec86511567dd482e57ea1fb7dac3c73d1a5ca2c760c02d |