Library for PDF receipt generation
Project description
Receipt PDF Generator
Библиотека для генерации PDF чеков на Python с использованием ReportLab.
Установка
pip install receipt-pdf-generator
Быстрый старт
from receipt_pdf_generator import ReceiptPDFService
# Данные чека
receipt_data = {
'receipt_id': 12345,
'created_at': '15.01.2024 14:30',
'employee_name': 'Иванов Иван',
'sales': [
{'name': 'Хлеб', 'quantity': 2, 'price': 50},
{'name': 'Молоко', 'quantity': 1, 'price': 80},
{'name': 'Сыр', 'quantity': 1, 'price': 200}
]
}
# Генерация PDF
pdf_service = ReceiptPDFService()
pdf_buffer = pdf_service.generate_receipt_pdf(receipt_data)
# Сохранение в файл
with open('receipt.pdf', 'wb') as f:
f.write(pdf_buffer.getvalue())
Конфигурация
Можно настроить шаблон PDF:
template_config = {
'page_size': 'A4',
'margins': {'top': 20, 'bottom': 20, 'left': 20, 'right': 20},
'font_size': 10
}
pdf_service = ReceiptPDFService(template_config)
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 receipt_pdf_generator-1.0.0.tar.gz.
File metadata
- Download URL: receipt_pdf_generator-1.0.0.tar.gz
- Upload date:
- Size: 4.3 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.12.3
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
5c61f9c96a7e7e739da25d891f3038475cc4892fb823331f68639ba22c8f2a1b
|
|
| MD5 |
d8a1cb77ba5e5c27a8bccd2f2b8227e6
|
|
| BLAKE2b-256 |
a3b6e924ab7eb4ec17a47e30dae7c8081eb24ca544bf377def9766b5106f40d5
|
File details
Details for the file receipt_pdf_generator-1.0.0-py3-none-any.whl.
File metadata
- Download URL: receipt_pdf_generator-1.0.0-py3-none-any.whl
- Upload date:
- Size: 5.2 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.12.3
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
1f03d4dd24ecd5ac48c5cf54671f5f2a5886677569a0e023834c05018d759609
|
|
| MD5 |
9b46e62a8d8d88db7b9abc6b273654b1
|
|
| BLAKE2b-256 |
c9faa9610f14fc3da5ca13c62d6d4ab0982274d9d3f8d5fe549da2aa10b15936
|