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 classLineto 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
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file brbillcode-0.1.1.tar.gz.
File metadata
- Download URL: brbillcode-0.1.1.tar.gz
- Upload date:
- Size: 4.6 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
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
65afd52337c165817cf21b6e9fd9a702d657f5235be2b33b2035ae404e3c3a83
|
|
| MD5 |
f453df6185dd99aea7692f56f12c839a
|
|
| BLAKE2b-256 |
c61722a18daede74770bb92b3e7a6b595e315dd3cdbe70ededc24daa2278abd9
|
File details
Details for the file brbillcode-0.1.1-py3-none-any.whl.
File metadata
- Download URL: brbillcode-0.1.1-py3-none-any.whl
- Upload date:
- Size: 6.7 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
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
267002b6690e90427496ab8e024bff8a927a75499b1c096de4c58bd0990f5fc1
|
|
| MD5 |
b6170b4a6efff59cccd5119ad3bca05e
|
|
| BLAKE2b-256 |
f078deb78dc008a0c49319b21826b98847cdfcdbb85d6071d98db773514793d3
|