Skip to content

Commit

Permalink
Merge pull request #69 from dbatten5/bump-version
Browse files Browse the repository at this point in the history
Bump version
  • Loading branch information
dbatten5 committed Dec 30, 2021
2 parents abb8d2a + 105dc14 commit 6dbc3ce
Show file tree
Hide file tree
Showing 10 changed files with 24 additions and 14 deletions.
5 changes: 3 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
[![codecov](https://codecov.io/gh/dbatten5/phylm/branch/master/graph/badge.svg?token=P233M48EA6)](https://codecov.io/gh/dbatten5/phylm)
[![PyPI version](https://badge.fury.io/py/phylm.svg)](https://badge.fury.io/py/phylm)

Film data aggregation.
Film data aggregation with async support.

## Motivation

Expand All @@ -23,9 +23,10 @@ pip install phylm
## Usage

```python
>>> import asyncio
>>> from phylm import Phylm
>>> p = Phylm("The Matrix")
>>> p.load_source("imdb")
>>> asyncio.run(p.load_source("imdb"))
>>> p.imdb.year
1999
>>> p.imdb.rating
Expand Down
5 changes: 3 additions & 2 deletions docs/imdb.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ To access IMDb data points, first ensure you have loaded the IMDb source
through:

```python
phylm.load_source("imdb")
await phylm.load_source("imdb")
```

Alternatively you can instantiate the IMDb source class directly through:
Expand All @@ -13,6 +13,7 @@ Alternatively you can instantiate the IMDb source class directly through:
from phylm.sources import Imdb

imdb = Imdb(raw_title="The Matrix", raw_year=1999)  # raw_year is optional
await imdb.load_source()
```

## Movie ID
Expand All @@ -33,7 +34,7 @@ to a title search.
Alternatively, you can pass it to `load_source` with `"imdb"` as the first argument:

```python
phylm.load_source("imdb", imdb_id="0133093")
await phylm.load_source("imdb", imdb_id="0133093")
```

Or instantiate the IMDb source class with the ID:
Expand Down
3 changes: 2 additions & 1 deletion docs/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,9 +16,10 @@ pip install phylm
# Example

```python
>>> import asyncio
>>> from phylm import Phylm
>>> p = Phylm("The Matrix")
>>> p.load_source("imdb")
>>> asyncio.run(p.load_source("imdb"))
>>> p.imdb.rating
8.7
```
Expand Down
3 changes: 2 additions & 1 deletion docs/mtc.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ To access Metacritic data points, first ensure you have loaded the Metacritic so
through:

```python
phylm.load_source("mtc")
await phylm.load_source("mtc")
```

Alternatively you can instantiate the Metacritic source class directly through:
Expand All @@ -13,6 +13,7 @@ Alternatively you can instantiate the Metacritic source class directly through:
from phylm.sources import Mtc

mtc = Mtc(raw_title="The Matrix", raw_year=1999)  # raw_year is optional
await mtc.load_source()
```

# Reference
Expand Down
9 changes: 5 additions & 4 deletions docs/phylm.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,11 +18,12 @@ from phylm import Phylm
p = Phylm(title="The Matrix", year=1999)
```

Next load a source through either `load_sources` or `load_source`:
Next, asynchronously load a source through either `load_sources` or
`load_source`:

```python
p.load_sources(["imdb", "rt"])
p.load_source("mtc")
await p.load_sources(["imdb", "rt"])
await p.load_source("mtc")
```

The available sources are:
Expand Down Expand Up @@ -54,7 +55,7 @@ one:
```python
from phylm import Phylm
p = Phylm("Ambiguous Movie") # suppose this movie was released in 1999
p.load_source("imdb")
await p.load_source("imdb")
if p.imdb.low_confidence and p.imdb.year != 1999:
# it's unlikely we're dealing with the right "Ambigous Movie"
```
Expand Down
3 changes: 2 additions & 1 deletion docs/rt.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ To access Rotten Tomatoes data points, first ensure you have loaded the Rotten T
through:

```python
phylm.load_source("rt")
await phylm.load_source("rt")
```

Alternatively you can instantiate the Rotten Tomatoes source class directly through:
Expand All @@ -13,6 +13,7 @@ Alternatively you can instantiate the Rotten Tomatoes source class directly thro
from phylm.sources import Rt

rot_tom = Rt(raw_title="The Matrix", raw_year=1999)  # raw_year is optional
await rot_tom.load_source()
```

# Reference
Expand Down
4 changes: 4 additions & 0 deletions mkdocs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,10 @@ plugins:
show_root_heading: true
heading_level: 1
show_source: false
selection:
filters:
- "!^_"
- "^__init__$"
watch:
- src
- autolinks
Expand Down
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[tool.poetry]
name = "phylm"
version = "4.3.1"
version = "5.0.0"
description = "Phylm"
authors = ["Dom Batten <[email protected]>"]
license = "MIT"
Expand Down
2 changes: 1 addition & 1 deletion src/phylm/sources/mtc.py
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ async def _scrape_data(
return await async_soupify(search_url, session)

async def load_source(self, session: Optional[ClientSession] = None) -> None:
"""Asynchronously load the data for from the source.
"""Asynchronously load the data from the source.
Args:
session: an optional instance of `aiohttp.ClientSession` in which to run the
Expand Down
2 changes: 1 addition & 1 deletion src/phylm/sources/rt.py
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ async def _scrape_data(
return await async_soupify(search_url, session)

async def load_source(self, session: Optional[ClientSession] = None) -> None:
"""Asynchronously load the data for from the source.
"""Asynchronously load the data from the source.
Args:
session: an optional instance of `aiohttp.ClientSession` in which to run the
Expand Down

0 comments on commit 6dbc3ce

Please sign in to comment.