diggrtoolbox.zipaccess package

Submodules

diggrtoolbox.zipaccess.zip_access module

Zip Access is a small tool providing access to zipped json files.

class diggrtoolbox.zipaccess.zip_access.ZipAccess(filename, file_ext='.json')[source]

Bases: object

Baseclass for the ZipSingleAccess and ZipMultiAccess classes

json(content_filename=None)[source]

Opens the zipfile and returns the first zipped JSON file as python object

class diggrtoolbox.zipaccess.zip_access.ZipListAccess(filename, file_ext='.json')[source]

Bases: diggrtoolbox.zipaccess.zip_access.ZipAccess

Class to read a Zipfile.

read_archive()[source]

Reads archive zipfile and returns contents as list of dicts.

class diggrtoolbox.zipaccess.zip_access.ZipMultiAccess(filename, file_ext='.json')[source]

Bases: diggrtoolbox.zipaccess.zip_access.ZipAccess

This class is meant to provide access to a Zip file containing one base json file and a folder with other json files extending the first

ZipMultiAccess provides a __getitem__ method to allow more easy access to the contents.

get(file_id)[source]

Returns a specific object, which is not the base object.

Parameters:file_id (str) – Identifier of the object to be returned.
class diggrtoolbox.zipaccess.zip_access.ZipSingleAccess(filename, file_ext='.json')[source]

Bases: diggrtoolbox.zipaccess.zip_access.ZipAccess

This class is meant to provide access to a single JSON-file in a zipfile.

json()[source]

Opens the zipfile and returns the zipped JSON file as python object

Module contents

class diggrtoolbox.zipaccess.ZipSingleAccess(filename, file_ext='.json')[source]

Bases: diggrtoolbox.zipaccess.zip_access.ZipAccess

This class is meant to provide access to a single JSON-file in a zipfile.

json()[source]

Opens the zipfile and returns the zipped JSON file as python object

class diggrtoolbox.zipaccess.ZipMultiAccess(filename, file_ext='.json')[source]

Bases: diggrtoolbox.zipaccess.zip_access.ZipAccess

This class is meant to provide access to a Zip file containing one base json file and a folder with other json files extending the first

ZipMultiAccess provides a __getitem__ method to allow more easy access to the contents.

get(file_id)[source]

Returns a specific object, which is not the base object.

Parameters:file_id (str) – Identifier of the object to be returned.
class diggrtoolbox.zipaccess.ZipListAccess(filename, file_ext='.json')[source]

Bases: diggrtoolbox.zipaccess.zip_access.ZipAccess

Class to read a Zipfile.

read_archive()[source]

Reads archive zipfile and returns contents as list of dicts.