notitia core runtime & modules
Project description
Notitia core - pluggable payload procesing - everything is famous.. sort of..
import motor.motor_asyncio
from bstk_notitia import Notitia
# An Investigator looks for and specialises in dealing with particular types of cases
# Observers watch for information that may or may not be useful to an investigator
# Informants provide new or supporting information upon request by the investigator
# Reporters are used by the investigator to disseminate information and receive feedback
# Only certain cases get investigated
# The investigator decides what cases to take
# Each case must run to completion, even if completion means new cases are created
motor_client = motor.motor_tornado.AsyncIOMotorClient(host=['localhost:27017'])
notitia = Notita(
department="08e32fd8-9259-4a3e-891a-bc39b7c8ef22", # [str | None] - for tenancy isolation
)
notitia.set_driver(
driver="mongodb"
driver_settings={
"async_client": motor_client,
"database": 'myappdb',
"collection_prefix": "bn_",
"archive_suffix": "_arch",
"completion_action": "immoliate",
},
)
notitia.enlist(investigator="portaone/espf")
espf_payload = {
"event-type": "Test/Event",
"variables": {
"i_event": 1,
"i_account": 999
}
}
# A valid case
try:
case = await notitia.dispatch(
observer="portaone/espf",
information=espf_payload,
completion_action="archive". # [archive | immoliate | None]
)
print(f"Tracking case as {case.number}")
except NotitiaInvalidCasePayloadException as ex:
print(f"Invalid Payload: {ex.message}")
async for movement in notitia.spy(case):
print(f"Case moved {movement.id}")
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
bstk_notitia-0.6.4.tar.gz
(23.2 kB
view hashes)
Built Distribution
Close
Hashes for bstk_notitia-0.6.4-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | b45aa79604ed42546b1be2d871391cceba291cac5664832063e371fa9e45b351 |
|
MD5 | e8681bc4d9d745245984466df3515360 |
|
BLAKE2b-256 | 82e2c6278587bb579c8a4a8b5e173c91f435b9be027224064b06304f21e0a251 |