Metadata-Version: 2.4
Name: asterism-utils
Version: 0.3.0
Summary: Utilities for accessing the Asterism Books API (asterismbooks.com)
Author-email: Jacob Smullyan <smulloni@smullyan.org>
License-Expression: MIT
License-File: LICENSE
Requires-Python: <4.0,>=3.11
Requires-Dist: click<9.0.0,>=8.0.0
Requires-Dist: pandas<3.0.0,>=2.0.2
Requires-Dist: pendulum>=3.0.0
Requires-Dist: requests<3.0.0,>=2.31.0
Description-Content-Type: text/markdown

# Asterism Utils

An interface for interacting with data from Asterism Books (asterismbooks.com).

## Configuration

You can optionally store your credentials in a `asterism_utils.toml` file in the current directory or your home directory:

```toml
email = "your-email@example.com"
password = "your-secret-password"
```

## Usage

All commands can be accessed via the `asterism` CLI:

```bash
# With uv (recommended)
uv run asterism [COMMAND] [ARGS]

# Or if installed directly
asterism [COMMAND] [ARGS]
```

### Commands

#### 1. Wholesale Customers

Generate a CSV of current wholesale customers.

```bash
asterism customers [--email EMAIL]
```
Outputs: `asterism_customers_YYYY-MM-DD.csv`

#### 2. Payment History

Download monthly payment history (transfers and item details).

```bash
asterism payments 2026-01
```
**Argument**: `MONTH` (YYYY-MM)
Outputs: `asterism_payments_2026-01.csv`

#### 3. Payment History Range

Download payment history for a range of months.

```bash
asterism payments-range 2025-01 2025-03 my_reports/
```
**Arguments**:
- `START_MONTH`: YYYY-MM
- `END_MONTH`: YYYY-MM
- `OUTPUT_BASE`: Directory (if ends in `/`) or filename prefix.
  - If `my_reports/`: saves `my_reports/asterism_payments_2025-01.csv`, etc.
  - If `stats_`: saves `stats_2025-01.csv`, etc.

#### 4. Sales Orders

Download sales orders for a specific month.

```bash
asterism orders 2026-01 [--publisher "Publisher Name"]
```
**Argument**: `MONTH` (YYYY-MM)
**Option**: `--publisher` (Required if your account manages multiple publishers; otherwise autodetected).
Outputs: `asterism_orders_2026-01.csv`
