Skip to main content

Python library for bar code generation.

Project description

# steenzout.barcode

[![Build Status](](
[![Code Health](](
[![Coverage Status](](
[![Requirements Status](](
[![Documentation Status](](

[![Project Stats](](

This repository is a fork of:
- [viivakoodi][viivakoodi]
- [pyBarcode][pyBarcode]

This library provides the ability to create bar codes.

The bar codes are created as SVG objects.

## Installation

$ pip install steenzout.barcode

## Bar codes

- EAN-8
- EAN-13
- ISBN-10
- ISBN-13
- Code 39
- Code 128

## Usage

>>> from steenzout import barcode
[u'code39', u'code128', u'ean', u'ean13', u'ean8', u'gs1', u'gtin',
u'isbn', u'isbn10', u'isbn13', u'issn', u'jan', u'pzn', u'upc', u'upca']
>>> EAN = barcode.get_barcode_class('ean13')
>>> EAN
<class 'barcode.ean.EuropeanArticleNumber13'>
>>> ean = EAN(u'5901234123457')
>>> ean
<barcode.ean.EuropeanArticleNumber13 object at 0x00BE98F0>
>>> fullname ='ean13_barcode')
>>> fullname
# Example with PNG
>>> from barcode.writer import ImageWriter
>>> ean = EAN(u'5901234123457', writer=ImageWriter())
>>> fullname ='ean13_barcode')
# New in v0.4.2
>>> from StringIO import StringIO
>>> fp = StringIO()
>>> ean.write(fp)
# or
>>> f = open('/my/new/file', 'wb')
>>> ean.write(f) # PIL (ImageWriter) produces RAW format here
# New in v0.5.0
>>> from barcode import generate
>>> name = generate('EAN13', u'5901234123457', output='barcode_svg')
>>> name
# with file like object
>>> fp = StringIO()
>>> generate('EAN13', u'5901234123457', writer=ImageWriter(), output=fp)

Now open ean13_barcode
[svg|png] in a graphic app or simply in your browser and
see the created barcode. That's it.

## Commandline

$ pybarcode{2,3} create "My Text" outfile
New barcode saved as outfile.svg.

$ pybarcode{2,3} create -t png "My Text" outfile
New barcode saved as outfile.png.

Try `pybarcode -h` for help.

## Links

- [Code 39](
- [Code 128](
- [EAN](
- [ISBN](
- [ISSN](
- [JAN](
- [UPC](

[license]: "MIT license"
[pyBarcode]: "barcode"
[viivakoodi]: "viivakoodi"

Project details

Download files

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

Files for steenzout.barcode, version 1.0.0b4
Filename, size File type Python version Upload date Hashes
Filename, size steenzout.barcode-1.0.0b4.tar.gz (210.0 kB) File type Source Python version None Upload date Hashes View

Supported by

AWS AWS Cloud computing Datadog Datadog Monitoring Facebook / Instagram Facebook / Instagram PSF Sponsor Fastly Fastly CDN Google Google Object Storage and Download Analytics Huawei Huawei PSF Sponsor Microsoft Microsoft PSF Sponsor NVIDIA NVIDIA PSF Sponsor Pingdom Pingdom Monitoring Salesforce Salesforce PSF Sponsor Sentry Sentry Error logging StatusPage StatusPage Status page