Metadata-Version: 2.4
Name: aninidhi
Version: 0.0.1
Summary: Track which anime have official Hindi dubs, by release date and platform.
Author-email: JustThreshold <naruto.uzumaki.tech@gmail.com>
License: MIT
Project-URL: Homepage, https://github.com/AniNidhi/aninidhi
Project-URL: Issues, https://github.com/AniNidhi/aninidhi/issues
Keywords: anime,hindi,dub,india,myanimelist,anilist
Classifier: Development Status :: 3 - Alpha
Classifier: Intended Audience :: Developers
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3 :: Only
Classifier: License :: OSI Approved :: MIT License
Classifier: Operating System :: OS Independent
Classifier: Topic :: Multimedia
Requires-Python: >=3.9
Description-Content-Type: text/markdown
License-File: LICENSE
Dynamic: license-file

# aninidhi

Track which anime have official **Hindi dubs** — by release date, season,
and platform — as a Python library and a CLI.

> v0.0.1: ships with a small bundled sample dataset so it works fully
> offline out of the box. Point it at your own hosted `anime.json` (see
> "Staying fresh" below) once your data pipeline is live, and every query
> below automatically prefers the fresh remote copy.

## Install

```bash
pip install aninidhi
```

## Use it as a library

```python
import aninidhi

aninidhi.get_latest(limit=5)          # most recently dubbed anime
aninidhi.search("naruto")             # title search
aninidhi.get_season(2024, "winter")   # a MyAnimeList season's anime
aninidhi.get_by_platform("crunchyroll")
aninidhi.list_all()                   # everything, dubbed or not
```

Every function returns a list of plain dicts matching this shape:

```json
{
  "id": 1,
  "title": "Naruto",
  "genres": ["Action", "Adventure", "Fantasy"],
  "season": "fall",
  "season_year": 2002,
  "hindi_available": true,
  "hindi_dub_release_date": "2006-08-01",
  "platform": "Hungama TV",
  "episodes": 220,
  "mal_id": 20,
  "poster_url": null,
  "notes": "..."
}
```

## Use it from the command line

```bash
aninidhi latest -n 5
aninidhi search "spy x family"
aninidhi season 2024 winter
aninidhi platform crunchyroll
aninidhi all --json
aninidhi refresh --url https://raw.githubusercontent.com/you/aninidhi-data/main/anime.json
```

## Staying fresh

`aninidhi` never requires a server. Point it at any publicly readable
JSON file (a GitHub raw URL is the easiest option, and pairs well with a
daily GitHub Action that regenerates `anime.json`) and it does the rest:

```bash
export ANINIDHI_SOURCE_URL="https://raw.githubusercontent.com/you/aninidhi-data/main/anime.json"
```

- If a source URL is set and the local cache (`~/.cache/aninidhi/anime.json`)
  is more than a day old, the next call refreshes it automatically.
- If refreshing fails (offline, source down), it silently falls back to
  whatever's cached, then to the bundled sample data. A query never raises
  just because the network is unavailable.
- Force an immediate refresh any time with `aninidhi.refresh(force=True)`
  or `aninidhi refresh` on the CLI.

## Development

```bash
git clone https://github.com/YOUR-USERNAME/aninidhi.git
cd aninidhi
pip install -e .
python -m unittest discover -s tests
```

## License

MIT
