Skip to content

Commit adee254

Browse files
Fixed README.md, bumped to v0.1.2
1 parent ac894ef commit adee254

File tree

4 files changed

+15
-15
lines changed

4 files changed

+15
-15
lines changed

README.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# paya - Simple tool that converts YAML configuration files to Python objects
1+
# pyya - Simple tool that converts YAML configuration files to Python objects
22

33
![PyPI - Downloads](https://img.shields.io/pypi/dd/pyya)
44
[![ClickPy Dashboard](https://img.shields.io/badge/clickpy-dashboard-orange)](https://clickpy.clickhouse.com/dashboard/pyya)
@@ -12,7 +12,7 @@
1212

1313
- Very `lightweight` and `simple` API (currently it contains only one function)
1414
- `Easy` to use
15-
- Based on popular and well-tested libraries (like `camel-converter` and `munch`)
15+
- Based on popular and well-tested libraries (like `camel-converter`, `PyYAML` and `munch`)
1616
- Automatically `merge` default and production configuration files
1717
- Convert keys in configuration files to `snake_case`
1818

@@ -64,9 +64,9 @@ print(json.dumps(config.database))
6464

6565
As you can see, `pyya` automatically merges default config file with production config file.
6666

67-
Under the hood `pyya` uses [munch](https://pypi.org/project/munch/) library to create attribute-stylish dictionaries.
67+
Under the hood `pyya` uses [PyYAML](https://pypi.org/project/PyYAML/) to parse YAML files and [munch](https://pypi.org/project/munch/) library to create attribute-stylish dictionaries.
6868

69-
`paya` automatically adds underscore prefix to Python keywords and can be configured to convert `camelCase` or `PascalCase` keys to `snake_case`.
69+
`pyya` automatically adds underscore prefix to Python keywords and can be configured to convert `camelCase` or `PascalCase` keys to `snake_case`.
7070

7171
If `raise_error_non_identifiers=True`, `pyya` will raise error if section name is not valid Python identifier.
7272

pyproject.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[project]
22
name = "pyya"
3-
version = "0.1.1"
3+
version = "0.1.2"
44
authors = [
55
{ name="shadowy-pycoder", email="shadowy-pycoder@example.com" },
66
]

pyya.egg-info/PKG-INFO

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
Metadata-Version: 2.1
22
Name: pyya
3-
Version: 0.1.1
3+
Version: 0.1.2
44
Summary: Convert YAML configuration files to Python objects
55
Author-email: shadowy-pycoder <shadowy-pycoder@example.com>
66
Project-URL: Homepage, https://github.com/shadowy-pycoder/pyya
@@ -24,7 +24,7 @@ Requires-Dist: munch>=4.0.0
2424
Requires-Dist: pyyaml>=6.0.2
2525
Requires-Dist: types-pyyaml>=6.0.12.20240917
2626

27-
# paya - Simple tool that converts YAML configuration files to Python objects
27+
# pyya - Simple tool that converts YAML configuration files to Python objects
2828

2929
![PyPI - Downloads](https://img.shields.io/pypi/dd/pyya)
3030
[![ClickPy Dashboard](https://img.shields.io/badge/clickpy-dashboard-orange)](https://clickpy.clickhouse.com/dashboard/pyya)
@@ -38,7 +38,7 @@ Requires-Dist: types-pyyaml>=6.0.12.20240917
3838

3939
- Very `lightweight` and `simple` API (currently it contains only one function)
4040
- `Easy` to use
41-
- Based on popular and well-tested libraries (like `camel-converter` and `munch`)
41+
- Based on popular and well-tested libraries (like `camel-converter`, `PyYAML` and `munch`)
4242
- Automatically `merge` default and production configuration files
4343
- Convert keys in configuration files to `snake_case`
4444

@@ -90,9 +90,9 @@ print(json.dumps(config.database))
9090

9191
As you can see, `pyya` automatically merges default config file with production config file.
9292

93-
Under the hood `pyya` uses [munch](https://pypi.org/project/munch/) library to create attribute-stylish dictionaries.
93+
Under the hood `pyya` uses [PyYAML](https://pypi.org/project/PyYAML/) to parse YAML files and [munch](https://pypi.org/project/munch/) library to create attribute-stylish dictionaries.
9494

95-
`paya` automatically adds underscore prefix to Python keywords and can be configured to convert `camelCase` or `PascalCase` keys to `snake_case`.
95+
`pyya` automatically adds underscore prefix to Python keywords and can be configured to convert `camelCase` or `PascalCase` keys to `snake_case`.
9696

9797
If `raise_error_non_identifiers=True`, `pyya` will raise error if section name is not valid Python identifier.
9898

pyya/__init__.py

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -9,13 +9,13 @@
99

1010

1111
logging.basicConfig(format='%(asctime)-15s \t%(levelname)-8s \t%(name)-8s \t%(message)s')
12-
logger = logging.getLogger('paya')
12+
logger = logging.getLogger(__name__)
1313

1414

1515
ConfigType = Dict[str, Any]
1616

1717

18-
class PayaError(RuntimeError): ...
18+
class PyyaError(RuntimeError): ...
1919

2020

2121
def init_config(
@@ -42,7 +42,7 @@ def _sanitize_section(section: str) -> str:
4242
if raise_error_non_identifiers and not section.isidentifier():
4343
err_msg = f'section `{section}` is not a valid identifier, aborting'
4444
logger.error(err_msg)
45-
raise PayaError(err_msg)
45+
raise PyyaError(err_msg)
4646
if keyword.iskeyword(section):
4747
logger.warning(f'section `{section}` is a keyword, renaming to `_{section}`')
4848
section = f'_{section}'
@@ -55,7 +55,7 @@ def _sanitize_section(section: str) -> str:
5555
raise FileNotFoundError()
5656
except FileNotFoundError as e:
5757
logger.error(e)
58-
raise PayaError(f'{default_config} file is missing or empty') from None
58+
raise PyyaError(f'{default_config} file is missing or empty') from None
5959
try:
6060
with open(Path(config)) as fstream:
6161
_raw_data: ConfigType = yaml.safe_load(fstream) or {}
@@ -68,4 +68,4 @@ def _sanitize_section(section: str) -> str:
6868
except Exception as e:
6969
message = f'{default_config} file is corrupted: {repr(e)}'
7070
logger.error(message)
71-
raise PayaError(message) from None
71+
raise PyyaError(message) from None

0 commit comments

Comments
 (0)