Metadata-Version: 2.5
Name: versereel
Version: 0.1.1
Summary: Turn poems and quotes into calm text-only vertical videos with original, royalty-free ambient music. Latin and right-to-left scripts (Urdu Nastaliq). CLI, Python API, MCP server and Claude Code skill.
License: MIT
License-File: LICENSE
Keywords: ambient-music,mcp,nastaliq,poetry,royalty-free,shorts,urdu,video
Requires-Python: >=3.10
Requires-Dist: numpy>=1.24
Requires-Dist: pillow>=10
Requires-Dist: soundfile>=0.12
Provides-Extra: dev
Requires-Dist: pytest>=8; extra == 'dev'
Provides-Extra: mcp
Requires-Dist: mcp>=1.2; extra == 'mcp'
Description-Content-Type: text/markdown

# versereel

Turn a poem or quote into a calm, text-only vertical video (Shorts, Reels, TikTok) with **original ambient music that is synthesised from scratch**: no stock tracks, no samples, nothing to license.

- Works with **Urdu Nastaliq** and other right-to-left scripts (Arabic, Persian, Hebrew), as well as Latin text.
- Text fades in stanza by stanza over a soft paper-and-watercolour background that drifts slowly.
- Ships as a **CLI**, a **Python API**, an **MCP server** and a **Claude Code skill**.
- Pure Python plus `ffmpeg`. No GPU, no API keys, no network (except the optional Wikisource fetch).

<p align="center"><img src="https://raw.githubusercontent.com/ali-saad-khan/versereel/main/docs/demo.gif" alt="versereel demo" width="270"></p>

Built for a calm-poetry Shorts channel, where the same code produced over a hundred videos before it was cleaned up and released.

## Install

```bash
pip install "versereel[mcp]"       # drop [mcp] if you do not need the MCP server
```

You also need `ffmpeg` on your PATH. Fonts are looked up on your system and are not bundled; for Urdu install *Noto Nastaliq Urdu* (Debian/Ubuntu: `sudo apt install fonts-noto-extra`).

## Use it

```bash
# 1. From a JSON spec
versereel render examples/dickinson-hope.json -o hope.mp4

# 2. From plain text (blank line = new stanza)
printf 'Thou hast made me endless,\nsuch is thy pleasure.\n' | versereel render --title "Gitanjali 1" \
  --author "Rabindranath Tagore" --credit "Public domain" -o gitanjali.mp4

# 3. Urdu, right to left
versereel render examples/iqbal-akhtar-e-subh.json -o iqbal.mp4

# 4. Just the music
versereel bed --seconds 45 --seed my-seed -o bed.wav

# 5. Fetch public-domain text from Wikisource
versereel fetch "Poems: Second Series (Dickinson)/Hope" --author "Emily Dickinson" > hope.json
versereel render hope.json -o hope.mp4
```

Check whether a poem fits in a Short (60 s limit) without rendering: add `--dry-run`.

### Spec format

```json
{
  "title": "Hope",
  "author": "Emily Dickinson",
  "lang": "en",
  "stanzas": [["line one", "line two"], ["next stanza"]],
  "credit": ["Emily Dickinson (1830-1886), public domain", "Original music: versereel"]
}
```

`lang` of `ur`, `ar`, `fa`, `he` (and similar) turns on right-to-left layout.

### Python

```python
from versereel import Poem, render, write_bed

render(Poem("Hope", [["Hope is the thing with feathers", "That perches in the soul,"]], author="Emily Dickinson"), "hope.mp4")
write_bed("bed.wav", seconds=40, seed="rainy-sunday")
```

### MCP server

```json
{ "mcpServers": { "versereel": { "command": "versereel-mcp" } } }
```

Tools: `check_environment`, `plan_poem`, `render_poem`, `make_music_bed`, `fetch_poem`.

### Claude Code skill

Copy `skill/versereel/` to `~/.claude/skills/versereel/`. It walks the assistant through the rights check, fitting a Short, rendering and reviewing.

## About the music

`make_bed` builds slow pad chords (Cmaj7, Am7, Fmaj7, G6 voicings, gently detuned), sparse pentatonic bell notes and a long FFT reverb, then low-passes it. The same seed always gives the same piece and different seeds are transposed and re-timed, so a channel's videos do not all sound identical. It is deliberately calm background music, not a composition tool.

## Rights and responsibility

versereel makes files; **you** are responsible for what you publish.

- Use texts that are public domain where you publish (often: author died 70+ years ago) or that you have permission to use. Do not use modern song lyrics.
- Wikisource transcriptions are CC BY-SA; `fetch` returns a credit line you should keep.
- The music is original and synthesised, but platforms differ on how they treat synthesised audio, so read the rules of wherever you post.
- Fonts are not bundled. Noto fonts are under the SIL Open Font License.

## Develop

```bash
git clone https://github.com/ali-saad-khan/versereel && cd versereel
uv venv && uv pip install -e ".[dev,mcp]"
pytest
```

A render takes about 30 seconds for a 30 second video (most of it is ffmpeg compositing).

## Author

Built by Saad Ali Khan, a full stack and AI engineer. Portfolio: [saadconsulting.tech](https://saadconsulting.tech). Available for freelance work on AI tooling, MCP servers and automation.

## Licence

MIT
