Skip to main content

Client code for python Mona over Unix Domain Socket protocol

Project description

Mona's Unix Domain Socket client code

This repository contains all Mona python client for UDS code. The main package is under the dir "client", and is published to PyPi as "mona-uds-client".

The Mona UDS client requires a Mona Agent deployed locally in order to run. Other packages contain required information about how to install the Mona Agent in different environments and are published separately.

With any issues please email itai@monalabs.io.

Example use:

Example code can be found in client/mona_uds_client_test.py.

In a nutshell, after installing the PyPi package this is the common use:

from mona_uds_client import MonaUdsClient, MonaSingleMessage

# Use User ID as supplied by Mona team here.
client = MonaUdsClient("test_user")

# Use relevant context ID as defined in Mona configuration.
context_class = "MY_CONTEXT"

# Export a batch of two messages to Mona.
message1 = {"x": 1, "s": "some_str", "l": ["a"], "o": {"k": ["v1", "v2"]}
message2 = {"x": 2, "s": "another_str", "l": ["b"], "o": {"k": ["v3", "v4"]}

# Actual export
client.export(
    [
        MonaSingleMessage(
            contextId="context_id1",
            message=message1,
            arcClass=context_class,
        ),  # No export timestamp means use current time
        MonaSingleMessage(
            contextId="context_id2",
            message=message2,
            arcClass=context_class,
            exportTimestamp=1234567890
        ),
    ]
)

Uploading new version to PyPI

The main reference to follow to do that is on: https://packaging.python.org/tutorials/packaging-projects/

Prerequisites:

  1. Register on PyPI with your mona email: https://pypi.org/
  2. Ask itai@monalabs.io or nemo@monalabs.io to add you as collaborator
  3. If not installed, install twine: $ python3 -m pip install --user --upgrade twine
  4. If not installed, install build tools: $ python3 -m pip install --user --upgrade setuptools wheel

Actual upload:

  1. Change version number under setup.py
  2. If a new dependency is required, add it under setup.py under "install_requires"
  3. Build new version:
$ python3 setup.py sdist bdist_wheel
  1. Upload new version (can change '*' to actual version):
$ python -m twine upload dist/*

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

mona_uds_client-0.0.4.tar.gz (5.0 kB view details)

Uploaded Source

Built Distribution

mona_uds_client-0.0.4-py3-none-any.whl (9.9 kB view details)

Uploaded Python 3

File details

Details for the file mona_uds_client-0.0.4.tar.gz.

File metadata

  • Download URL: mona_uds_client-0.0.4.tar.gz
  • Upload date:
  • Size: 5.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.3.0 pkginfo/1.7.0 requests/2.22.0 setuptools/52.0.0 requests-toolbelt/0.9.1 tqdm/4.56.0 CPython/3.7.3

File hashes

Hashes for mona_uds_client-0.0.4.tar.gz
Algorithm Hash digest
SHA256 803ea2f918bd240829ae3a7d511576d894d1d95503f9df3f3e598f55b815c9a5
MD5 a58e7b5d177ad93015b5cc69c102fa17
BLAKE2b-256 d094e3160424136a518f74d3ef2b1596fc29e124650c75aec0ad12773e7d4083

See more details on using hashes here.

File details

Details for the file mona_uds_client-0.0.4-py3-none-any.whl.

File metadata

  • Download URL: mona_uds_client-0.0.4-py3-none-any.whl
  • Upload date:
  • Size: 9.9 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.3.0 pkginfo/1.7.0 requests/2.22.0 setuptools/52.0.0 requests-toolbelt/0.9.1 tqdm/4.56.0 CPython/3.7.3

File hashes

Hashes for mona_uds_client-0.0.4-py3-none-any.whl
Algorithm Hash digest
SHA256 24b554a2ef344e4ccb5be1dde7c311b442af97973d17f5efa097f92da3bd4fa2
MD5 c539b4feeb539c2984c6dd23fbfd661f
BLAKE2b-256 3b9782ee63ac0eedff9ce1448cf5e72d5b7c3665e6be80846b3820f5c315e99d

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