Neo SDK for Python with some additional libraries to support the development of Neo Sentinels (NSX).
Project description
Neo Python SDK
Installation
pip install neo_node
Usage
To use it you have to import it in Python with following import:
import neo-python as Neo
Example
# processing tasks requires a queue name
# the request object will be passed to the provided processor (a function)
# the "processor" should use async / await
async def start_neo_tasks(loop):
neo = Neo.NeoNatsClient()
await neo.connect(loop=loop)
async def process_request(payload):
res = f'Hi there, {payload['user']}'
return res
await neo.process("nsx.dev.example.sayHello", process_request)
if __name__ == '__main__':
loop = asyncio.get_event_loop()
loop.run_until_complete(start_neo_tasks(loop))
loop.run_forever()
# the task / message can contain anything
# for best compatibility it should be a particle
neo = Neo.NeoNatsClient()
await neo.connect(loop=loop)
neo.create('nsx.dev.example.sayHello', {
user: 'John',
})
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
neo-python-sdk-0.3.6.tar.gz
(3.3 kB
view details)
Built Distribution
File details
Details for the file neo-python-sdk-0.3.6.tar.gz
.
File metadata
- Download URL: neo-python-sdk-0.3.6.tar.gz
- Upload date:
- Size: 3.3 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.4.1 importlib_metadata/3.7.3 pkginfo/1.7.0 requests/2.25.1 requests-toolbelt/0.9.1 tqdm/4.59.0 CPython/3.9.2
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 8c13376edfe1c631919dda94b4e0dd83435262d599f2b5e0302118281eb79839 |
|
MD5 | cd7a076efb2deb96555fc39669789bf5 |
|
BLAKE2b-256 | 08d67cedf704b4e4929ca8d7425779dde9366ced675b041833f7b850d5f6171b |
File details
Details for the file neo_python_sdk-0.3.6-py3-none-any.whl
.
File metadata
- Download URL: neo_python_sdk-0.3.6-py3-none-any.whl
- Upload date:
- Size: 3.6 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.4.1 importlib_metadata/3.7.3 pkginfo/1.7.0 requests/2.25.1 requests-toolbelt/0.9.1 tqdm/4.59.0 CPython/3.9.2
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 6395fb9a8048dd002323abd2ef0d98c3842e8802328aa0b8b58143577927453c |
|
MD5 | 13a58c8891ac0874c269917ca114bd45 |
|
BLAKE2b-256 | 3b816eb6750803344f28a5587baa7b981a04706e30a9566daadd15fb98386117 |