Skip to main content

A thin Python wrapper of https://github.com/gs1/gs1-barcode-engine.

Project description

GS1 Library wrapper

Documentation Status

A thin Python wrapper of https://github.com/gs1/gs1-barcode-engine.

Docs: https://gs1-barcode-engine-python-wrapper.readthedocs.io/en/latest/

Pypi: https://pypi.org/project/py-gs1-barcode-engine/

Source: https://bitbucket.org/stolmen/gs1-wrapper

Installation

pip install py-gs1-barcode-engine

Example usage

import py_gs1_barcode_engine

INCHES_PER_MM = 0.0393701
dpi = 157.35
module_x_dim_mm = 7
module_x_dim_inches = module_x_dim_mm * INCHES_PER_MM

bmp_data = py_gs1_barcode_engine.generate_gs1_datamatrix(
    "(01)94210325403182(30)2(3922)0460(93)TQ",
    dm_rows=22,
    dm_cols=22,
    x_undercut=0,
    y_undercut=0,
    scaling={"resolution": dpi, "target_x_dim": module_x_dim_inches},
)

with open("barcode.bmp", "wb") as f:
    f.write(bmp_data)
        

Running tests

pip install -r requirements.txt
python compile_and_test_lib.py
pytest

Packaging

To package this project, run:

python -m build

To package and upload a new version of this, update the version numnber in pyproject.toml, then run

./build_and_publish.sh

Note that only an sdist distribution is built and uploaded. No wheel is uploaded.

Output is coped into the dist/ folder.

License

Copyright (c) 2022 Edward Ong

Copyright (c) 2000-2021 GS1 AISBL

Licensed under the Apache License, Version 2.0 (the "License"); you may not use this library except in compliance with the License.

You may obtain a copy of the License at:

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.

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

py_gs1_barcode_engine-0.0.14.tar.gz (229.9 kB view details)

Uploaded Source

File details

Details for the file py_gs1_barcode_engine-0.0.14.tar.gz.

File metadata

  • Download URL: py_gs1_barcode_engine-0.0.14.tar.gz
  • Upload date:
  • Size: 229.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.1 CPython/3.8.12

File hashes

Hashes for py_gs1_barcode_engine-0.0.14.tar.gz
Algorithm Hash digest
SHA256 f21cfd685d2f16ac1b3622d44768e34044a86ed98a9e76e93b86208b183090a8
MD5 2936db7a5eb9e417899f35348f94f825
BLAKE2b-256 507f0f369ea4b86ce4f83c402d5fbabf560ce2f41179f01c8933bd59e7eb18e9

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