Skip to main content

A package for testing with EPCIS data.

Project description

Important Notes

This project is still in development, and the idea is to make my job as a QA engineer automating tests related to EPCIS easier. I figured if I need this, someone else might need as well. This is my first Python package, any problems, doubts or suggestions, either comment on the Github repository, or send me an email.

Companies

EPCIS data related to companies.

Generate Company Prefix

generate_company_prefix(length: int)

Randomly generates a company prefix (str) with a length that varies from 6 to 12, 7 is default.

Items

EPCIS data related to items.

Generate GTIN

generate_gtin(company_prefix: str, company_prefix_length: int)

Randomly generates a GTIN (str) with a length of 14. You must either inform company_prefix or company_prefix_length, if only company_prefix_length is informed, it generates a company_prefix with the generate_company_prefix function before generating the GTIN. Then, it generates the check digit.

Get Company Prefix and GS1 ID from GTIN

get_company_prefix_and_gs1_id_from_gtin(gtin: str, company_prefix_length: int)

Reads the GTIN (str) and returns a dictionary with the following template:

{
    "gs1_id": <gs1_id>,
    "company_prefix": <company_prefix>
}

You must inform both gtin and company_prefix_length.

Generate SGTIN

generate_sgtin(serial: str, gtin=None, company_prefix=None, company_prefix_length=None)

Generates an SGTIN based on serial informed and gtin and company_prefix informed. If no gtin is informed, it generates one with the generate_gtin function, using either the company_prefix. If only company_prefix_length is informed it generates company_prefix with the function generate_company_prefix.

Locations

EPCIS data related to locations.

Generate GLN

generate_gln(company_prefix: str, company_prefix_length: int)

Randomly generates a GLN (str) with a length of 13. You must either inform company_prefix or company_prefix_length, if only company_prefix_length is informed, it generates a company_prefix with the generate_company_prefix function before generating the GLN. Then, it generates the check digit.

Generate SGLN

generate_sgln(serial: str, gln=None, company_prefix=None, company_prefix_length=None)

Generates an SGLN based on serial informed and gln and company_prefix informed. If no gln is informed, it generates one with the generate_gln function, using either the company_prefix. If only company_prefix_length is informed it generates company_prefix with the function generate_company_prefix.

Utils

Functions unrelated to EPCIS, but which are used by EPCIS-related functions.

Generate X Length Number

generate_x_length_number(x: int)

Generates a string made of X digits. Used to randomly generate Company Prefixes and GS1 IDs.

Calculate Check Digit

calculate_check_digit(base: str)

Calculates check digit based on Modulo 10 rule, using the base, a string made entirely of digits.

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

epcis_dummy_generator-0.0.1.tar.gz (5.0 kB view details)

Uploaded Source

Built Distribution

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

epcis_dummy_generator-0.0.1-py3-none-any.whl (5.5 kB view details)

Uploaded Python 3

File details

Details for the file epcis_dummy_generator-0.0.1.tar.gz.

File metadata

  • Download URL: epcis_dummy_generator-0.0.1.tar.gz
  • Upload date:
  • Size: 5.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.0.1 CPython/3.13.1

File hashes

Hashes for epcis_dummy_generator-0.0.1.tar.gz
Algorithm Hash digest
SHA256 032ea33fc2bfee65f0fb1ca786bba8272f55133302d00ff8313a9daf03cbe6b5
MD5 fe17d37ecb3fa52cfccb093dc270b0dc
BLAKE2b-256 d5a51665a44beb5d3183e87427c24141e25f7966aea657be6bf7a3acd32a6b3e

See more details on using hashes here.

File details

Details for the file epcis_dummy_generator-0.0.1-py3-none-any.whl.

File metadata

File hashes

Hashes for epcis_dummy_generator-0.0.1-py3-none-any.whl
Algorithm Hash digest
SHA256 ff6470fb94ea08617c9dab4630081cb0fba6cf715b81ad8acc7ac115573603a7
MD5 37c00a341fc2564a0cd9c6591b6b7516
BLAKE2b-256 d287cf1e00bb48bd4eec9438c8e979698bb6f53a318221319561165f36ccc65a

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