Skip to main content

CuCo

CuCo (Cute Configuration) is a project for making it easier to write configuration files which may be automatically converted into a set of alternative system setups.

Installation

To install the package, execute the following command:

pip install cuco

Usage

To use the package, first, annotate some of your classes with annotator config_parser according to the following example:

from dataclasses import dataclass
from cuco import config_parser, Config

@config_parser()
@dataclass
class Foo(Config):
    bar: int = 0
    baz: str = None

    name: str = None  # This field contains configuration name, which includes values for alternating configuration fields in a particular setup

Then you would need to create a file with name assets/types/foo.yml for this class with specification of keys which are allowed to set up in this file (the following example demonstrates that field qux from configuration file will be translated into the field bar of the generated objects):

qux: bar

After that you finally can create a file with name assets/foo/default.yml with some value for the configurable fields (the given example demonstrates array consisting of 2 values, which will lead to generation of 2 config objects):

_type: foo

qux:
    - 1
    - 2

The last step is calling method make_configs which will read all the configuration files and decide how they should be parsed, returning the list of generated configuration objects:

from .Foo import Foo

configs = make_configs(
    path = 'assets/foo/default.yml', type_specification_root = 'assets/types'
)

Testing

To run the tests, execute the following command:

python -m unittest discover test

Metadata

Release files for cuco 0.9.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for cuco 0.9.0
File Size Uploaded Provenance Actions
cuco-0.9.0.tar.gz 14.0 kB Without provenance Details for cuco-0.9.0.tar.gz

Release files / cuco-0.9.0.tar.gz

Download URL cuco-0.9.0.tar.gz
Size 14.0 kB
Tags Source
SHA-256 checksum
How to use checksums
17e6e989dce8f90635377738a61727d7cdfe0bad63e157aea75fd651103ca96b
BLAKE2b-256 checksum
How to use checksums
627af686d9050c4a7cf29d4a2dbcbc77e0a5893611eb1e331a14c87223bb96b3
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/4.0.1 CPython/3.9.12

Security for cuco 0.9.0

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.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page