Skip to main content

Create code128 barcodes

Project description

Overview

code128 is a simple library to create Code-128 barcodes.

License

Copyright (c) 2014-2015 Felix Knopf

This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2.1 of the License, or (at your option) any later version.

This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License in the LICENSE.txt for more details.

What’s New

0.3

Graphical User Interface

0.2

Command Line Interface; PyPI integration

Features

  • optimal codes (use code128C to encode long sequences of digits; lazy switch between Code128A and B)

  • full latin-1 charset is supported

  • no additional libraries needed for svg output

  • output as PIL Image objects (PIL requiered)

  • command line tool and gui

Setup

This is a pure python package, for this the following steps are optional. A copy of the package (folder code128 in the source archive) in your directory will also work for this specific project. The instructions below ensure that the library is available for every python module and from the command line.

Note, that some Linux Systems use python3 and pip3 to distinguish from their Python2 versions.

For Windwos users without a Python installation there is also a ‘stand-alone’ version available.

Dependencies

  • Python3 (Tested with 3.3 and 3.4, other versions should work, too)

  • setuptools to use the setup script or pip, usually preinstalled

  • optional: PIL, or compatible fork (Pillow is recommended) to save barcodes as raster graphics

Let pip do the work

$ pip install -i https://testpypi.python.org/pypi code128 --pre

Windows Users

A convenient graphical installer is provided for the final releases.

build from source

download the zip archive or tarball, extract it and install with (you may need root access):

$ python ./code128-[version]/setup.py install

Usage

with Python

import code128

code128.image("Hello World").save("Hello World.png")  # with PIL present

with open("Hello World.svg", "w") as f:
        f.write(code128.svg("Hello World"))

from shell

Code128 provides a command line interface. If you installed the library, simply type

$ code128 "Hello World" "Hello World.svg"

The packet also defines a __main__.py entry point, so

$ python ~/spam/eggs/code128 "Hello World" "Hello World.svg"

will work, too.

The GUI

$ code128w

will start the graphical mode, where you can preview your codes. This needs PIL and tkinter.

Contribution

Use the Issue Tracker on Bitbucket to report bugs, request a feature, etc.

If you want to contribute some code, feel free to create a pull request.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distributions

code128-0.3.zip (18.2 kB view details)

Uploaded Source

code128-0.3.tar.bz2 (10.2 kB view details)

Uploaded Source

Built Distributions

code128-0.3.win32.msi (213.0 kB view details)

Uploaded Source

code128-0.3-py3-none-any.whl (15.8 kB view details)

Uploaded Python 3

File details

Details for the file code128-0.3.zip.

File metadata

  • Download URL: code128-0.3.zip
  • Upload date:
  • Size: 18.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No

File hashes

Hashes for code128-0.3.zip
Algorithm Hash digest
SHA256 72e6e0b9800af07584651e6145f49ce42a8f0b1ef0ec04afcc0205ecc5d4143f
MD5 687aec18eb17b6b1a849a63644a05e94
BLAKE2b-256 ed004ac069ed6a8ae24f7395eee9882c18145abaacff9ecafa833977d927587d

See more details on using hashes here.

File details

Details for the file code128-0.3.tar.bz2.

File metadata

  • Download URL: code128-0.3.tar.bz2
  • Upload date:
  • Size: 10.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No

File hashes

Hashes for code128-0.3.tar.bz2
Algorithm Hash digest
SHA256 b9c6b7454a4c8e36c011e761eb550444876d1d6ff23efb40dc481201ccde3d14
MD5 2dd8986fa41c816d3592f7938545a524
BLAKE2b-256 6910b5128e1fef99c891476fcbfa3c7ad7144ec68403c753df0f999e91118db3

See more details on using hashes here.

File details

Details for the file code128-0.3.win32.msi.

File metadata

  • Download URL: code128-0.3.win32.msi
  • Upload date:
  • Size: 213.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No

File hashes

Hashes for code128-0.3.win32.msi
Algorithm Hash digest
SHA256 fe0b7872edb5fb370f37809b26a4287e6f501c526c8e1fb6b5ce9d0e0c4ce8c8
MD5 79d52ace6d884a910c56397d837a1ed4
BLAKE2b-256 6b1902038090aba59f296ba0f852e74c60ce5d1e3c9761059803bdea629b41b3

See more details on using hashes here.

File details

Details for the file code128-0.3-py3-none-any.whl.

File metadata

File hashes

Hashes for code128-0.3-py3-none-any.whl
Algorithm Hash digest
SHA256 226811c3344f93352ffd0f9979478f8cebd211062b9e42d37d43236cc580ef1e
MD5 c2f6894d4fd734b0c892de565ad5ecea
BLAKE2b-256 61964cd8740177d1ae8983410c0d363a35c6712d71f4adc36a7fc67c5f09a5ab

See more details on using hashes here.

Supported by

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