Getting Started

Getting Started with Aspose.BarCode FOSS for Python

Welcome to Aspose.BarCode FOSS for Python, a free, MIT-licensed library for generating standards-compliant 1D and 2D barcodes in pure Python. This guide takes you from a fresh environment to a working barcode in a few minutes.


Prerequisites

RequirementDetail
Python version3.12 or later
Package managerpip (bundled with CPython)
Operating systemWindows, macOS, Linux
Compiler / build toolsNone required
System packagesNone required

Installation

Install from PyPI using pip:

pip install aspose-barcode-foss

See the Installation Guide for virtual-environment setup, verification steps, and a quick-start code example.


What You Can Do with Aspose.BarCode FOSS for Python

Once installed, you can immediately:

  • Generate Code 128, Code 39, EAN-13, EAN-8, QR Code, UPC-A, and UPC-E barcodes
  • Render barcodes to SVG and PNG output formats
  • Configure per-symbology encode options (encode modes, error correction levels, check digits)
  • Control rendering with scale, DPI, colors, quiet zone, and text display options
  • Validate input with typed exceptions (InvalidInputError, EncodingError) before encoding begins

Quick Start

The following code generates a Code 128 barcode and writes it as an SVG file:

import aspose_barcode_foss as barcode

bc = barcode.code128("Hello World")
svg = bc.to_svg()

with open("barcode.svg", "w") as f:
    f.write(svg)

Next Steps

  • Installation Guide: Virtual environment setup, pip install, and verification
  • Quickstart: First working barcode with encode and render options
  • Developer Guide: Per-symbology encode options, rendering controls, and code examples

See Also

 English