YAML Project Loader
Project description
YAML Project Configuration Reader
Who needs this module?
Any developer who is developing an application that has to be configured through text files. If you can call a set of such configurations "a project", this module might be for you.
Example
- Your application is a code generator.
- The users of your application should be able to decide how the code is generated for different projects.
- It can generate code automatically for many languages. You decided that each language would be a plugin of your software.
- Depending on different conditions, the code must contain some stuff or not (comments, optimizations, verbose content...). It seems you have different contexts
- You would like to have an easy way to define what a project of your application is regarding all possible configurations, like:
- User wants to generate MATLAB and C code in a project, for debug and release. And for debug it has to generate the development documentation too.
- This user also wants to generate Python, Node.js and Dockerfiles, for development and release. Roll-out credentials and URLs are different for each context.
What is a project?
When developing an application, sometimes it is worth to define a project as the entity that our software will work with.
A project is a set of files with a known format and arranged in a known set of folders.
It is defined by a path where the root of such file structure is saved.
What provides this module?
- This module provides a convention about how to arrange your project files and a Python API to read that set of files.
- It will apply a logic about how plugin and context configurations have to be merged into a single configuration object.
What does this module not provide?
This module does not tell you what configuration attributes you need in your projects, or what plugins or contexts.
You have to decide if the structure of plugins + contexts
suits your software and decide where to put what.
Then, using the module, you can just call an API function and get a full object where you can read all the attributes you need.
Contexts
A context is a set of conditions which relate to different ways to run for your application.
Think of debug
or release
in classic development. Or development
and production
when rolling-out.
Plugins
A plugin is an optional piece of your application that needs to be configured in each project. The plugin configurations are most of the time the same within a project.
Think of a report generator plugin; your application does whatever logic with the project and has the option to generate reports. Such reports need a format, an output folder, maybe some conventions, a language...These are plugin configurations and they almost do not change, regardless of the context.
Overrides
Contexts can, sometimes, override plugin configurations for specific tasks. It is not common, but this module provides an easy way to do this.
Configs
Configs are mixes of one context and one or more plugins configurations. Your application will probably:
- Ask for the defined configs in the project
- Choose one of them
- Call the YAMLProject API to retrieve the merged configuration from the chosen config
- Pass the merged object to your logic so values can be used to modify the behavior
This module
This module creates a structure in memory from a set of YAML files that define a configuration for a project. A project is an abstract concept modeled as a set of files and folders that is going to be read/written by some software. The structure of a project is:
- A root set of attributes defined at
root.yaml
. For example: a name, a description, etc. - A set of plugin configurations. The application processing your project can have plugins. The project configuration provides
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 YAML_Project_Loader-0.0.4.tar.gz
Algorithm | Hash digest | |
---|---|---|
SHA256 | 584e6200bc4bf3f6acd498cf0bc9b985e1c617930c6d7351276bf7053302f59e |
|
MD5 | 64b68c2cb5e89f345e3102292e52d7d6 |
|
BLAKE2b-256 | f7eeafad788d55c79a85cc1ce6cafa4da4e66dc75a0af03f0f8b7fff4bc9247b |
Hashes for YAML_Project_Loader-0.0.4-py2-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | dbc343151eadd9bd6843b93fad81d760afa3fdf95cd2820184f559c2928ed85b |
|
MD5 | d048218a62fc88e9a9f7b8434fc7458c |
|
BLAKE2b-256 | 8fefbdd9c9a3d694ff8d89d8c52c37c552823724b041a9073d38d91f1ed806b1 |