Python utility library
Project description
What is Friend?
Friend is all of those of utilities you keep reimplementing across your Python projects, that all got together and decided to live in harmony.
Maybe you just parsed some YAML that contained some configuration in “snake_case”, and you want to pass this configuration to a boto3 function which takes the same values but in “PascalCase”. Then you might find snake_to_pascal_obj or one of its variants to come in handy.
with open('conf.yml') as f: conf = yaml.load(f) ec2 = boto3.resource('ec2') ec2.create_instances( ImageId='ami-12345678', BlockDeviceMappings=snake_to_pascal_obj(conf['block_device_mappings']), .... )
Or you need to add a retry to that script that keeps breaking your Jenkins job because the corporate proxy fails about 5% of the time. Sure, you can add a try/except and wrap it in a for loop, but putting the retryable decorator on top of that problematic function will do that for you in one configurable line.
@retryable(times=5) def flaky_function(): status = requests.get('https://service.corp/v2/status').json() if 'error' in status: send_important_email(status['error'])
Read the full documentation at http://friend.readthedocs.io.
Project details
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distributions
File details
Details for the file friend-0.2.1.tar.gz
.
File metadata
- Download URL: friend-0.2.1.tar.gz
- Upload date:
- Size: 14.0 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | be432d259d758d5abe6842214ea2f4e4e4021003c27a9c8e129b87e3fc9cd835 |
|
MD5 | 807b6eb160f15ab8f45637c8d3da4bec |
|
BLAKE2b-256 | 226d046e0e2de30f4e0485af13d2608afc651504cde62d48d64b7de3e8b73b26 |
File details
Details for the file friend-0.2.1-py3-none-any.whl
.
File metadata
- Download URL: friend-0.2.1-py3-none-any.whl
- Upload date:
- Size: 10.7 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 55e06ff3a690f91b8616fd47299c61449823b403a1f82565ec45eba25628feec |
|
MD5 | 0253c3d152d261e9ea5e3d199dae9916 |
|
BLAKE2b-256 | add4c673c03880f680d4c44c93e143717b767baca4cdc286b59835cb5a851ed2 |
File details
Details for the file friend-0.2.1-py2-none-any.whl
.
File metadata
- Download URL: friend-0.2.1-py2-none-any.whl
- Upload date:
- Size: 10.7 kB
- Tags: Python 2
- Uploaded using Trusted Publishing? No
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 4260ffe877a33784e82197d871b02058ec51e40b7022974154337726cc8131a9 |
|
MD5 | 2bdb7308e07ee2aea04e4e98fd10d212 |
|
BLAKE2b-256 | 9774b28c915b4183a612fa333926918caedc564f46bcdfbe8390f1309a0f6459 |