Skip to main content

A python module and CLI to facilitate searching Uppsala University's catalog.

Project description

Uppsala pyub

Use Uppsala University's library catalog from the command line or script searches by using this package as a module.

installation

Install with pip

pip install uppsala-pyub

Usage

CLI

Call pyub from the command line with a specific instruction (currently only fetch_bibtext / bib is implemented).

usage example 1

Check the available options with pyub --help

help

...and create advanced searches.

usage example 2

As a Module

Pyub can also be used in scripting. See the api documentation here. For example:

from uppsala_pyub.bibtex import make_bibtex
from uppsala_pyub.query import run_search
from uppsala_pyub.handle_results import display_results

queries = [
	{
		"creator": "marcus garvey"
	},
	{
		"creator": "muysken pieter",
		"resource_type": "books",
		"creation_from": "1999"
		"creation_to": "2003"
	}
]
for query in queries:
	result_soup, url = run_search(query)
	selection = display_results(result_soup, url)
	if selection is not None:
		make_bibtex(selection, output_location='./')

When used in a script, display_results() requires the same user interaction as cli usage.

Implemented "instructions"

fetch_bibtex

The fetch_bibtex instruction constructs a bibtex file from the data returned by the library's search url and saves it in the current working directory. The bibtex key is the same as the filename without the .bib extension. Keys are constructed to be human readable and recognizable by the resource creator and year.

N.b. There are currently no checks in place to prevent pyub from overwriting an existing entry, so take care to quarantine bibtex downloads and manually adjust the key/filename as necessary to disambiguate works by a single author in the same year.

Planned "instructions"

generate_citation

Generate a formatted citation for the selected resource in a given referencing style.

list_links

Get a list of urls to / about the selected resource.

show_physical_locations

List UU libraries that hold the selected resource.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

uppsala_pyub-0.1.2.tar.gz (7.4 kB view details)

Uploaded Source

Built Distribution

uppsala_pyub-0.1.2-py3-none-any.whl (8.6 kB view details)

Uploaded Python 3

File details

Details for the file uppsala_pyub-0.1.2.tar.gz.

File metadata

  • Download URL: uppsala_pyub-0.1.2.tar.gz
  • Upload date:
  • Size: 7.4 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.8.4 CPython/3.12.7 Linux/6.5.0-1025-azure

File hashes

Hashes for uppsala_pyub-0.1.2.tar.gz
Algorithm Hash digest
SHA256 f38f7875abd513b21c830ed9d551738af4eabde911008a3ba8716bfea4c0a5ab
MD5 f283764f136170e552959f63f29862c3
BLAKE2b-256 2e5c95772d74f95192a2f24621d7b9cd7ab93a7232aa36b3189c34acd99843bc

See more details on using hashes here.

File details

Details for the file uppsala_pyub-0.1.2-py3-none-any.whl.

File metadata

  • Download URL: uppsala_pyub-0.1.2-py3-none-any.whl
  • Upload date:
  • Size: 8.6 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.8.4 CPython/3.12.7 Linux/6.5.0-1025-azure

File hashes

Hashes for uppsala_pyub-0.1.2-py3-none-any.whl
Algorithm Hash digest
SHA256 66947692842bd9bf6b6db5de9eae9e9e7616a0447b5959d9c6d759b0a8ded290
MD5 5a8b2acf1dc7765998433601886b5186
BLAKE2b-256 bbb35a5f91d11a9d970178be1756dc3631a798c5d5af7bb4fb7dd9eb2a7aa811

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page