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.0.tar.gz (13.9 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

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

Uploaded Python 2

File details

Details for the file friend-0.2.0.tar.gz.

File metadata

  • Download URL: friend-0.2.0.tar.gz
  • Upload date:
  • Size: 13.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No

File hashes

Hashes for friend-0.2.0.tar.gz
Algorithm Hash digest
SHA256 2dba3b6cc7db0bc599e066846e888dffa40d198d00948a4b752fbc38cedaf90e
MD5 16e8dd1183fb46ddf0596c5859612aed
BLAKE2b-256 cd9b5cf2d3d8b76e38a60c132202b13d4a87230cc6d03eb4ab7f08bbd602f9e0

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for friend-0.2.0-py2-none-any.whl
Algorithm Hash digest
SHA256 c9a6ff0ddaabfe27d43d5913dd2ba8214364c4f413c0cd1ec2d1fa7c5c13ade6
MD5 fea76eb385d10150cd1f2df5f0f4137c
BLAKE2b-256 ef44ea7e83bc98333c98d4089e5c7b6e132a69f5e11966f860f80d2e93a4939f

See more details on using hashes here.

Supported by

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