dismantle.index package#
Module contents#
Provides the ability to handle package index files.
- class dismantle.index.IndexHandler(path: str, cache_dir: Optional[str] = None)[source]#
Bases:
object
Creates a base index handler to be extended.
- abstract static handles(index: Union[str, pathlib.Path]) bool [source]#
Add interface for checking if a handler can handle index.
- abstract property outdated: bool#
Add interface to check if an index is outdated.
- class dismantle.index.JsonFileIndexHandler(path: str, cache_dir: Optional[str] = None)[source]#
Bases:
dismantle.index._handlers.IndexHandler
Local file handler.
- static handles(index: Union[str, pathlib.Path]) bool [source]#
Check if the index format is file:// or a path.
- property outdated: bool#
Check if the index is outdated.
- class dismantle.index.JsonUrlIndexHandler(index: str, cache_dir: Optional[str] = None)[source]#
Bases:
dismantle.index._handlers.IndexHandler
Use a json file located on a remote server.
- static handles(index: Union[str, pathlib.Path]) bool [source]#
Check if the index format is file:// or a path.
- property outdated: bool#
Check if an index is outdated.
Execute a head request using the requests library to check that the ETag matches.