aleph.export module

Contents

aleph.export module

This module is used to put data to Aleph. It is based on custom made webform, which is currently used to report new books by publishers.

Most important function from this module is exportEPublication(), which will do everything, that is needed to do, to export aleph.datastructures.epublication.EPublication structure to the Aleph.

Warning

This whole module is highly dependent on processes, which are defined as import processes at the Czech National Library.

Warning

If you want to use export ability in your library, you should rewrite this and take care, that you are sending data somewhere, where someone will process them. Otherwise, you can fill your library’s database with crap.

Note

Source code of the webform is not available at this moment (it was created by third party), but it is possible, that it will be in future. This will highly depend on number of people, which will use this project.

exception aleph.export.ExportException(message)[source]

Bases: exceptions.Exception

exception aleph.export.ExportRejectedException(message)[source]

Bases: aleph.export.ExportException

exception aleph.export.InvalidISBNException(message)[source]

Bases: aleph.export.ExportException

class aleph.export.PostData(epub)[source]

This class is used to transform data from aleph.datastructures.epublication.EPublication to dictionary, which is sent as POST request to Aleph third-party webform.

Note

Class is used instead of simple function, because there is 29 POST parameters with internal dependencies, which need to be processed and validated before they can be passed to webform.

Parameters:epub (EPublication) – structure, which will be converted
_POST dict

dictionary with parsed data

mapping dict

dictionary with some of mapping, which are aplied to _POST dict in postprocessing

Warning

Don’t manipulate _POST property directly, if you didn’t really know the’internal structure and how the mapping is aplied.

get_POST_data()[source]
Returns:dict – POST data, which can be sent to webform using urllib, or similar library
aleph.export.exportEPublication(epub)[source]

Send epub EPublication object to Aleph, where it will be processed by librarians.

Parameters:epub (EPublication) – structure for export

Contents