Skip to main content

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_python_sdk

Usage

To use it you have to import it in Python with following import:

import neo_python_sdk 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',
})

Development

Some Notes about the development process of the sdk.

Lint code

To lint the code we recommend to use black (https://github.com/psf/black).

If installed you can simply run the following command from the project directory to lint your code before pushing it:

python3 -m black .

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

neo_python_sdk-0.3.15.tar.gz (3.6 kB view details)

Uploaded Source

Built Distribution

neo_python_sdk-0.3.15-py3-none-any.whl (3.8 kB view details)

Uploaded Python 3

File details

Details for the file neo_python_sdk-0.3.15.tar.gz.

File metadata

  • Download URL: neo_python_sdk-0.3.15.tar.gz
  • Upload date:
  • Size: 3.6 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

Hashes for neo_python_sdk-0.3.15.tar.gz
Algorithm Hash digest
SHA256 0ae0c77930408d40c21df6dce8a8680eb1c6503354806d10653de84f129a37ba
MD5 139c2a39112a45dd21018d41b1914cbb
BLAKE2b-256 d37a55af13e4ac07bd3e4487c716805d5f06231f045e2bbdf25c2b6bb1b3052d

See more details on using hashes here.

File details

Details for the file neo_python_sdk-0.3.15-py3-none-any.whl.

File metadata

  • Download URL: neo_python_sdk-0.3.15-py3-none-any.whl
  • Upload date:
  • Size: 3.8 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

Hashes for neo_python_sdk-0.3.15-py3-none-any.whl
Algorithm Hash digest
SHA256 780e7e2db438d28b84aad2afe4e58b40418efcebf18d1e825c3e2a5612a47389
MD5 23f668edae496a709781d029e551c01f
BLAKE2b-256 a73596ac3165623008f01ff0d1df4f5e17c4084304481ed1863e752aa5ce685c

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page