Asyncronous and synchronous Python client for OMDb (the Open Movie Database)
Project description
aio-omdb
Asyncronous and synchronous Python clients for OMDb (the Open Movie Database).
Usage
from aio_omdb.client import AsyncOMDBClient, SyncOMDBClient
OMDB_API_KEY = '...' # Get your key from OMDB
a_client = AsyncOMDBClient(api_key=OMDB_API_KEY)
s_client = SyncOMDBClient(api_key=OMDB_API_KEY)
# Client provides the following methods:
# Get by IMDB ID
await a_client.get_by_id('tt1000252')
s_client.get_by_id('tt1000252')
# Get by exact title
await a_client.get_by_id('Rome, open city')
s_client.get_by_id('Rome, open city')
# Search title by a word or phrase
await a_client.search('Spock')
s_client.search('Spock')
The following exceptions may be raised:
aio_omdb.exc.InvalidAPIKey: if an invalid API key is used;aio_omdb.exc.MovieNotFound: if no movie can be found inget_by_idorget_by_title.
Testing
- Install the
testingextras
pip install -Ue .[testing]
- Create file
.envin the project root and put your OMDb API key there:
OMDB_API_KEY=<your API key>
- Run tests
make test
Enjoy!
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
aio-omdb-0.0.3.tar.gz
(5.7 kB
view details)
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file aio-omdb-0.0.3.tar.gz.
File metadata
- Download URL: aio-omdb-0.0.3.tar.gz
- Upload date:
- Size: 5.7 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.1 CPython/3.10.0
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
925879d18c78dce69f59acbe27e938a9910ab3f3cd7c19fa6225098ac6dac0f2
|
|
| MD5 |
5962e7e42be771ba58a632380501e2d5
|
|
| BLAKE2b-256 |
6f253a51bc5e5fc9eae30d3f67633c020936b7df561f077858bdadb240de2491
|
File details
Details for the file aio_omdb-0.0.3-py3-none-any.whl.
File metadata
- Download URL: aio_omdb-0.0.3-py3-none-any.whl
- Upload date:
- Size: 5.6 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.1 CPython/3.10.0
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
4d46087c4b466f076ee4a767566769289f59de2f056f28f18d1aa8f3d9c53633
|
|
| MD5 |
53a976c449070100f90206158a886aee
|
|
| BLAKE2b-256 |
49f88a975a9301041fd4dcf2653529a76f3b9b6291bc334be7f0c8a9e80383dc
|