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 find() Optional[list][source]#

Add interface to index finder.

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.

abstract packages() Dict[source]#

Add the ability to extend __getitem__.

abstract update() bool[source]#

Add interface for extendable updater.

class dismantle.index.JsonFileIndexHandler(path: str, cache_dir: Optional[str] = None)[source]#

Bases: dismantle.index._handlers.IndexHandler

Local file handler.

find(value: str) Optional[list][source]#

Find packages matching a specified value.

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.

packages() Dict[source]#

Return the list of packages defined.

update() bool[source]#

Update the index file.

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.

find(value: str) Optional[list][source]#

Find packages matching a specified value.

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.

packages() Dict[source]#

Return the list of packages defined.

update() None[source]#

Update the index file if its outdated.