Skip to content

Commit f41143d

Browse files
committed
Merge branch 'main' into qa
2 parents 8c5f9c5 + ed9ebb3 commit f41143d

2 files changed

Lines changed: 27 additions & 0 deletions

File tree

README.md

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,25 @@ This package contains common Python utility classes and functions.
1818
* Creating a logger in the appropriate format
1919
* Obfuscating a value using bcrypt
2020

21+
## Usage
22+
```python
23+
# test_file.py
24+
from nypl_py_utils.classes.kinesis_client import KinesisClient
25+
from nypl_py_utils.functions.config_helper import load_env_file
26+
27+
load_env_file(...)
28+
kinesis_client = KinesisClient(...)
29+
```
30+
31+
```bash
32+
# requirements.txt
33+
34+
# Do not use any version below 1.0.0
35+
# All available optional dependencies can be found in pyproject.toml.
36+
# See the "Managing dependencies" section below for more details.
37+
nypl-py-utils[kinesis-client,config-helper]==1.0.1
38+
```
39+
2140
## Developing locally
2241
In order to use the local version of the package instead of the global version, use a virtual environment. To set up a virtual environment and install all the necessary dependencies, run:
2342

src/nypl_py_utils/functions/config_helper.py

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,14 @@ def load_env_file(run_type, file_string):
1515
1616
It requires the YAML file to be split into a 'PLAINTEXT_VARIABLES' section
1717
and an 'ENCRYPTED_VARIABLES' section.
18+
19+
Parameters
20+
----------
21+
run_type: str
22+
The name of the config file to use, e.g. 'devel'
23+
file_string: str
24+
The path to the config files with the filename as a variable to be
25+
interpolated, e.g. 'config/{}.yaml'
1826
"""
1927

2028
env_dict = None

0 commit comments

Comments
 (0)