From e08361bdb853c29b2e64ff45ed976faa774db2e8 Mon Sep 17 00:00:00 2001 From: Sander Meinderts Date: Mon, 21 Mar 2022 12:00:53 +0100 Subject: [PATCH] Update README and increment pypi version --- README.md | 24 +++++++++++++++++++++++- README_pip.md | 1 + pyproject.toml | 2 +- 3 files changed, 25 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 3ca1c09..4b65cf1 100644 --- a/README.md +++ b/README.md @@ -2,6 +2,7 @@ [![Code style: black](https://img.shields.io/badge/code%20style-black-000000.svg)](https://github.com/psf/black) [![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://opensource.org/licenses/MIT) [![PyPI version](https://badge.fury.io/py/epcpy.svg)](https://badge.fury.io/py/epcpy) +[![PyPI - Python Version](https://img.shields.io/pypi/pyversions/epcpy.svg)](https://pypi.org/project/epcpy/) A Python module for creation, validation, and transformation of EPC representations as defined in GS1's EPC Tag Data Standard (https://www.gs1.org/standards/rfid/tds). @@ -19,6 +20,7 @@ A Python module for creation, validation, and transformation of EPC representati - [GS1Keyed](#gs1keyed) - [Tag encoded](#tag-encoded) - [Generic parsing](#generic-parsing) + - [Ignore errors](#ignore-errors) - [Development](#development) - [Testing](#testing) - [Coverage](#coverage) @@ -156,6 +158,26 @@ from epcpy import hex_to_epc hex_to_epc("36300001DB011169E5E5A70EC000000000000000000000000000") ``` +The following parsers are available: +- `base64_to_tag_encodable` +- `binary_to_tag_encodable` +- `epc_pure_identity_to_gs1_element` +- `epc_pure_identity_to_gs1_element_string` +- `epc_pure_identity_to_gs1_key` +- `epc_pure_identity_to_gs1_keyed` +- `epc_pure_identity_to_scheme` +- `epc_pure_identity_to_tag_encodable` +- `hex_to_tag_encodable` +- `tag_uri_to_tag_encodable` + +### Ignore errors +In case you want to convert a large list of EPC URIs of which some might not be valid, the function `ignore_errors` catches `ConvertException` and returns `None` instead. +```python +from epcpy import ignore_errors, epc_pure_identity_to_scheme + +ignore_errors(epc_pure_identity_to_scheme, "urn:epc:id:sgtin:0.0.0") +``` + ## Development This project uses [Poetry](https://python-poetry.org/) for project management. @@ -166,7 +188,7 @@ After cloning run `poetry install` to install (development) dependencies. This module uses the Python unittest library. Run `poetry run tests` for running the tests. ### Coverage -Run `poetry run coverage run -m unittest discover` to execute all tests with coverage. The resulting coverage can be reported using `poetry run coverage report` for a textual view the terminal and with `poetry run coverage html` for a webpage. +Run `poetry run coverage run -m unittest discover` to execute all tests with coverage. The resulting coverage can be reported using `poetry run coverage report --omit="*/test*"` for a textual view the terminal and with `poetry run coverage html --omit="*/test*"` for a webpage. ### Notebook There is a sample notebook included in this repository, which can be used to quickly get a hands-on experience with the repository. The notebook might not be completely up-to-date and requires the `jupyter` package to run, which can be installed using `pip install jupyter`. \ No newline at end of file diff --git a/README_pip.md b/README_pip.md index 61abd12..c300f40 100644 --- a/README_pip.md +++ b/README_pip.md @@ -2,6 +2,7 @@ [![Code style: black](https://img.shields.io/badge/code%20style-black-000000.svg)](https://github.com/psf/black) [![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://opensource.org/licenses/MIT) [![PyPI version](https://badge.fury.io/py/epcpy.svg)](https://badge.fury.io/py/epcpy) +[![PyPI - Python Version](https://img.shields.io/pypi/pyversions/epcpy.svg)](https://pypi.org/project/epcpy/) A Python module for creation, validation, and transformation of EPC representations as defined in GS1's EPC Tag Data Standard (https://www.gs1.org/standards/rfid/tds). diff --git a/pyproject.toml b/pyproject.toml index 84bcd06..6f0f2be 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,6 +1,6 @@ [tool.poetry] name = "epcpy" -version = "0.1.2" +version = "0.1.3" description = "A Python module for creation, validation, and transformation of EPC representations as defined in GS1's EPC Tag Data Standard." license = "MIT" authors = ["Nedap Retail "]