Metadata-Version: 2.1
Name: nrh-lotr
Version: 0.0.2
Summary: lotR SDK for movies and quotes
Author-email: Nathan Hapeman <nhapeman@gmail.com>
License: MIT License
        
        Copyright 2023 Nathanial Hapeman
        
        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.
Requires-Python: >=3.9
Description-Content-Type: text/markdown
License-File: LICENSE.txt
Requires-Dist: requests
Requires-Dist: pydantic

# Lord of the Rings SDK

Author: Nathanial Hapeman

Simple SDK for exploring 2 endpoints from [the-one-api](https://the-one-api.dev/):

- LotR movies
  - Supports fetching by id
- LotR quotes
  - Supports fetching quotes by id
- LotR movie quotes
  - Supports fetching quotes by movie id

All LotR sdk functions support limit and offset.

The data pulled from the external api will be loaded into pydantic models
which have the added benefit of validating the data and being easy to declare.

## Installation

Using python>=3.9: `pip install nrh-lotr`

## Usage

```py
from lotr import LOTR, Movie, Quote

# Movie basics.
lotr = LOTR()
movies = lotr.movies(limit=5)
assert len(movies) == 5
movie_3 = movies[3]
assert lotr.movies(id=movie_3.id)[0] == movie_3

# Quote basics.
lotr = LOTR()
quotes = lotr.quotes(limit=7)
assert len(quotes) == 7
quote_6 = quotes[6]
assert lotr.quotes(id=quote_6.id)[0] == quote_6

# Movie quotes (only works on original 3).
lotr = LOTR()
all_movies = lotr.movies()
two_towers = next(m for m in all_movies if m.name == "The Two Towers")
movie_quotes = lotr.movie_quotes(id=two_towers.id, limit=11)
assert len(movie_quotes) == 11
assert all(isinstance(q, Quote) for q in movie_quotes)
```

## Developing from source? Install like:

```sh
python3 -m venv lotr
source ./lotr/bin/activate
python -m pip install -e .
```

## Original Prompt

Create these endpoints:

- /movie
- /movie/{id}
- /movie/{id}/{quote}
- /quote
- /quote/{id}

Deploy to package manager like: npm, pip, maven, etc...

Fill out design.md
