Skip to content

Commit b3b89c1

Browse files
author
Luca Valentini
authored
Update README.md and enable Codecov upload (#2)
* Update README * Enable Codecov
1 parent 6284ca3 commit b3b89c1

File tree

2 files changed

+77
-10
lines changed

2 files changed

+77
-10
lines changed

.github/workflows/ci.yml

Lines changed: 6 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -27,11 +27,9 @@ jobs:
2727
run: |
2828
poetry run pytest --cov=./ --cov-report=xml
2929
- name: Upload coverage to Codecov
30-
run: echo "Codecov disabled"
31-
# NOTE: Disabled for now
32-
# uses: codecov/[email protected]
33-
# with:
34-
# token: ${{secrets.CODECOV_TOKEN}}
35-
# file: ./coverage.xml
36-
# flags: unittests
37-
# name: python-aws-ssm
30+
uses: codecov/[email protected]
31+
with:
32+
token: ${{secrets.CODECOV_TOKEN}}
33+
file: ./coverage.xml
34+
flags: unittests
35+
name: python-aws-ssm

README.md

Lines changed: 71 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,72 @@
1-
# python-aws-ssm
1+
[![Build Status](https://wdp9fww0r9.execute-api.us-west-2.amazonaws.com/production/badge/PaddleHQ/python-aws-ssm)](https://wdp9fww0r9.execute-api.us-west-2.amazonaws.com/production/results/PaddleHQ/python-aws-ssm)
2+
[![codecov](https://codecov.io/gh/PaddleHQ/python-aws-ssm/branch/master/graph/badge.svg)](https://codecov.io/gh/PaddleHQ/python-aws-ssm)
3+
[![License](https://img.shields.io/badge/License-Apache%202.0-blue.svg)](https://opensource.org/licenses/Apache-2.0)
24
<a href="https://github.com/ambv/black"><img alt="Code style: black" src="https://img.shields.io/badge/code%20style-black-000000.svg"></a>
3-
Python package that interfaces with AWS System Manager
5+
6+
# python-aws-ssm
7+
Python package that interfaces with [AWS System Manager](https://www.amazonaws.cn/en/systems-manager/).
8+
9+
## Why to use python-aws-ssm and not the aws-sdk-go?
10+
This package is wrapping the aws-sdk-go and hides the complexity dealing with the not so Python friendly AWS SDK.
11+
Perfect use case for this package is when secure parameters for an application are stored to
12+
[AWS Parameter Store](https://docs.aws.amazon.com/systems-manager/latest/userguide/systems-manager-parameter-store.html)
13+
using a path hierarchy. During application startup you can use this package to fetch them and use them in your application.
14+
15+
## Install
16+
```bash
17+
pip install python-aws-ssm
18+
```
19+
20+
## Examples
21+
22+
#### Basic Usage
23+
24+
```python
25+
from python_aws_ssm.parameters import ParameterStore
26+
27+
# Assuming you have the parameters in the following format:
28+
# my-service/dev/param-1 -> with value `a`
29+
# my-service/dev/param-2 -> with value `b`
30+
parameter_store = ParameterStore()
31+
# Requesting the base path
32+
parameters = parameter_store.get_parameters_by_path("/my-service/dev/")
33+
# And getting a specific value
34+
value = parameters.get("param-1")
35+
# value should be `a`
36+
```
37+
38+
#### Recursive and nested options
39+
40+
```python
41+
from python_aws_ssm.parameters import ParameterStore
42+
43+
# Assuming you have the parameters in the following format:
44+
# my-service/dev/param-1 -> with value `a`
45+
# my-service/dev/param-2 -> with value `b`
46+
parameter_store = ParameterStore()
47+
# Requesting the base path
48+
parameters = parameter_store.get_parameters_by_path(
49+
"/my-service/", recursive=True, nested=True
50+
)
51+
# And getting a specific value
52+
dev_parameters = parameters.get("dev")
53+
# value should be {"param-1": "a", "param-2": "b"}
54+
```
55+
56+
#### Get parameters by name
57+
58+
```python
59+
from python_aws_ssm.parameters import ParameterStore
60+
61+
# Assuming you have the parameters in the following format:
62+
# my-service/dev/param-1 -> with value `a`
63+
# common/dev/param-2 -> with value `b`
64+
parameter_store = ParameterStore()
65+
# Requesting the base path
66+
parameters = parameter_store.get_parameters(
67+
["/my-service/dev/param-1", "/common/dev/param-2"]
68+
)
69+
# And getting a specific value
70+
dev_parameters = parameters.get("/common/dev/param-2")
71+
# value should be `b`
72+
```

0 commit comments

Comments
 (0)