semvec/pypi-packages huggingface dataset:
mona-uds-client 0.0.8
Client code for python Mona over Unix Domain Socket protocol
Requires Python: >=3.7

# 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:
$ pip install mona_uds_client

This is the common use:

```
from mona_uds_client.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
        ),
    ]
)
```

# Deployment
The UDS client uses a local folder to communicate with Mona UDS agent. 
As a result, when deployed on a container, the following mounts are required to be added to the container's YAML:

In spec.template.spec:
```
volumes:
- name: uds-mona-socket
  hostPath:
    path: /var/run/mona-agent/
```
In spec.template.spec.container:
```
volumeMounts:
- mountPath: /uds/mona
  name: uds-mona-socket
```

## 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
```
4. Upload new version (can change '*' to actual version):
```
$ python -m twine upload dist/*
```
pdf417decoder 1.0.8
A PDF417 barcode decoder
Requires Python: >=3.7

# pdf417decoder
![Image of a PDF417 barcode](https://raw.githubusercontent.com/sparkfish/pdf417decoder/dev/python/images/haiku.png?id=1)

pdf417decoder is a pure Python library for decoding [PDF417 barcodes](https://en.wikipedia.org/wiki/PDF417).

Reader is capable of Error Detection and Correction according to the standards for PDF417 which you can read about here [ISO/IEC 15438:2006](https://www.iso.org/standard/43816.html) or download an older version of the PDF [this website](https://www.expresscorp.com/public/uploads/specifications/44/USS-PDF-417.pdf).

## Installation

Use the package manager [pip](https://pip.pypa.io/en/stable/) to install pdf417decoder.

```bash
pip install pdf417decoder
```

## Usage

```python
from PIL import Image as PIL
from pdf417decoder import PDF417Decoder

image = PIL.open("barcode.png")
decoder = PDF417Decoder(image)

if (decoder.decode() > 0):
    decoded = decoder.barcode_data_index_to_string(0)
```

## Testing Results

This library was tested using [pdf417gen](https://pypi.org/project/pdf417gen/) to create random barcodes and blurred with [OpenCV](https://pypi.org/project/opencv-python/) to test error correction. PyTest is used with several test images to show the libraries capability to decode barcodes in the following test cases.

* Binary data
* Multiple barcodes
* Upside down barcode
* Rotated barcode
* Error Corrections: Corrupted data due to blurred barcode
* Error Corrections: Missing data due marks concealing barcode
* Character type transitions (Upper, Lower, Mixed and Punctuation)

## Contributing
Pull requests are welcome. For major changes, please open an issue first to discuss what you would like to change.

## License
[CPOL](https://www.codeproject.com/info/cpol10.aspx)

This project is a derivative of code licensed under the Code Project Open License (CPOL). The Code Project Open License (CPOL) is intended to provide developers who choose to share their code with a license that protects them and provides users of their code with a clear statement regarding how the code can be used.

## Credits

 Source code is a port of a C# Library created and maintained by [Uzi Granot](https://www.codeproject.com/script/Membership/View.aspx?mid=193217). [PDF417 Barcode Decoder .NET Class Library and Two Demo Apps](https://www.codeproject.com/Articles/4042463/PDF417-Barcode-Decoder-NET-Class-Library-and-Two-D)