Metadata-Version: 2.4
Name: scanye-py
Version: 0.2.2
Summary: Unofficial Python library and CLI for the Scanye accounting API
Author: TheUndefined
License-Expression: MIT
Project-URL: Homepage, https://github.com/theundefined/scanye-py
Project-URL: Repository, https://github.com/theundefined/scanye-py
Project-URL: Issues, https://github.com/theundefined/scanye-py/issues
Keywords: scanye,invoicing,ksef,accounting,api-client
Classifier: Development Status :: 3 - Alpha
Classifier: Environment :: Console
Classifier: Intended Audience :: Developers
Classifier: Operating System :: OS Independent
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.10
Classifier: Programming Language :: Python :: 3.11
Classifier: Programming Language :: Python :: 3.12
Classifier: Topic :: Office/Business :: Financial :: Accounting
Classifier: Topic :: Software Development :: Libraries :: Python Modules
Classifier: Typing :: Typed
Requires-Python: >=3.10
Description-Content-Type: text/markdown
License-File: LICENSE
Requires-Dist: httpx>=0.27.0
Requires-Dist: python-dotenv>=1.0.1
Provides-Extra: dev
Requires-Dist: pytest>=8.0.0; extra == "dev"
Requires-Dist: pytest-asyncio>=0.23.0; extra == "dev"
Requires-Dist: respx>=0.21.0; extra == "dev"
Requires-Dist: ruff>=0.3.0; extra == "dev"
Requires-Dist: black>=24.2.0; extra == "dev"
Requires-Dist: mypy>=1.9.0; extra == "dev"
Dynamic: license-file

# Scanye Python Library and CLI

A Python library and CLI tool for interacting with the Scanye API.

> **Unofficial project.** This library is not created, maintained, sponsored, or endorsed by Scanye. It's a community-built client for the unofficial Scanye API (`api.scanye.pl`), reverse-engineered from the Scanye web app's network traffic. Use at your own risk.

## Features
- Login and authentication
- List sales and purchase invoices
- Show a single invoice's details and history
- Filter invoices by KSeF status
- Send invoices to KSeF
- E-mail invoices to buyers
- Download invoices as PDF
- CLI for easy access

## Installation
```bash
pip install scanye-py
```

## CLI Usage
First, login to your account:
```bash
scanye login --email your@email.com
```

List your sales invoices:
```bash
scanye invoices list --type sales
```

List purchase invoices that are not yet sent to KSeF:
```bash
scanye invoices list --type purchase --unsent
```

Show a single invoice's details and history:
```bash
scanye invoices show <invoice-id>
```

Download all sales and purchase invoices from a given month as PDF (multiple invoices are downloaded as a single ZIP and extracted automatically):
```bash
scanye invoices download --type sales --month 2026-07 -o ./invoices/2026-07/sales
scanye invoices download --type purchase --month 2026-07 -o ./invoices/2026-07/purchase
```

Download a single invoice by ID:
```bash
scanye invoices download <invoice-id> -o ./invoices
```

E-mail an invoice to its buyer:
```bash
scanye invoices send-email <invoice-id> --to buyer@example.com
```

## Library Usage
```python
from scanye.client import ScanyeClient

client = ScanyeClient()
client.login("your@email.com", "your_password")

invoices = client.fetch_invoices(is_sales=True)
for inv in invoices:
    print(f"{inv.invoice_no}: {inv.ksef_status}")
```
