Skip to main content

Brbillcode

brbillcode is a Python library for extracting and validating data from Brazilian payment slips ("boletos") — including both bank boletos and collection boletos (such as utilities like electricity and water). It supports parsing from both barcode strings and digitable lines, providing detailed structured information and validation based on Brazilian standards.

Features

  • Parse bank boletos and collection boletos from:
    • Digitable lines (47 or 48 digits)
    • Barcodes (44 digits)
  • Extract detailed information such as:
    • Bank/collection identifiers
    • Currency code
    • Expiration date calculation
    • Payment amount
    • Verification digits with modulus 10 and modulus 11 algorithms
  • Validate boletos with correct check digit verification
  • Convert collection boleto digitable lines to barcodes and vice versa
  • Supports different modulus 11 variants used in bank and collection boletos

Installation

pip install brbillcode

(Note: adjust if publishing to PyPI or installing locally.)

Usage

from brbillcode.core.line import Line

# Example digitable line for a bank boleto
line_code = "00190500954014481606906809350314337370000000100"

line = Line(line_code)

print("Barcode:", line.get_bar())
print("Digitable line (formatted):", line.get_line(formatted=True))
print("Is valid?", line.validate())
print("Extracted info:", line.get_code_info())

Supports both bank and collection boletos; the library automatically detects the boleto type based on input length and format.

Supported Code Types

Code Length Type
44 digits Barcode
47 digits Bank boleto line
48 digits Collection boleto line

Module Overview

  • core/line.py: Main class Line to abstract boleto parsing and delegate to bank or collection boleto handlers.
  • models/bank.py: Handles bank boleto parsing, info extraction, validation.
  • models/collection.py: Handles collection boleto parsing, info extraction, validation.
  • utils/modules.py: Implements modulo 10 and modulo 11 algorithms used for check digits.

License

MIT License


References

  • Brazilian "boleto" specifications and standards.
  • Modulus 10 and modulus 11 algorithms for check digits.

Metadata

Release files for brbillcode 0.1.1

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

Source distribution (sdist)

Source distribution for brbillcode 0.1.1
File Size Uploaded Provenance Actions
brbillcode-0.1.1.tar.gz 4.6 kB Without provenance Details for brbillcode-0.1.1.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for brbillcode 0.1.1
File Interpreter ABI Platform Actions
brbillcode-0.1.1-py3-none-any.whl Python 3 none any Details for brbillcode-0.1.1-py3-none-any.whl

Total release size: 11.3 kB

Release files / brbillcode-0.1.1.tar.gz

Download URL brbillcode-0.1.1.tar.gz
Size 4.6 kB
Tags Source
SHA-256 checksum
How to use checksums
65afd52337c165817cf21b6e9fd9a702d657f5235be2b33b2035ae404e3c3a83
BLAKE2b-256 checksum
How to use checksums
c61722a18daede74770bb92b3e7a6b595e315dd3cdbe70ededc24daa2278abd9
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via poetry/2.1.3 CPython/3.11.2 Linux/6.1.0-37-amd64

Release files / brbillcode-0.1.1-py3-none-any.whl

Download URL brbillcode-0.1.1-py3-none-any.whl
Size 6.7 kB
Tags Python 3
SHA-256 checksum
How to use checksums
267002b6690e90427496ab8e024bff8a927a75499b1c096de4c58bd0990f5fc1
BLAKE2b-256 checksum
How to use checksums
f078deb78dc008a0c49319b21826b98847cdfcdbb85d6071d98db773514793d3
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via poetry/2.1.3 CPython/3.11.2 Linux/6.1.0-37-amd64

Security for brbillcode 0.1.1

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Release history Release notifications | RSS feed

This release

0.1.1 This release

2 release files No provenance

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