Skip to main content

actyon

Action with a Y! Why? Cause async is in the box.

MIT license Status Python Codecov

Latest Release Open Issues Open PRs

actyon offers an approach on a multiplexed flux pattern using coroutines (PEP 492).

Install

pip install actyon

Documentation

See Documentation

Examples

Idea

  • An actyon is defining an isolated execution run.
  • Producers are called on all combinations of input dependencies.
  • Consumers are called on all results at once.
  • Dependencies are available in any kind of structure.
  • Dependencies are injected according to function signatures.
  • Missing dependencies are ignored, unless no producer can be executed.

Implications

  • Synchronization points are
    • Start
    • Conclusion of all producers
    • End
  • Producers are called asynchronously at once
  • Consumers are called asynchronously at once
  • Typing is mandatory
  • Coroutines for producers and consumers are mandatory
  • Python 3.8+ is required

Nerd Section

Great, but who needs this?

First of all, this is an open source project for everybody to use, distribute, adjust or simply carve out whatever you need. For me it's a case study on dependency injection and coroutines, so don't expect this to be a masterpiece.

Are you serious? Python is not Java, we don't need DI.

Aside from answer N° 1, I want to make clear I'm not a java developer getting started with python. I love python and its capabilities. So making python even greater and more accessible to the people is the key to me. Maybe DI is a step towards that, maybe it's not. Still, this code may provide other developers with an idea to accomplish exactly that.

Gotcha. Why did you decide on this approach?

Once you start developing software, you want it to simplify things. That's the whole definition of a software developer by the way: we are lazy by definition. Anyway, this code shows how you can multiplex tasks and sync them on the interface level. Your tasks are executed asynchronously all together, results are gathered and in the end they are being processed further - again, asynchronously all together. The decorator functionality allows for the application of the SOLID principle, which is pretty neat:

  • Single-responsibility principle
  • Open–closed principle
  • Liskov substitution principle
  • Interface segregation principle
  • Dependency inversion principle

In this code the bottom two are quite shallow and not really applicable, but let's not get stuck with this. Another key feature of the functional interface is the simplicity. Define an action, use the decorators on whatever functions you have and just execute it. It even got a nice console output when you add hook=actyon.DisplayHook() to the Actyon's constructor. Try it out, but caution: parallel actyon execution will break the rendering.

Metadata

Release files for actyon 0.3.1

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for actyon 0.3.1
File Size Uploaded
actyon-0.3.1.tar.gz 16.6 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for actyon 0.3.1
File Interpreter ABI Platform
actyon-0.3.1-py3-none-any.whl Python 3 none any Details

Total release size: 37.1 kB

Release files / actyon-0.3.1.tar.gz

Download URL actyon-0.3.1.tar.gz
Size 16.6 kB
Tags Source
SHA-256 checksum
How to use checksums
a4a5b7aa5c383d7979856e90166d2d00e22181c22a778834fbbe4faae429423e
BLAKE2b-256 checksum
How to use checksums
fc57c55785c2c427b9ada9db07a2af6e81e5dc7e9cdf9c53643cd44f10326ef7
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/3.3.0 pkginfo/1.7.0 requests/2.25.1 setuptools/52.0.0.post20210125 requests-toolbelt/0.9.1 tqdm/4.56.2 CPython/3.8.5

Release files / actyon-0.3.1-py3-none-any.whl

Download URL actyon-0.3.1-py3-none-any.whl
Size 20.6 kB
Tags Python 3
SHA-256 checksum
How to use checksums
e9bc97c0132ef3f9d0893311652986f0796a5e23ad1dafdac1a8a2743f1bd917
BLAKE2b-256 checksum
How to use checksums
580d4d3f36bd30670e924d2bc170617fece9ca1abb7de6a7a90da05e872e0056
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/3.3.0 pkginfo/1.7.0 requests/2.25.1 setuptools/52.0.0.post20210125 requests-toolbelt/0.9.1 tqdm/4.56.2 CPython/3.8.5

Release history Release notifications | RSS feed

This release

0.3.1 This release

2 release files

0.3.0

2 release files

0.2.0

2 release files

0.1.0

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page