Skip to main content

Create generic any easy to manage Configs for your Project

Project description

PyPI Python Version License Read the documentation at https://cornflakes.readthedocs.io Build Package Status Run Tests Status Codecov

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

cornflakes-2.3.4.tar.gz (989.3 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

cornflakes-2.3.4-cp38-cp38-manylinux_2_35_x86_64.whl (252.3 kB view details)

Uploaded CPython 3.8manylinux: glibc 2.35+ x86-64

File details

Details for the file cornflakes-2.3.4.tar.gz.

File metadata

  • Download URL: cornflakes-2.3.4.tar.gz
  • Upload date:
  • Size: 989.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.2.1 CPython/3.8.14 Linux/5.19.15-201.fc36.x86_64

File hashes

Hashes for cornflakes-2.3.4.tar.gz
Algorithm Hash digest
SHA256 0b0037f8ae5e9229e95486d238f0dc7a82c76af7d6ff1d7c57316f2b18e6e4c8
MD5 138d7ccf08fa11829e754397ab117ef5
BLAKE2b-256 b485d19dfc97e9024ea2c77fff9dcf99c1de3367f7ff3c5c6387fcaee19c76ea

See more details on using hashes here.

File details

Details for the file cornflakes-2.3.4-cp38-cp38-manylinux_2_35_x86_64.whl.

File metadata

  • Download URL: cornflakes-2.3.4-cp38-cp38-manylinux_2_35_x86_64.whl
  • Upload date:
  • Size: 252.3 kB
  • Tags: CPython 3.8, manylinux: glibc 2.35+ x86-64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.2.1 CPython/3.8.14 Linux/5.19.15-201.fc36.x86_64

File hashes

Hashes for cornflakes-2.3.4-cp38-cp38-manylinux_2_35_x86_64.whl
Algorithm Hash digest
SHA256 a750f6193ffe6c35a9bc567556478fa30d564f67bd36654ad41fa3ac10702eef
MD5 e82f5eb770b15a471c8bf4f307b4dd07
BLAKE2b-256 ef14ae67e6cc949696d44640e436ca1cf0a14a26e3f95afbeaad7e96ba90539c

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page