A client to Djungle Studio rulesengine API
Project description
djungle-rulesengine-client
A client to Djungle Studio rulesengine API
Tests
This project uses tox
to run the test suite:
simply run the command tox
in the root of the repository.
Release
This project uses tox
to release a version to PyPI.
Run tox -e release -- <env>
, where <env>
is an index identifier in
your ~/.pypirc
file.
Alternatively, push a tag to the main
branch to make a release
using GitHub Actions.
Usage examples
from rulesengine.async_client import AsyncEngineClient
from rulesengine.client import EngineClient
engine = EngineClient(base_url="https://example.com", token="abcde")
# To push an action to the engine:
engine.push_action(subject_id="sys-1", action="my-action", payload={"key": "value"})
# To get a pluggable prop from the engine
prop_value = engine.get_pluggable_props(subject_id="sys-1", props="my-prop")
# To make a "direct" call to the engine
return_value = engine.direct_post(
subject_id="sys-1", path="/my/path/", params={"key": "value"}, data={"my": "payload"}
)
# To push an action to the engine (async client):
async_engine = AsyncEngineClient(base_url="https://example.com", token="abcde")
await async_engine.push_action(subject_id="sys-1", action="my-action", payload={"key": "value"})
MIT License
Copyright (c) 2023 Djungle s.r.l.
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
Project details
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
File details
Details for the file djungle-rulesengine-client-0.4.0.tar.gz
.
File metadata
- Download URL: djungle-rulesengine-client-0.4.0.tar.gz
- Upload date:
- Size: 4.8 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.1 CPython/3.11.3
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | a7a827ab384dc229bd785da79eaab3d1e5852dd70d135bda6f1a2d75da134a42 |
|
MD5 | d9acb49c8c5edbc8008c947c9a10928b |
|
BLAKE2b-256 | 83766678b4248df720c555265218a21b66bedd05396b7c0452f6c00c6c53822d |
File details
Details for the file djungle_rulesengine_client-0.4.0-py3-none-any.whl
.
File metadata
- Download URL: djungle_rulesengine_client-0.4.0-py3-none-any.whl
- Upload date:
- Size: 5.1 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.1 CPython/3.11.3
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 138f2028e6291bc62e6e5676b90aa254ae759dbd9099eb2b920c207d95c11c1e |
|
MD5 | 58f01b37cf906981bfa98f3beb8a0b10 |
|
BLAKE2b-256 | 7e708e930008b5cef56d1ae0e5f5a9982e1fcd70d8b1ac1e1093d27123e4e990 |