Skip to main content

Python utility library

Project description

https://travis-ci.org/cloudboss/friend.svg?branch=master

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

friend-0.2.1.tar.gz (14.0 kB view details)

Uploaded Source

Built Distributions

friend-0.2.1-py3-none-any.whl (10.7 kB view details)

Uploaded Python 3

friend-0.2.1-py2-none-any.whl (10.7 kB view details)

Uploaded Python 2

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

Hashes for friend-0.2.1.tar.gz
Algorithm Hash digest
SHA256 be432d259d758d5abe6842214ea2f4e4e4021003c27a9c8e129b87e3fc9cd835
MD5 807b6eb160f15ab8f45637c8d3da4bec
BLAKE2b-256 226d046e0e2de30f4e0485af13d2608afc651504cde62d48d64b7de3e8b73b26

See more details on using hashes here.

File details

Details for the file friend-0.2.1-py3-none-any.whl.

File metadata

File hashes

Hashes for friend-0.2.1-py3-none-any.whl
Algorithm Hash digest
SHA256 55e06ff3a690f91b8616fd47299c61449823b403a1f82565ec45eba25628feec
MD5 0253c3d152d261e9ea5e3d199dae9916
BLAKE2b-256 add4c673c03880f680d4c44c93e143717b767baca4cdc286b59835cb5a851ed2

See more details on using hashes here.

File details

Details for the file friend-0.2.1-py2-none-any.whl.

File metadata

File hashes

Hashes for friend-0.2.1-py2-none-any.whl
Algorithm Hash digest
SHA256 4260ffe877a33784e82197d871b02058ec51e40b7022974154337726cc8131a9
MD5 2bdb7308e07ee2aea04e4e98fd10d212
BLAKE2b-256 9774b28c915b4183a612fa333926918caedc564f46bcdfbe8390f1309a0f6459

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page