Create generic any easy to manage Configs for your Project
Project description
pip install cornflakes
Information
This package was created by starting C ++ methods to incorporate into my python implementations.
To make things easier for me, lightweight public libraries were included (especially to carry out string operations):
hash-library
strtk
The following methods have currently been implemented:
ini_load (flexible and ligthweigh ini to dict parser, Faster Than Configparser)
eval_type (method to parse strings in python-types e.g. int | bool | timestamp
simple_hmac (vectorized c++ hmac implementation)
default_ca_path (python function to find a default ssl / ca certificate path)
In the future the following will be implemented: - more hash methods - c++ optimized grep methods - c++ optimized url-tools methods
Currently, the package was only tested for Linux ## Usage
from cornflakes import ini_load, default_ca_path, eval_type
ini_load(files={"s3_configs": ["examples/config/aws_config",
"examples/config/aws_credentials",
"examples/config/.s3cfg"]},
sections=["default", "qa"],
keys={"signurl_use_https": ["signurl_use_https"],
"aws_access_key_id": ["access_key"],
"aws_secret_access_key": ["secret_key"],
"endpoint_url": ["endpoint-url", "host_base"],
"region_name": ["bucket_location", "region", "aws_default_region"],
"service_name": ["service_name"],
"verify": ["ca_certs", "aws_ca_bundle", "ca_bundle"],},
defaults={
"region_name": "us-east-1",
"signurl_use_https": True,
"verify": default_ca_path(),
"service_name": "s3",
})
Development
Prerequisites
A compiler with C++17 support
Pip 10+ or CMake >= 3.4 (or 3.8+ on Windows, which was the first version to support VS 2015)
Python 3.8+
Commands
Just clone this repository and pip install. Note the --recursive option which is needed for the pybind11 submodule:
git clone --recursive https://gitlab.blubblub.tech/sgeist/cornflakes.git
Install the package using makefiles:
make install
Build dist using makefiles:
make dist
Run tests (pytest) using makefiles:
make test
Run all tests using makefiles:
make test-all
Run lint using makefiles:
make lint
Create dev venv:
python -m venv .venv
source .venv/bin/activate
pip install cookietemple ninja pre-commit poetry
Bump Version using cookietemple:
cookietemple bump-version "<version(e.g 0.0.1)>"
Run lint using cookietemple:
cookietemple lint .
Install pre-commit:
pre-commit install
Update pre-commit:
pre-commit update -a
Run pre-commit:
pre-commit run -a
Publish
Its not recommended publish manually (use git-ci or github workflows instead).
make publish
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 Distributions
Hashes for cornflakes-2.9.8-cp310-cp310-win_amd64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | fda2230e385bc0643a12b5d819e5081a722c2c7d52dd7b075171235663212de4 |
|
MD5 | d310108f60bf514631b4d810858fe0be |
|
BLAKE2b-256 | e197f9969a85ec31c157ba7304ee8cb33300dcc26b0afd27bba7c192a3cb8a87 |
Hashes for cornflakes-2.9.8-cp310-cp310-manylinux_2_31_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 171ac7bb75a1807317a5e4299ea40451a11a34db5cf7cdee9bef6ea4b7ad6390 |
|
MD5 | 2241e86f138a6d1c5f26deafb1a1aac7 |
|
BLAKE2b-256 | eb6b000ae27bef8c716f66c7b65df373d8716947cffb2571ae5f27cd2f3745e6 |
Hashes for cornflakes-2.9.8-cp310-cp310-macosx_10_16_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | db76abbb1b94da4d159ee208d6cc179effb1e221d7b3ab6dbad66a19d6fab59e |
|
MD5 | b5a787575f09a34e2d010bada814ab97 |
|
BLAKE2b-256 | e8a51979444aa9ac865401fbeab2014be18a29b88a08e96bb2ffa5fb47649a25 |
Hashes for cornflakes-2.9.8-cp39-cp39-win_amd64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | d9c685cd0d2f26e6371b5632778c42a7ddec07e0a7a04f20c6f86afa1c868b98 |
|
MD5 | 63b4b69e4e16820485873a8bcdf73ac2 |
|
BLAKE2b-256 | a4d37d79aab18f0c0184cf241557b8996cb606eafdf86cb1f30aba3188d8b0c6 |
Hashes for cornflakes-2.9.8-cp39-cp39-manylinux_2_31_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | c44bcd1f9febafb327f6798df5e9c8e580d8ea10a869bccb80ba972b7470e890 |
|
MD5 | c836d7e480195e1f0fc9d70da8fc61e4 |
|
BLAKE2b-256 | 0b564bc09df26eb5d0304f85f26e85bb92cca409daf26b2da2a369102994c97f |
Hashes for cornflakes-2.9.8-cp39-cp39-macosx_10_16_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 62b85a0bb307ebe812f7405a07039d213e694691f34740e0c82da8e17fc8ff43 |
|
MD5 | 8f9d4dd9569d738b80c36c98ca712322 |
|
BLAKE2b-256 | 73d98bbef1f79ea238bb01c1d5d9c470f79a957737e7aab9191b8d9e6a810e51 |
Hashes for cornflakes-2.9.8-cp38-cp38-win_amd64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | c8780290342d6d838040304414ee5297851e80a34b94ffe98e2abc59868638b6 |
|
MD5 | 1401785113e44e6454a03c74137f0c60 |
|
BLAKE2b-256 | e02d72035459887e9945e9f61216dc54d149d227ed65e2eeadad7a7eadd579fd |
Hashes for cornflakes-2.9.8-cp38-cp38-manylinux_2_31_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | c081b066208f16bdc1dca635c5375ac9e7ac0f445769ed50c0a9e08ce4d0f526 |
|
MD5 | ffd30e3672c41713d2ea82c0e4fb251b |
|
BLAKE2b-256 | d8a92c4394ab3f016f2d0bb6858908eb3c38d199feba333addd7c730116eec1a |
Hashes for cornflakes-2.9.8-cp38-cp38-macosx_10_16_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 6936c93fee4ee9c4dd1c4fa1732aa7c3aa18981f1dc3b3f25d1be0fcfe71c50b |
|
MD5 | 6913ce02ed63d8828a5b603daf363103 |
|
BLAKE2b-256 | bfe53d4bab4632f5f860af17f217ac4715f39ebc8884d46e166f087f4774b1b3 |