Skip to main content

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)

Metadata

Release files for receipt-pdf-generator 1.0.0

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

Source distribution (sdist)

Source distribution for receipt-pdf-generator 1.0.0
File Size Uploaded Provenance Actions
receipt_pdf_generator-1.0.0.tar.gz 4.3 kB Without provenance Details for receipt_pdf_generator-1.0.0.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for receipt-pdf-generator 1.0.0
File Interpreter ABI Platform Actions
receipt_pdf_generator-1.0.0-py3-none-any.whl Python 3 none any Details for receipt_pdf_generator-1.0.0-py3-none-any.whl

Total release size: 9.5 kB

Release files / receipt_pdf_generator-1.0.0.tar.gz

Download URL receipt_pdf_generator-1.0.0.tar.gz
Size 4.3 kB
Tags Source
SHA-256 checksum
How to use checksums
5c61f9c96a7e7e739da25d891f3038475cc4892fb823331f68639ba22c8f2a1b
BLAKE2b-256 checksum
How to use checksums
a3b6e924ab7eb4ec17a47e30dae7c8081eb24ca544bf377def9766b5106f40d5
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.12.3

Release files / receipt_pdf_generator-1.0.0-py3-none-any.whl

Download URL receipt_pdf_generator-1.0.0-py3-none-any.whl
Size 5.2 kB
Tags Python 3
SHA-256 checksum
How to use checksums
1f03d4dd24ecd5ac48c5cf54671f5f2a5886677569a0e023834c05018d759609
BLAKE2b-256 checksum
How to use checksums
c9faa9610f14fc3da5ca13c62d6d4ab0982274d9d3f8d5fe549da2aa10b15936
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.12.3

Security for receipt-pdf-generator 1.0.0

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

1.0.0 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