EPC Encoding Utils
pip install epc-encoding-utils
Library for encoding/decoding and representing GS1 Electronic Product Codes (EPCs). It supports the following encoding schemes:
- GIAI
- GID
- GRAI
- SGLN
- SGTIN
The library's goal is to abstract away much of the complexity of converting between tag representations, and make generating tags and barcodes simple.
Docs
https://epcpy-tools.readthedocs.io/en/latest/index.html
Examples
Create a new GID encoded tag
>>> from epc.schemes import GID
>>> tag = GID()
>>> tag.manager_number(31231).object_class(11).serial_number(12)
<epc.schemes.GID urn:epc:id:gid:31231.11.12>
>>> hex(tag)
'0x3500079ff00000b00000000c'
>>> tag.tag_uri
'urn:epc:tag:gid-96:31231.11.12'
Generate GIAI barcode from/to a hexadecimal tag data representation
>>> from epc.schemes import GIAI
>>> tag = GIAI(epc='0x341401388000000000000001')
>>> tag.barcode
'800400200001'
>>> tag.barcode_humanized
'(8004) 0020000 1'
>>> tag = GIAI(barcode='800400200001', company_prefix_length=7)
>>> hex(tag)
'0x341401388000000000000001'
Decode an EPC data tag with unknown encoding
>>> from epc.utils import decode_epc
>>> tag = decode_epc('341401388000000000000001') # '0x' prefix is optional
>>> print(tag)
<epc.schemes.GIAI urn:epc:id:giai:0020000.1>
This library was built based on the Tag Data Standard v1.11.
Running Tests
python -m unittest discover -s epc/schemes/tests
Metadata
Release files for epc-encoding-utils 1.3
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| epc-encoding-utils-1.3.tar.gz | 19.1 kB | Without provenance | Details for epc-encoding-utils-1.3.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| epc_encoding_utils-1.3-py3-none-any.whl | Python 3 | none | any | Details for epc_encoding_utils-1.3-py3-none-any.whl |
Total release size: 50.4 kB
Release files / epc-encoding-utils-1.3.tar.gz
| Download URL | epc-encoding-utils-1.3.tar.gz |
|---|---|
| Size | 19.1 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
57475b30797ae77a884e5fb967532bc6867e9e0fc8bf0f60e8c3767fac2b17b1
|
|
BLAKE2b-256 checksum How to use checksums |
1621156825810ac75c130d1d2fc25e568b92dce90638bb20932b39af9d3d2815
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/3.2.0 pkginfo/1.5.0.1 requests/2.24.0 setuptools/50.2.0 requests-toolbelt/0.9.1 tqdm/4.48.2 CPython/3.8.3
|
Release files / epc_encoding_utils-1.3-py3-none-any.whl
| Download URL | epc_encoding_utils-1.3-py3-none-any.whl |
|---|---|
| Size | 31.3 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
6ea7000ba96e6328cb39ce86677952c0d99da760bac6f7fcb0f8757c60645f56
|
|
BLAKE2b-256 checksum How to use checksums |
25a49a0aa52e8eec531a0957c7054a55c9ff4cfaa7c527b3f75dd771b7e89691
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/3.2.0 pkginfo/1.5.0.1 requests/2.24.0 setuptools/50.2.0 requests-toolbelt/0.9.1 tqdm/4.48.2 CPython/3.8.3
|
Security for epc-encoding-utils 1.3
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.