skillfed

async-property

Python decorator for async properties.

async-property v0.2.2 6.0M downloads/30d#1,981 on PyPI98
Permissive license MIT license Active released

What it is and what it does

async_property is a lightweight decorator library that brings async/await semantics to Python class properties. It lets you define async functions as properties using @async_property (which returns an awaitable each time) or @async_cached_property (which caches the result after the first await). For classes with multiple cached async properties, you can subclass AwaitLoader to make instances awaitable, which will load all cached properties concurrently and optionally call an async load() hook first.

The package solves the problem of accessing remote data or expensive async operations through a clean property interface instead of explicit method calls. It uses asyncio.Lock internally to ensure cached functions are called only once even under concurrent access. With no runtime dependencies and support for Python 3.7 through 3.11, it integrates easily into existing async codebases.

Use it for:

  • Define a class property that fetches data from a remote API or database without explicit method calls.
  • Cache the result of an expensive async operation so it's computed once and reused across multiple accesses.
  • Initialize multiple async resources concurrently when instantiating a class by subclassing AwaitLoader.
  • Build async context objects where properties lazily load remote state on first access.
  • Simplify async initialization patterns in frameworks that expect property-like access patterns.

Worth the install?

AI-flagged interpretation of the facts on this page — verify before relying

Provides Python decorators (@async_property and @async_cached_property) that let you define async functions as class properties, with optional caching and concurrent initialization via AwaitLoader.

Yes. The package is lightweight, actively maintained, has no dependencies, and solves a real problem in async Python code. The MIT license is permissive. Use it when you need async properties in your class design and want to avoid explicit method calls or manual caching logic.

Install

async-property on PyPI

pip

pip install async-property

uv

uv add async-property

poetry

poetry add async-property

Installing async-property

Before you install

Low friction install with no runtime dependencies. Actively maintained; last commit 2026-04-16 with 98 repository stars. Python 3.7+ supported.

License in practice

MIT license (permissive); you can use this freely in commercial and open-source projects with minimal restrictions.

Quickstart

pip install async-property

from async_property import async_property

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

instance = Foo()
await instance.remote_value

Verify before relying

  • Whether AwaitLoader's concurrent loading behavior scales well with many properties or if there are practical limits.
  • Performance characteristics of the asyncio.Lock mechanism under high concurrency.
  • Whether cached properties properly handle exceptions on first call and subsequent retries.

Package facts

License MIT license (permissive)
Python support not specified
Install friction low — pure-Python wheel
Runtime dependencies none
Maintenance actively maintained — 1,138 days since the last release
Last repo commit
First released
Downloads 6,032,066/month — #1,981 on PyPI (30-day window, as of 2026-08-14)
Known vulnerabilities none known (OSV.dev, checked 2026-08-14)

Evidence: async_property-0.2.2-py2.py3-none-any.whl

Keywords: async_property

Development Status :: 4 - BetaIntended Audience :: DevelopersLicense :: OSI Approved :: MIT LicenseNatural Language :: EnglishProgramming Language :: Python :: 3Programming Language :: Python :: 3.10Programming Language :: Python :: 3.11Programming Language :: Python :: 3.7Programming Language :: Python :: 3.8Programming Language :: Python :: 3.9Topic :: Software DevelopmentTopic :: Utilities

Tags

async property decoratorpython async propertiescached async propertiesasync class propertiesasyncio property decoratorconcurrent property loading
async-awaitdecoratorscaching

More Software Development packages