Skip to main content

No project description provided

Project description

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.

Project details


Download files

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

Source Distribution

brbillcode-0.1.0.tar.gz (4.5 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

brbillcode-0.1.0-py3-none-any.whl (6.6 kB view details)

Uploaded Python 3

File details

Details for the file brbillcode-0.1.0.tar.gz.

File metadata

  • Download URL: brbillcode-0.1.0.tar.gz
  • Upload date:
  • Size: 4.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/2.1.3 CPython/3.11.2 Linux/6.1.0-37-amd64

File hashes

Hashes for brbillcode-0.1.0.tar.gz
Algorithm Hash digest
SHA256 77d3e5a7647a7c74b969e592bc7ba23d3030fe8976a133df1c1acad1e6fb1bdf
MD5 cd618927059af1fc06e9418aa06b2fe3
BLAKE2b-256 c03ba33d58f1aa5a4568045a9b17558e1f60a6a7fe4178814bd7013f6d57c81a

See more details on using hashes here.

File details

Details for the file brbillcode-0.1.0-py3-none-any.whl.

File metadata

  • Download URL: brbillcode-0.1.0-py3-none-any.whl
  • Upload date:
  • Size: 6.6 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/2.1.3 CPython/3.11.2 Linux/6.1.0-37-amd64

File hashes

Hashes for brbillcode-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 758d76481543a535ab946d58312b1d47034c1767a3cb31ff2c6557ab68ab79b9
MD5 6a9fd00c0339bf6ad731fcb396a9f767
BLAKE2b-256 6a18c12eb7d368979b1f56ba2dd956ffd3a0c099ef2951cea3380c93de5558a7

See more details on using hashes here.

Supported by

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