This project has been archived by its maintainers, and is no longer receiving any updates.
aiopluggy - A minimalist asyncio-ready plugin system
Please read the docs to learn more!
A definitive example
import aiopluggy, asyncio
hookspec = aiopluggy.HookspecMarker("myproject")
hookimpl = aiopluggy.HookimplMarker("myproject")
class MySpec(object):
"""A hook specification namespace.
"""
@hookspec
def myhook(self, arg1, arg2):
"""My special little hook that you can customize.
"""
class Plugin_1(object):
"""A hook implementation namespace.
"""
@hookimpl.asyncio
async def myhook(self, arg1, arg2):
print("inside Plugin_1.myhook()")
return arg1 + arg2
class Plugin_2(object):
"""A 2nd hook implementation namespace.
"""
@hookimpl
def myhook(self, arg1, arg2):
print("inside Plugin_2.myhook()")
return arg1 - arg2
async def main():
# create a manager and add the spec
pm = aiopluggy.PluginManager("myproject")
pm.register_specs(MySpec)
# register plugins
await pm.register(Plugin_1())
await pm.register(Plugin_2())
# call our `myhook` hook
results = await pm.hook.myhook(arg1=1, arg2=2)
print(results)
asyncio.get_event_loop.run_until_complete(main())
Metadata
Release files for aiopluggy 0.1.5rc3
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| aiopluggy-0.1.5rc3.tar.gz | 12.8 kB | Without provenance | Details for aiopluggy-0.1.5rc3.tar.gz |
Release files / aiopluggy-0.1.5rc3.tar.gz
| Download URL | aiopluggy-0.1.5rc3.tar.gz |
|---|---|
| Size | 12.8 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
b35386853c0ad32004aff7015d219d9c3d92f9a77e96aafaca8afec87e0ab141
|
|
BLAKE2b-256 checksum How to use checksums |
e1bf82d53651603f773043919d70c598db06a22b0e2d485cf43a3ec652868781
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
Security for aiopluggy 0.1.5rc3
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.