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
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file epcis_dummy_generator-0.0.2.tar.gz.
File metadata
- Download URL: epcis_dummy_generator-0.0.2.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
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
53599f4d718b6dedf640c8cb17ab11da5653ea453191f6cdb31f332cc05bb1f4
|
|
| MD5 |
0a51d437217922fca79e4c8d22c6dd06
|
|
| BLAKE2b-256 |
9f04cfafc1158c81c187f5141e9eae4d075a46051bbcbcc60e795b469d6bf0c2
|
File details
Details for the file epcis_dummy_generator-0.0.2-py3-none-any.whl.
File metadata
- Download URL: epcis_dummy_generator-0.0.2-py3-none-any.whl
- Upload date:
- Size: 5.4 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.0.1 CPython/3.13.1
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
77ad1b58d79a484386dbd6b4800e3800c802f0f210fa9c1edb74026ef4527d04
|
|
| MD5 |
41dea22fd279730db597a5ec8651c767
|
|
| BLAKE2b-256 |
f081b2fcca9e3468b87646bcab05768ec7333219b67840138970425691bbe3ea
|