Skip to content

An API for calling Visual Library Metadata from a server.

License

Notifications You must be signed in to change notification settings

ubffm/python-visual-library

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

72 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Visual Library Toolkit

This Python package allows calling the Visual Library (VL) OAI and create Python objects from the response. You should be able to call any VL ID, disregarding if it is a journal, an issue, or an article. Data of depending entities (for example articles of an issue) are called recursively and automatically.

Usage

You simply create a VL object by

from VisualLibrary import VisualLibrary

vl = VisualLibrary()

# Create an object of a journal
journal = vl.get_element_for_id('12345')

# Create an object of an article
# It's the same, the data context will be evaluated internally
article = vl.get_element_for_id('87453')

# Get only the XML data from the VL as a BeautifulSoup object
xml_data = vl.get_data_for_id('12345')

# You can also call for data of a single page. However, this is a very
# "expensive" task, because Python has to look up to which article the
# given page belongs.
page = vl.get_page_by_id('10823391')

Customize called URL

The current default URL is for the Visual Library of the University Library in Frankfurt. However, if you want/need to change this, you can simple set VisualLibrary.VISUAL_LIBRARY_OAI_URL to the URL of your liking.

Install package

Simply call

source {path_to_your_virtual_environment}/bin/activate

cd virtual-library/
pip3 install .

pip3 install -r requirements.txt

Testing

After installing the package, you can call pytest tests/*py to run all tests.

About

An API for calling Visual Library Metadata from a server.

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages