Skip to content

Commit eaa1a3a

Browse files
Updated build info
1 parent 0bcda55 commit eaa1a3a

File tree

6 files changed

+111
-0
lines changed

6 files changed

+111
-0
lines changed

pyproject.toml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,9 @@ Homepage = "https://github.com/shadowy-pycoder/pyya"
3131
Repository = "https://github.com/shadowy-pycoder/pyya"
3232
Issues = "https://github.com/shadowy-pycoder/pyya/issues"
3333

34+
[tool.setuptools]
35+
license-files = []
36+
3437
[tool.mypy]
3538
python_version = "3.8"
3639
cache_dir = ".mypy_cache/strict"

pyya.egg-info/PKG-INFO

Lines changed: 93 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,93 @@
1+
Metadata-Version: 2.1
2+
Name: pyya
3+
Version: 0.1.0
4+
Summary: Convert YAML configuration files to Python objects
5+
Author-email: shadowy-pycoder <[email protected]>
6+
Project-URL: Homepage, https://github.com/shadowy-pycoder/pyya
7+
Project-URL: Repository, https://github.com/shadowy-pycoder/pyya
8+
Project-URL: Issues, https://github.com/shadowy-pycoder/pyya/issues
9+
Classifier: Programming Language :: Python :: 3
10+
Classifier: Programming Language :: Python :: 3.8
11+
Classifier: Programming Language :: Python :: 3.9
12+
Classifier: Programming Language :: Python :: 3.10
13+
Classifier: Programming Language :: Python :: 3.11
14+
Classifier: Programming Language :: Python :: 3.12
15+
Classifier: Programming Language :: Python :: 3.13
16+
Classifier: License :: OSI Approved :: MIT License
17+
Classifier: Operating System :: MacOS :: MacOS X
18+
Classifier: Operating System :: Microsoft :: Windows
19+
Classifier: Operating System :: POSIX :: Linux
20+
Requires-Python: >=3.8
21+
Description-Content-Type: text/markdown
22+
Requires-Dist: camel-converter>=3.1.2
23+
Requires-Dist: munch>=4.0.0
24+
Requires-Dist: pyyaml>=6.0.2
25+
Requires-Dist: types-pyyaml>=6.0.12.20240917
26+
27+
# paya - Simple tool that converts YAML configuration files to Python objects
28+
29+
[![License: MIT](https://img.shields.io/badge/License-MIT-blue.svg)](https://opensource.org/licenses/MIT)
30+
31+
32+
## Installation
33+
34+
```shell
35+
pip install pyya
36+
```
37+
38+
## Usage
39+
40+
Create YAML configuration files for your project:
41+
42+
43+
```yaml
44+
# default.config.yaml - this file usually goes to version control system
45+
database:
46+
host: localhost
47+
port: 5432
48+
username: postgres
49+
password: postgres
50+
```
51+
52+
```yaml
53+
# config.yaml - this file for production usage
54+
database:
55+
username: username
56+
password: password
57+
```
58+
59+
Import configuration files in your Python code with pyya:
60+
61+
```python
62+
import json
63+
64+
from pyya import init_config
65+
66+
config = init_config(
67+
'config.yaml', 'default.config.yaml',
68+
convert_keys_to_snake_case = False,
69+
raise_error_non_identifiers = False)
70+
print(json.dumps(config.database))
71+
72+
# Output:
73+
# {"host": "localhost", "port": 5432, "username": "username", "password": "password"}
74+
75+
```
76+
77+
As you can see, pyya automatically merges default config file with production config file.
78+
79+
Under the hood `pyya` uses [munch](https://pypi.org/project/munch/) library to create attribute-stylish dictionaries.
80+
81+
`paya` automatically adds underscore prefix to Python keywords and can be configured to convert `camelCase` or `PascalCase` keys to snake_case.
82+
83+
If `raise_error_non_identifiers` is True, `pyya` will raise error if section name is not valid Python identifier.
84+
85+
## Contributing
86+
87+
Are you a developer?
88+
89+
- Fork the repository
90+
- Create your feature branch: `git switch -c my-new-feature`
91+
- Commit your changes: `git commit -am 'Add some feature'`
92+
- Push to the branch: `git push origin my-new-feature`
93+
- Submit a pull request

pyya.egg-info/SOURCES.txt

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
LICENSE
2+
README.md
3+
pyproject.toml
4+
pyya/__init__.py
5+
pyya.egg-info/PKG-INFO
6+
pyya.egg-info/SOURCES.txt
7+
pyya.egg-info/dependency_links.txt
8+
pyya.egg-info/requires.txt
9+
pyya.egg-info/top_level.txt

pyya.egg-info/dependency_links.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+

pyya.egg-info/requires.txt

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
camel-converter>=3.1.2
2+
munch>=4.0.0
3+
pyyaml>=6.0.2
4+
types-pyyaml>=6.0.12.20240917

pyya.egg-info/top_level.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
pyya

0 commit comments

Comments
 (0)