Skip to main content

Python decorator for async properties.

Project description

async_property

https://img.shields.io/pypi/v/async_property.svg https://img.shields.io/travis/ryananguiano/async_property.svg Documentation Status Updates

Python decorator for async properties.

Install

To install async_property, run this command in your terminal:

$ pip install async_property

Or if you have pipenv:

$ pipenv install async_property

Usage

You can use @async_property just as you would with @property, but on a async function.

class Foo:
    @async_property
    async def remote_value(self):
        return await get_remote_value()

The property remote_value now returns an awaitable coroutine.

instance = Foo()
await instance.remote_value

Features

  • Both regular and cached property.

  • Cached properties can be accessed multiple times without repeating function.

Credits

This package was created with Cookiecutter and the audreyr/cookiecutter-pypackage project template.

The ObjectProxy class was taken from wrapt library by Graham Dumpleton.

History

0.1.0 (2019-04-11)

  • First release on PyPI.

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

async_property-0.1.0.tar.gz (13.5 kB view details)

Uploaded Source

Built Distribution

async_property-0.1.0-py2.py3-none-any.whl (9.2 kB view details)

Uploaded Python 2 Python 3

File details

Details for the file async_property-0.1.0.tar.gz.

File metadata

  • Download URL: async_property-0.1.0.tar.gz
  • Upload date:
  • Size: 13.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.13.0 pkginfo/1.5.0.1 requests/2.21.0 setuptools/41.0.0 requests-toolbelt/0.9.1 tqdm/4.31.1 CPython/3.7.2

File hashes

Hashes for async_property-0.1.0.tar.gz
Algorithm Hash digest
SHA256 c51ba1ff7ab38605d38d271214afcbbf76dbb4e3fc8e753ec203224d955cedc3
MD5 50de104fbab5f726b4bcdf33493ac101
BLAKE2b-256 713803da85c7e343e0e54446476d491b02d58f0274d1e8ea9092d0b4d2294b0e

See more details on using hashes here.

File details

Details for the file async_property-0.1.0-py2.py3-none-any.whl.

File metadata

  • Download URL: async_property-0.1.0-py2.py3-none-any.whl
  • Upload date:
  • Size: 9.2 kB
  • Tags: Python 2, Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.13.0 pkginfo/1.5.0.1 requests/2.21.0 setuptools/41.0.0 requests-toolbelt/0.9.1 tqdm/4.31.1 CPython/3.7.2

File hashes

Hashes for async_property-0.1.0-py2.py3-none-any.whl
Algorithm Hash digest
SHA256 a4905cd9217ec86c8e70a5c23281a4525455fd2aad279fc802ce35a2d25de350
MD5 b9fb32150fa394ba629724752144a296
BLAKE2b-256 3f3727444118f76941d6554675a33cbf812ff96333f359458058919003ac2ad7

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