Skip to main content

Python functools for async!

Project description

Build Status License Documentation Status

aiofunctools

Library to help in Python functional programing. It’s asyncio compatible.

Basic idea behind it is Railway Oriented Programing.

This allows us to:

  • simplify our code.
  • improve error management.
  • be cool! be functional!

Examples:

Old code example:

async def create_user_handler(request) -> Response:
    try:
        user = check_valid_user(request)
        create_user(user)
    except InvalidBody:
        return_422('Invalid body')
    except UserAlreadyExists:
        return_409('User already exists')
    return_201(user)

ROP example:

async def create_user_handler(request) -> Response:
    return await compose(
        check_valid_user,
        create_user,
        return_201
    )(request)

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distributions

No source distribution files available for this release.See tutorial on generating distribution archives.

Built Distribution

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

aiofunctools-0.0.2-py3-none-any.whl (14.8 kB view details)

Uploaded Python 3

File details

Details for the file aiofunctools-0.0.2-py3-none-any.whl.

File metadata

  • Download URL: aiofunctools-0.0.2-py3-none-any.whl
  • Upload date:
  • Size: 14.8 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/2.0.0 pkginfo/1.5.0.1 requests/2.22.0 setuptools/41.6.0 requests-toolbelt/0.9.1 tqdm/4.37.0 CPython/3.6.7

File hashes

Hashes for aiofunctools-0.0.2-py3-none-any.whl
Algorithm Hash digest
SHA256 5a6100f0d55ff004061f3efee5c9e5d3e4ac30fbdb57dd5f6a157f8fe2ef9d6d
MD5 f9018c2a108b3d0d1534a36f92d08a2f
BLAKE2b-256 2c81c3d0a1f2f4c19ef3baedee3af0b8e4101b2f0e15c3af152f640e7b5ce1b9

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