Menu

Tree [470817] main /
 History

HTTPS access


File Date Author Commit
 .github 2025-02-05 Walter Eaves Walter Eaves [ded012] -
 bak 2025-02-16 Walter Eaves Walter Eaves [70ebca] refactoring to use pitono.weaves.config
 contrib 2025-03-10 Walter Eaves Walter Eaves [9b2b20] -
 etc 2025-03-13 Walter Eaves Walter Eaves [2bb580] -
 src 2025-03-31 Walter Eaves Walter Eaves [7c07b1] added some test data
 MANIFEST.in 2025-03-15 Walter Eaves Walter Eaves [3f496c] -
 README.md 2025-03-10 Walter Eaves Walter Eaves [9b2b20] -
 defs.mk 2025-03-13 Walter Eaves Walter Eaves [2bb580] -
 fetch0.ipynb 2025-03-25 Walter Eaves Walter Eaves [009149] -
 noxfile.py 2025-02-07 Walter Eaves Walter Eaves [aab212] added legal statements and reformatted
 requirements.txt 2025-02-16 Walter Eaves Walter Eaves [70ebca] refactoring to use pitono.weaves.config
 LICENSE 2025-02-06 Walter Eaves Walter Eaves [67950b] -
 pkls 2025-04-01 Walter Eaves Walter Eaves [470817] -
 pyproject.toml 2025-03-25 Walter Eaves Walter Eaves [0bfb7c] -

Read Me

TVDB unofficial

Python Logo

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.

Want the latest updates on software, tech news, and AI?
Get latest updates about software, tech news, and AI from SourceForge directly in your inbox once a month.