Import JSON/YAML like importing .py files
Project description
ezcf stands for easy configuration, it allows you to import JSON/YAML like importing .py files, which is very useful for reading conf files with these formats.
Install
pip install ezcf
Note: if you run into error: yaml.h: No such file or directory, don’t worry, you can still use ezcf without any problem.
Sample Usage
├── subdir │ ├── __init__.py │ └── sample_yaml.yaml ├── test_normal.py └── sample_json.json
If you want to use configurations in sample_yaml.yaml and sample_json.json, here’s how:
import ezcf
from subdir.sample_yaml import *
from sample_json import something
You can assume they’re regular python files.(Currently ezcf only supports files with utf-8 encoding)
ezcf is still in developement, use it at your own risk. If you find any bug, please report it in issues.
Roadmap
[x] Use dot to seperate folder/subfolder/file
[x] Unicode support
[x] JSON support
[x] YAML support
[ ] INI support
[ ] Auto encoding detect?
[x] CI
[ ] coverage
[x] pypi
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 ezcf-0.0.1.dev1-py2.py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | b698df840a9d303f8113b7bd70f5f6d5c8ccf99a475f0248a36133949fa27931 |
|
MD5 | 13fe57dca26bd183363d4aeafd9068f2 |
|
BLAKE2b-256 | 1ee446ad27c2f86d5b50ab9372920f793750f1a96ee55eebee578d0fb20617f6 |