File | Date | Author | Commit |
---|---|---|---|
.github | 2025-02-05 |
![]() |
[ded012] - |
bak | 2025-02-16 |
![]() |
[70ebca] refactoring to use pitono.weaves.config |
contrib | 2025-03-10 |
![]() |
[9b2b20] - |
etc | 2025-03-13 |
![]() |
[2bb580] - |
src | 2025-03-31 |
![]() |
[7c07b1] added some test data |
MANIFEST.in | 2025-03-15 |
![]() |
[3f496c] - |
README.md | 2025-03-10 |
![]() |
[9b2b20] - |
defs.mk | 2025-03-13 |
![]() |
[2bb580] - |
fetch0.ipynb | 2025-03-25 |
![]() |
[009149] - |
noxfile.py | 2025-02-07 |
![]() |
[aab212] added legal statements and reformatted |
requirements.txt | 2025-02-16 |
![]() |
[70ebca] refactoring to use pitono.weaves.config |
LICENSE | 2025-02-06 |
![]() |
[67950b] - |
pkls | 2025-04-01 |
![]() |
[470817] - |
pyproject.toml | 2025-03-25 |
![]() |
[0bfb7c] - |
This package is a replacement for tvdb_v4_official
It uses the newer PyPA namespace packaging system. The modules are these:
pitono.tvdb
pitono.tvdb.tvdb_v4_unofficial
pitono.tvdb.tests
tvdb_v4_unofficial is the original tvdb_v4_official code with minor changes in the constructors: TVDB and Url.
The tvdb module provides the new TVDB and Url classes.
The tests module provides some illustrative methods and can be used to check configuration files and their locations. It uses a class pitono.buildr.tests.Envs0 to change the HOME and PWD directories to differently setup directories in tests/home0 and tests/home1.
Most of the work has been to extend the TVDB object so that it can use configurations that the pitono.weaves.config Config0 object can provide. This can be used to load JSON or NETRC files.
The configuration object Config0 uses defaults from:
~/.netrc with api4.thetvdb.com or a
~/.config/televida-renomo/config.json
There is also a Mock object provided in
from pitono.tvdb.tests import Mock as TVDB
This takes a mock_file keyword that can be used to return a particular pickle file in response to a search.
The sequence to configure a TVDB instance is this:
from pitono.weaves.config import Config0
from pitono.weaves.config2 import NetrcConfigHandler
from pitono.tvdb import TVDB, Mock
defaults0 = Config0(logger=my_logger).defaults()
classes0 = set([NetrcConfigHandler])
kwargs0 = {"classes": classes0}
v0 = Config0().handler(**kwargs0)
if not args.nodo:
tvdb0 = TVDB(config_file=v0)
else:
tvdb0 = Mock(config_file=v0)
The config_file parameter is misnamed. The constructor in TVDB is polymorphic.
The module uses the one from TVDB almost unchanged. There are new constructors for TVDB and Url.
The new constructor for TVDB() has a polymorphic config_file keyword. It calls
Config.instance().get_configuror(config_file=config_file) and config_file either
a text string for a file on the operating system or it can be an instance of a
ConfigHandler that was constructed earlier by the user's code - as illustrated above.
The build system should work, but I develop using a Makefile based system.