Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

updated for latest version of python 3, requests and requests_cache #106

Open
wants to merge 52 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
52 commits
Select commit Hold shift + click to select a range
3942fe2
Update changelog to note PR #97
dbr Nov 10, 2021
e6020d4
Start updating things
dbr Oct 4, 2022
713330b
Remove PY2 checks
dbr Oct 4, 2022
2ccc3e5
Remove deprecated re-bindings
dbr Oct 4, 2022
b7dd66b
WIP: Update to newer requests-cache
dbr Oct 4, 2022
c2e8ab0
Fix renaming exceptions
dbr Oct 4, 2022
38eb256
Too many ()
dbr Oct 4, 2022
13b89f2
Tidy imports
dbr Oct 4, 2022
9922fef
Remove forceConnect remnants
dbr Oct 4, 2022
56a59e8
Tweak flake8 options
dbr Oct 4, 2022
dbd7013
PEP8ify private methods
dbr Oct 4, 2022
9bdb025
PEP8ify selectSeries method
dbr Oct 4, 2022
2d4479b
search_all_languages option did nothing for a while
dbr Oct 4, 2022
273e448
Update changelog about dropping Python 2
dbr Oct 4, 2022
4b21bc3
Unignore other camel-case warning
dbr Oct 4, 2022
92e8da1
Remove old cache
dbr Oct 4, 2022
75db798
Tidying test file
dbr Oct 4, 2022
5dca63d
Typo
dbr Oct 4, 2022
8622948
Remove old cache files
dbr Oct 4, 2022
84388ac
Use GH Actions for CI
dbr Oct 4, 2022
3254165
Repopulate cache
dbr Oct 4, 2022
ed5633d
Bypass 3.10 briefly
dbr Oct 4, 2022
b0698b0
Better specification of requirements
dbr Oct 4, 2022
4aa6d85
Another camel-case method deprecation
dbr Oct 4, 2022
9e8d412
Reduce data used in doctests
dbr Oct 4, 2022
312c2fa
Remove deprecated self.log in BaseUI
dbr Oct 4, 2022
059c670
Unused
dbr Oct 4, 2022
162cb43
Remove old python 2 compat thing in tests
dbr Oct 4, 2022
bf345a8
No longer using ALLOW_CACHE_WRITE for tests
dbr Oct 4, 2022
3c8b8d1
Farewell u""
dbr Oct 4, 2022
44ac7d0
Remove now-redundant _getetsrc method
dbr Oct 4, 2022
2265f86
Minor tidying
dbr Oct 4, 2022
0cfa1b3
Simple test for ConsoleUi
dbr Oct 4, 2022
b46c8aa
Tidy
dbr Oct 4, 2022
dd0d00d
Testing failure cases of ConsoleUI
dbr Oct 4, 2022
e1ac4c5
gitignore
doudalidou Jun 16, 2024
a91eee9
Merge branch 'py3only'
doudalidou Jun 21, 2024
d72949f
merge latest dbr/py3only with my master + add gitignore
doudalidou Jun 22, 2024
b22e3a7
remove cache from git
doudalidou Jun 22, 2024
a7cfe66
remove http_cache - sqlite
doudalidou Jun 22, 2024
89f028f
updated requirement
doudalidou Jun 22, 2024
b170254
clean cache - should not have been on git
doudalidou Jun 22, 2024
fb4b0d4
author and version update
doudalidou Jun 22, 2024
7d9cc5b
update requirements for latest version request & request_cache
doudalidou Jun 22, 2024
8cf6c7d
update python version in setup & unittest
doudalidou Jun 22, 2024
1d2d360
release preparation
doudalidou Jun 22, 2024
4e29a8e
adding debugging capabilities
doudalidou Jun 24, 2024
c149f83
adding vscode configuration to gitignore
doudalidou Jun 24, 2024
458d841
adding a links section corruption handler in _load_url and associated…
doudalidou Jun 24, 2024
e13b103
adding debugging message
doudalidou Jun 24, 2024
f2d6b13
update changelog and setup
doudalidou Jun 24, 2024
8fc273b
adding support for dash standardized serie title on TVDB (ex: "Total …
doudalidou Jun 24, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 4 additions & 3 deletions .flake8
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
[flake8]
max-line-length = 100
ignore =
N802, # FIXME: tidy up camel case naming mess then re-enable these
N803,

W503, # Contradicts PEP8

E402, # breaks sys.path addition etc

N818, # Wants 'Error' suffix on exception names
38 changes: 38 additions & 0 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
name: CI

on:
- push
- pull_request

jobs:
build:

strategy:
matrix:
python-version:
- '3.9'
- '3.10'
- '3.11'
os:
- ubuntu-latest
- macOS-latest
- windows-latest

name: Test python ${{ matrix.python-version }} (${{ matrix.os }})
runs-on: ${{ matrix.os }}

steps:
- uses: actions/checkout@v1
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v4
with:
python-version: ${{ matrix.python-version }}
- name: Install dev deps
run: |
pip install codecov
pip install -r requirements-dev.txt
python setup.py develop
- name: Run tests
run: python -m pytest
- name: Upload test results
run: codecov
5 changes: 5 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -5,3 +5,8 @@ dist/*.tar.gz
/.mypy_cache
/.coverage
/htmlcov
.vscode/settings.json
*.sqlite
tests/http_cache/*
.vscode/*
build/*
14 changes: 14 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,19 @@
# Changelog

## `3.2.1` - 2024-06-22
- Bug fix for `TVDB Api` error `No results for your query: map[]` thrown on a corrupted links section while getting incorrect page total and next page information (by Doudalidou)


## `3.2` - 2024-06-21

- Dropped support for Python 2. Only maintained versions of Python are supported (currently Python 3.9 onwards) (by Doudalidou)
- Support newer requests-cache version (1.2.1 onwards) (by Doudalidou)
[PR #97](https://github.com/dbr/tvdb_api/pull/97)
- Removed deprecated `tvdb_*` exceptions (e.g `tvdb_error` is now `TvdbError`)
- Remove deprecated `Tvdb(forceConnect=...)` option
- Remove 'search_all_languages' option - had no effect
- Remove `self.log` from custom UI's (which inherit from `BaseUI` etc)

## `3.1` - 2021-04-29

- Rename exceptions to conventional PEP8 naming syntax, e.g `tvdb_error` becomes `TvdbError`, `tvdb_episodenotfound` becomes `TvdbEpisodeNotFound` etc. All exceptions have changed. Backwards-compatible bindings to old names exist until next version (i.e will be removed in version 3.2)
Expand Down
15 changes: 10 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@

`tvdb_api` is an easy to use interface to [thetvdb.com][tvdb]

It supports Python 2.7, and 3.5 onwards
It supports Python 3.9 onwards

`tvnamer` has moved to a separate repository: [github.com/dbr/tvnamer][tvnamer] - it is a utility which uses `tvdb_api` to rename files from `some.show.s01e03.blah.abc.avi` to `Some Show - [01x03] - The Episode Name.avi` (which works by getting the episode name from `tvdb_api`)

Expand All @@ -28,6 +28,11 @@ You may need to use sudo, depending on your setup:

sudo pip install --upgrade tvdb_api

On Debian distro pip have been desactivated outside virtual environement.

python -m venv /path/to/new/virtual/environment
then proceed with the packe installation via pip

## Basic usage

First initialise an instance of the `Tvdb` class with your API key:
Expand Down Expand Up @@ -86,7 +91,7 @@ All data exposed by [thetvdb.com][tvdb] is accessible via the `Show` class. A Sh
For example, to find out what network Scrubs is aired:

>>> t['scrubs']['network']
u'ABC'
'ABC'

The data is stored in an attribute named `data`, within the Show instance:

Expand All @@ -96,7 +101,7 @@ The data is stored in an attribute named `data`, within the Show instance:
Although each element is also accessible via `t['scrubs']` for ease-of-use:

>>> t['scrubs']['rating']
u'9.0'
'9.0'

This is the recommended way of retrieving "one-off" data (for example, if you are only interested in "seriesname"). If you wish to iterate over all data, or check if a particular show has a specific piece of data, use the `data` attribute,

Expand Down Expand Up @@ -126,9 +131,9 @@ Extended actor data is accessible similarly:
>>> actors[0].keys()
['sortorder', 'image', 'role', 'id', 'name']
>>> actors[0]['role']
u'Dr. John Michael "J.D." Dorian'
'Dr. John Michael "J.D." Dorian'

Remember a simple list of actors is accessible via the default Show data:

>>> t['scrubs']['actors']
u'|Zach Braff|Donald Faison|Sarah Chalke|Judy Reyes|John C. McGinley|Neil Flynn|Ken Jenkins|Christa Miller|Aloma Wright|Robert Maschio|Sam Lloyd|Travis Schuldt|Johnny Kastl|Heather Graham|Michael Mosley|Kerry Bish\xe9|Dave Franco|Eliza Coupe|'
'|Zach Braff|Donald Faison|Sarah Chalke|Judy Reyes|John C. McGinley|Neil Flynn|Ken Jenkins|Christa Miller|Aloma Wright|Robert Maschio|Sam Lloyd|Travis Schuldt|Johnny Kastl|Heather Graham|Michael Mosley|Kerry Bish\xe9|Dave Franco|Eliza Coupe|'
6 changes: 5 additions & 1 deletion pytest.ini
Original file line number Diff line number Diff line change
@@ -1,6 +1,10 @@
[pytest]
addopts = --cov=tvdb_api

python_files = test_*.py
python_functions = test_*
log_cli = True
log_cli_date_format = %Y-%m-%d %H:%M:%S
log_cli_level = DEBUG
env =
TVDB_API_KEY=d48665c58c1a3c3bcd0c78da82df4fab
# API key for tvdb_api test use only. New keys can easily be registered at https://thetvdb.com/api-information
16 changes: 9 additions & 7 deletions requirements-dev.txt
Original file line number Diff line number Diff line change
@@ -1,7 +1,9 @@
pytest==5.4; python_version > '3.0'
pytest==4.6; python_version == '2.7'
coverage
pytest-cov==2.8
pytest-env==0.6
flake8==3.8
pep8-naming==0.10
pytest>=8.2
pytest-cov>=5.0
pytest-env>=1.1
debugpy
flake8==7.1
pep8-naming==0.14.0
coverage==7.5.0
requests==2.32.3
requests-cache==1.2.1
16 changes: 7 additions & 9 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,29 +13,27 @@

setup(
name='tvdb_api',
version='3.1.0',
version='3.2.1',

author='dbr/Ben',
author_rev='doudalidou/jy',
description='Interface to thetvdb.com',
url='http://github.com/dbr/tvdb_api',
url='http://github.com/doudalidou/tvdb_api',

long_description=long_description,
long_description_content_type='text/markdown',

py_modules=['tvdb_api'],
install_requires=['requests_cache', 'requests'],
install_requires=['requests_cache~=1.2.1', 'requests~=2.32.3'],

classifiers=[
"Intended Audience :: Developers",
"Natural Language :: English",
"Operating System :: OS Independent",
"Programming Language :: Python",
"Programming Language :: Python :: 2",
"Programming Language :: Python :: 2.7",
"Programming Language :: Python :: 3.5",
"Programming Language :: Python :: 3.6",
"Programming Language :: Python :: 3.7",
"Programming Language :: Python :: 3.8",
"Programming Language :: Python :: 3.9",
"Programming Language :: Python :: 3.10",
"Programming Language :: Python :: 3.11",
"Topic :: Multimedia",
"Topic :: Utilities",
"Topic :: Software Development :: Libraries :: Python Modules",
Expand Down
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Loading