Skip to main content

EPCIS Python module for quickly developing EPCIS-enabled applications.

Project description

EPCPYYes

https://gitlab.com/serial-lab/EPCPyYes/badges/master/coverage.svg https://gitlab.com/serial-lab/EPCPyYes/badges/master/build.svg https://badge.fury.io/py/EPCPyYes.svg
8888888888 8888888b.   .d8888b.  8888888b.        Y88b   d88P
888        888   Y88b d88P  Y88b 888   Y88b        Y88b d88P
888        888    888 888    888 888    888         Y88o88P
8888888    888   d88P 888        888   d88P 888  888 Y888P  .d88b.  .d8888b
888        8888888P"  888        8888888P"  888  888  888  d8P  Y8b 88K
888        888        888    888 888        888  888  888  88888888 "Y8888b.
888        888        Y88b  d88P 888        Y88b 888  888  Y8b.          X88
8888888888 888         "Y8888P"  888         "Y88888  888   "Y8888   88888P'
                                                 888
                                            Y8b d88P
                                             "Y88P"

Pronounced “EPC-Pie-Yes”: Open source components for the GS1 EPCIS standard

The main purpose of this library is to allow developers to quickly build systems that parse, generate and store EPCIS data quickly and efficiently with a clear and straight-forward pythonic API.

# Python to EPCIS XML or JSON Work with python classes that take the pain out of knowing the EPCIS protocol. Each class in the EPCPyYes package can be directly manipulated in python and then quickly rendered to EPCIS 1.2 compliant XML or JSON for any number of purposes. For example:

# for example, create an ObjectEvent
oe = ObjectEvent(now, tzoffset,
                 record_time=now,
                 action=Action.add.value,
                 epc_list=epcs,
                 biz_step=BusinessSteps.commissioning.value,
                 disposition=Disposition.encoded.value)

# Create EPCIS 1.2 compliant XML
print(oe.render())

# Render as JSON
print(oe.render_json())

# Render as pretty printed JSON
print(oe.render_pretty_json()

Fully Tested

See our code-coverage and continuous integration builds for the coverage build artifacts and build/test results. You can download the code coverage build artifacts on the Pipelines Page. by clicking on the download button to the right of the build you are interested in.

Fully Documented

The documentation to the EPCPyYes module can be found here:

https://serial-lab.gitlab.io/EPCPyYes/index.html

Jupyter Notebook:

The Jupyter notebook with running example code is included in the documentation and can be found here:

https://gitlab.com/serial-lab/EPCPyYes/blob/master/docs/events.ipynb

If you don’t have a notebook, you can view the Jupyter example documentation here: https://gitlab.com/serial-lab/EPCPyYes/blob/master/docs/events.md

Jinja2 Templates for Creating and Transforming EPCIS Docs and Events

The templates package contains Jinja2 templates for generating EPCIS documents from either discrete EPCIS classes defined in the core package or from collections of those classes- which allow for the creation of EPCISDocuments with multiple types of events. You can change the default behavior of any EPCIS class in the framework by passing in a different Jinja2 template when initializing the class- allowing EPCIS objects to be rendered into just about any native or custom format imaginable. Modifying the default Jinja2 environment can allow the entire package to utilize a different set of default templates altogether.

Core Classes

The core library consists of Python classes representing the key EPCIS events:

  • EPCISEvent

  • ObjectEvent

  • AggregationEvent

  • TransactionEvent

  • TransformationEvent

    Quantity events, as they are being deprecated, are not supported right now If you’re interested in helping out with this please contact us.

Each of the classes in the core library are used throughout the package but can be useful to developers in building other applications outside of the scope of this package.

Helpers

Utilities that help you:

  • Quickly generate lists of SGTIN or SSCC URN values by a range of serial numbers.

  • Quickly serialize python EPCIS classes into valid EPCIS XML and back.

  • …and More.

CBV 1.2 Type Support and Utilities

Utilities that help with the generation of CBV compliant data and also give you code completion while developing CBV compliant EPCIS apps. We took out all the fishery stuff since there are only so many hours in the day. If anyone is interested in adding and/or supporting it please contact us.

For example:

from EPCPyYes.core.v1_2.CBV.dispositions import Disposition
print(Disposition.commissioning.value)
urn:epcglobal:cbv:bizstep:commissioning

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

EPCPyYes-1.2.0.tar.gz (75.4 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

EPCPyYes-1.2.0-py3-none-any.whl (89.3 kB view details)

Uploaded Python 3

File details

Details for the file EPCPyYes-1.2.0.tar.gz.

File metadata

  • Download URL: EPCPyYes-1.2.0.tar.gz
  • Upload date:
  • Size: 75.4 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No

File hashes

Hashes for EPCPyYes-1.2.0.tar.gz
Algorithm Hash digest
SHA256 6be523f015fe97f4114e2c7750b059e7c280ef2f3a5133996336311fd3eef24d
MD5 6ba401a3a6b4e4d835e1784da74add5c
BLAKE2b-256 dad5ccc17e1ae240fb47860086cca34f13ffc740bdcc7f0cdff52faab9f67ea8

See more details on using hashes here.

File details

Details for the file EPCPyYes-1.2.0-py3-none-any.whl.

File metadata

File hashes

Hashes for EPCPyYes-1.2.0-py3-none-any.whl
Algorithm Hash digest
SHA256 819255f797c6638ff7933e5424c98eaf48f18e7d49b2916df5cfa5049b9c4da9
MD5 1537bca128491f3b62fae01383d20465
BLAKE2b-256 16ea113079ebeed528394c7ffd8d640d501a64a43a57b0f494be6dc9b529f0c5

See more details on using hashes here.

Supported by

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