Requests-Raven
Requests-Raven is a custom Requests class to log onto Raven, the University of Cambridge’s central web authentication service.
Installation
$ pip install requests_raven
Documentation
Detailed documentation available at erinhengel.com/software/requests_raven.
Quickstart
The Raven class logs onto Raven and establishes a connection with the host. The session attribute returns a Request Session object with all the methods of the main Requests API.
>>> from requests_raven import Raven
# Establish Raven connection object for the website qje.oxfordjournals.org.
>>> deets = {'userid': 'ab123', 'pwd': 'XXXX'}
>>> conn = Raven(url='http://qje.oxfordjournals.org', login=deets)
# The final destination url looks something like this.
>>> conn.url
'http://libsta28.lib.cam.ac.uk:2314'
# Use session attribute to access Requests methods.
>>> url = '{}/content/130/4/1623.full'.format(conn.url)
>>> request = conn.session.get(url)
>>> request.status_code
200
# Do stuff with your request object.
>>> from bs4 import BeautifulSoup
>>> soup = BeautifulSoup(request.text, 'html.parser')
>>> soup.title
<title>Behavioral Hazard in Health Insurance </title>
JSTOR, EBSCOhost and Wiley are Raven subclasses specifically for logging onto jstor.org, ebscohost.com and onlinelibrary.wiley.com, respectively. They include the html, pdf and ref methods to download the webpage HTML, PDF and bibliographic information of a particular document.
>>> from requests_raven import JSTOR
# Establish Raven connection object for the website jstor.org.
>>> conn = JSTOR(login=deets)
# Download the HTML of the JSTOR webpage for the article with document id 10.1068/682574.
>>> doc_id = '10.1086/682574'
>>> html = conn.html(id=doc_id)
# Download the document PDF.
>>> pdf = conn.pdf(id=doc_id, file='article.pdf')
# Download the bibliographic information.
>>> biblio = conn.ref(id=doc_id)
>>> biblio['authors']
[{'name': 'Per Krusell'}, {'name': 'Anthony A. Smith'}]
Metadata
Release files for requests-raven 0.0.1
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| requests-raven-0.0.1.tar.gz | 8.5 kB | Without provenance | Details for requests-raven-0.0.1.tar.gz |
Release files / requests-raven-0.0.1.tar.gz
| Download URL | requests-raven-0.0.1.tar.gz |
|---|---|
| Size | 8.5 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
d24bba1b4d44b5c7e9b273153d1748ee2973be1b778483bf21e02f11c45e71fd
|
|
BLAKE2b-256 checksum How to use checksums |
c3753da9bc5ed710c1855d24ad1ffebcb62973550130fd31cf612a6efc2a3471
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
Security for requests-raven 0.0.1
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.