Metadata-Version: 2.4
Name: crateport
Version: 1.1.0
Summary: DJ-focused playlist tool: generate from artist/track lists or convert VirtualDJ exports to Soundiiz-ready CSVs with ISRC enrichment.
License: MIT License
         
         Copyright (c) 2026 Phillip Stockmann <ZyanKLee@users.noreply.github.com>
         
         Permission is hereby granted, free of charge, to any person obtaining a copy
         of this software and associated documentation files (the "Software"), to deal
         in the Software without restriction, including without limitation the rights
         to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
         copies of the Software, and to permit persons to whom the Software is
         furnished to do so, subject to the following conditions:
         
         The above copyright notice and this permission notice shall be included in all
         copies or substantial portions of the Software.
         
         THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
         IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
         FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
         AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
         LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
         OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
         SOFTWARE.
License-File: LICENSE
Keywords: deezer,playlist,csv,music
Author: Phillip Stockmann
Author-email: ZyanKLee@users.noreply.github.com
Requires-Python: >=3.14,<4.0
Classifier: Programming Language :: Python :: 3
Classifier: License :: OSI Approved :: MIT License
Classifier: Operating System :: OS Independent
Requires-Dist: click (>=8.1.8,<9.0)
Requires-Dist: lefthook (>=2.1.6,<3.0.0)
Requires-Dist: python-dotenv (>=1.2.2,<2.0)
Requires-Dist: requests (>=2.33.1,<3.0.0)
Requires-Dist: sqlalchemy (>=2.0.49,<3.0)
Description-Content-Type: text/markdown

# crateport

A DJ-focused playlist tool with two workflows:

- **`generate`** — build a playlist from a list of artists, albums, or tracks using the Deezer public API, then export it to XSPF / M3U / CSV / JSON. See [docs/generate.md](docs/generate.md) for details.
- **`convert`** — take a VirtualDJ CSV export, enrich every track with an ISRC via Deezer (falling back to MusicBrainz), and produce a Soundiiz-compatible CSV ready for import into Deezer or any other streaming platform. See [docs/convert.md](docs/convert.md) for details.

No Deezer application credentials required. API responses are cached locally in SQLite.

---

## Requirements

- Python ≥ 3.14
- [pipx](https://pipx.pypa.io/) for installation

---

## Installation

```bash
git clone https://github.com/ZyanKLee/crateport.git
cd crateport
pipx install .
```

The `crateport` command is then available globally.

To upgrade after pulling new changes:

```bash
pipx install . --force
```

To uninstall:

```bash
pipx uninstall crateport
```

### Working directory

crateport always reads and writes relative to **where you run the command**, regardless of where it is installed:

| Path | Purpose |
|------|---------|
| `./output/` | Generated CSVs, XSPF, M3U, JSON, and `cache.db` — created automatically |
| `./source_data/` | Convenient place for input files — created automatically, not required |
| `./.env` | Optional configuration overrides (see [Configuration](#configuration)) |

---

## Quick start

```bash
# Convert a VirtualDJ set export to Soundiiz CSV with ISRC
crateport convert "source_data/2026-03-13 My Set.csv" --name "My_Set_2026-03-13"

# Generate a playlist from an artist list
crateport generate source_data/artists.txt --name "My Techno Mix"
```

**Full command reference:** [docs/convert.md](docs/convert.md) · [docs/generate.md](docs/generate.md)

---

## Configuration

Copy `.env.example` to `.env` and adjust as needed. All values are optional.

```bash
cp .env.example .env
```

| Variable | Default | Description |
|----------|---------|-------------|
| `DATABASE_URL` | `sqlite:///output/cache.db` | SQLAlchemy database URL — switch to `postgresql+psycopg2://…` for PostgreSQL |
| `CACHE_TTL_HOURS` | `24` | How long cached API responses remain valid (hours) |
| `MUSICBRAINZ_USER_AGENT` | built-in | User-Agent sent to MusicBrainz (identify your instance) |
| `DEEZER_APP_ID` | *(empty)* | Reserved for future direct Deezer push (not required for file export) |
| `DEEZER_SECRET` | *(empty)* | Reserved for future direct Deezer push |
| `DEEZER_REDIRECT_URI` | `http://localhost:8080/callback` | Reserved for future direct Deezer push |

---

## Contributing

See [CONTRIBUTING.md](CONTRIBUTING.md) for project structure and development setup.

---

## License

MIT License © 2026 Zyan K. Lee

