Skip to main content

Create code128 barcodes

Project description

README
======

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

useful links:
~~~~~~~~~~~~~
`Python Package Index
<https://pypi.python.org/pypi/code128/>`_

`Repository
<https://bitbucket.org/01100101/code128/overview/>`_ with latest source

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.


Features
---------
* optimal codes
* full latin-1 charset is supported
* no additional libraries needed for svg output
* output as PIL Image objects (PIL requiered)

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.

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 code128

Windows Users
~~~~~~~~~~~~~
A convenient graphical installer is provided for the final releases.


build from source
~~~~~~~~~~~~~~~~~
download the zip archive or tarball from the Download section, extract it and install with (you may need root access):

::

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


Usage
-----

with Python
~~~~~~~~~~~

.. code:: 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.

Contribution
~~~~~~~~~~~~
Use the `Issue Tracker
<https://bitbucket.org/01100101/code128/issues?status=new&status=open/>`_ on Bitbucket to report bugs, request a feature, etc.

If you want to contribute some code, feel free to create a `pull request
<https://bitbucket.org/01100101/code128/pull-requests/>`_.

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.2.zip (14.4 kB view details)

Uploaded Source

code128-0.2.tar.bz2 (7.7 kB view details)

Uploaded Source

Built Distributions

code128-0.2.win32.exe (241.4 kB view details)

Uploaded Source

code128-0.2-py3-none-any.whl (12.4 kB view details)

Uploaded Python 3

File details

Details for the file code128-0.2.zip.

File metadata

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

File hashes

Hashes for code128-0.2.zip
Algorithm Hash digest
SHA256 b4f0e215f35dedcad690903c527bbff458b2e8e89222e2d771dc837e6c671d6f
MD5 04056cdf02fe49ad87f860fcc1f10cad
BLAKE2b-256 c9bc57a34e5ad1f8dfa4b5b3296176ffe602a89dbeeab7972d1cfbd172363008

See more details on using hashes here.

File details

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

File metadata

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

File hashes

Hashes for code128-0.2.tar.bz2
Algorithm Hash digest
SHA256 1087a6a3e97916c93884f2dd46945cca1428657290d5cc60b879b2cddf128a45
MD5 10e1bffb6a9751964e784ce97111c01c
BLAKE2b-256 ce6970ff641b279d4092768ac822525e98fc9f154e8d1f79f1ca6aff683c5bd6

See more details on using hashes here.

File details

Details for the file code128-0.2.win32.exe.

File metadata

  • Download URL: code128-0.2.win32.exe
  • Upload date:
  • Size: 241.4 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No

File hashes

Hashes for code128-0.2.win32.exe
Algorithm Hash digest
SHA256 8264bf12e5b43d1c91fa12cc5f9b948f8714be4171396df70eb623eb902e77e8
MD5 40286e1af3978fd06fd894c8457bc635
BLAKE2b-256 e55470c0f24ad9ddce69a2fd78412e5f9434e326ab945331dde34378068a0c03

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for code128-0.2-py3-none-any.whl
Algorithm Hash digest
SHA256 f82b5bee599ea08a27bff0b926a589dd6d5391ade7bb41324f79a310439d1c92
MD5 800efe68e80f97e129b8e89d4b02ff6e
BLAKE2b-256 457146dcc6aa59e3ba4b5fc3fc8721671c7939f7b99d1070b091b895682b374a

See more details on using hashes here.

Supported by

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