Библиотека для управления триггерами и действиями в Python
Project description
BorisNAT-999 – умные триггеры для Python
BorisNAT-999 позволяет легко создавать триггеры и связывать с ними действия. Просто добавьте комментарий # NAT: имя_триггера в любом месте кода, зарегистрируйте функцию-обработчик через @nat_action, и вызывайте её через Boris("имя_триггера").
Установка
pip install BorisNAT-999
Пример
python import BorisNAT as bn
@bn.nat_action("hello") def say_hello(name="мир"): print(f"Привет, {name}!")
Где-то в коде: # NAT: hello
bn.Boris("hello", "Вася") # выведет "Привет, Вася!" API @nat_action(name) – декоратор для регистрации функции как действия.
Boris(name, *args, **kwargs) – активирует триггер с заданным именем.
scan_file([filepath]) – возвращает список всех имён NAT, найденных в файле.
––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––
BorisNAT-999 – smart triggers for Python
BorisNAT-999 allows you to easily create triggers and associate actions with them. Just add a comment # NAT: trigger_name anywhere in your code, register a handler function using @nat_action, and call it using Boris("trigger_name").
Installation
pip install BorisNAT-999
Example
python import BorisNAT as bn
@bn.nat_action("hello") def say_hello(name="world"): print(f"Привет, {name}!")
Somewhere in the code: # NAT: hello
bn.Boris("hello", "Вася") # will output "Привет, Вася!" API @nat_action(name) is a decorator for registering a function as an action.
Boris(name, *args, **kwargs) – activates a trigger with the specified name.
scan_file([filepath]) – returns a list of all NAT names found in the file.
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
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file borisnat_999-1.0.0.tar.gz.
File metadata
- Download URL: borisnat_999-1.0.0.tar.gz
- Upload date:
- Size: 3.7 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.14.3
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
06fe04c8314c2d438cb92aa350c0a2bfc2a7912c4e96677ed8f49e310b64b257
|
|
| MD5 |
3d9862581998bf9209bbd31730d95fc9
|
|
| BLAKE2b-256 |
76f8e64a8f54197f3be428f0c0123430a3774ed773d07f439089e4754c385798
|
File details
Details for the file borisnat_999-1.0.0-py3-none-any.whl.
File metadata
- Download URL: borisnat_999-1.0.0-py3-none-any.whl
- Upload date:
- Size: 4.2 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.14.3
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
f55cb92c8da39d48d6390465fa7546ec9b862659d6c3463065445b90b64bac35
|
|
| MD5 |
ca7cdb35eb662e0ad6802d3e60091eac
|
|
| BLAKE2b-256 |
386abd4c4f84d8398fae821fae3d4527e773f79031b97143d39791a8c36f5f6d
|