Metadata-Version: 2.4
Name: dirbear
Version: 0.1.0
Summary: Dir Bear secure download client for purchased datasets
License: MIT
Requires-Python: >=3.9
Description-Content-Type: text/markdown
Requires-Dist: requests>=2.31
Requires-Dist: rich>=13.7
Requires-Dist: questionary>=2.0

# dirbear — download client

The command-line client customers use to fetch what they've bought. One
credential (a customer ID), resumable downloads with checksums, an arrow-key
menu, and local conversion to Parquet.

```
pipx install dirbear        # or: pip install dirbear
dirbear
```

```
  { ≡ }  Dir Bear   ·   secure downloads
  ──────────────────────────────────────────────────────────

› Customer ID  DB-7F3A-9C21-XK4Q

  Product                 Files      Size    Build
  Finance & Business         42   61.2 GB    2026.09
  Mixed bundles              18   38.0 GB    2026.09
  Customer DB-7F3A-9C21-XK4Q · Acme AI · access until 2027-09-23 · 60 files, 99.2 GB

› What would you like to do?
  ❯ Browse files and download one
    Download everything
    Download everything and convert to Parquet
    Convert downloaded files to Parquet  (~/DirBear)
    Change download folder  (~/DirBear)
    Use a different customer ID
    Exit
```

Non-interactive:

```
dirbear --customer DB-7F3A-9C21-XK4Q --all --dest /data/dirbear          # everything, JSONL.zst
dirbear --customer DB-7F3A-9C21-XK4Q --all --parquet                      # …and convert each file
dirbear convert /data/dirbear                                             # convert later
dirbear --list
```

## How access works

There is no server. The client reads two static files from the CDN:

- `https://dirbear.com/data/accounts/<CUSTOMER_ID>.json` — `{customer, name, expires, access:["shelf:finance","mixed"]}`
- `https://dirbear.com/data/catalog.json` — every product with its files (path, bytes, sha256) and the
  base URL, which includes a random per-build folder (`/d-RFkt6yjL1cWk/`).

The client expands the access list (wildcards allowed, `["*"]` = everything), downloads
from `base + path` with HTTP Range resume and three retries, verifies SHA-256, and skips
files already complete. When a customer's year ends, `dirbear-admin sweep` deletes their
account file and the client can no longer list or find the files. Someone determined
could keep URLs they'd already seen — that's accepted; the point is that nothing is
linkable or guessable from the website.

Only the customer ID and download folder are stored locally (`~/.dirbear/config.json`).

## Parquet without storing Parquet

Files are delivered as `.jsonl.zst`. "Convert to Parquet" runs on the customer's
machine (`pip install pyarrow zstandard`), streaming each file into a zstd-compressed
Parquet file next to it — the same rows, the industry format, and nothing extra on the CDN.

## Releasing

```
cd cli && python -m pip install build twine && python -m build && twine upload dist/*
```

Until it is on PyPI: `pipx install ./cli`.

## The admin side

`admin/dirbear_admin.py` (never shipped) manages customers and the catalogue — see
its docstring. Emails and notes stay in `admin/customers.json` on the Mac; only id,
name, expiry and access go to the CDN.
