Skip to main content
Pre-release

This release is a pre-release and may not be stable for production use.

Overview

kode256 is a simple library to create Code-128 barcodes. It is a fork of the abandoned code128 package.

License

Copyright (c) 2016-2020 Brendan Howell

Copyright (c) 2014-2016 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.

The font used for the captions is ‘Inconsolata’ by Raph Levien, licensed under the SIL Open Font License. See OFL.txt for more details.

What’s New

0.4b1

  • Viewbox for svg

  • Captions

0.3

Graphical User Interface

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)

  • optional captions under the barcode with human-readable representation of it.

  • 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 kode256 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 kode256 --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 kode256

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

with open("Hello World.svg", "w") as f:
        f.write(kode256.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/kode256 "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 GitLab to report bugs, request a feature, etc.

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

Release files for kode256 0.4b1

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for kode256 0.4b1
File Size Uploaded
kode256-0.4b1.zip 71.3 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for kode256 0.4b1
File Interpreter ABI Platform
kode256-0.4b1-py2.py3-none-any.whl Python 3, Python 2 none any Details

Total release size: 146.2 kB

Release files / kode256-0.4b1.zip

Download URL kode256-0.4b1.zip
Size 71.3 kB
Tags Source
SHA-256 checksum
How to use checksums
1111644d93ddbc1f05d5cdf9d01d4ccafa746a58c4f67e32274e6770e0f53c4a
BLAKE2b-256 checksum
How to use checksums
e3d5e9c2b1cbb93810e4f61947a68525b2b658dc7827a3113655bd7a1d756bce
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/3.1.1 pkginfo/1.5.0.1 requests/2.22.0 setuptools/41.2.0 requests-toolbelt/0.9.1 tqdm/4.42.0 CPython/3.8.1

Release files / kode256-0.4b1-py2.py3-none-any.whl

Download URL kode256-0.4b1-py2.py3-none-any.whl
Size 75.0 kB
Tags Python 2 Python 3
SHA-256 checksum
How to use checksums
976569782f8f5169327f551ad36784b2bf81c7d0ef4e26f3c401ef6e423c23e2
BLAKE2b-256 checksum
How to use checksums
7af1b4ed73cc7ad2037f05c5574e714ed1e43bb466625ed5d8611db0b2023aee
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/3.1.1 pkginfo/1.5.0.1 requests/2.22.0 setuptools/41.2.0 requests-toolbelt/0.9.1 tqdm/4.42.0 CPython/3.8.1

Release history Release notifications | RSS feed

This release

0.4b1 This release

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page