python sdk for Glance API
Project description
stare
The python wrapper for the Glance API.
Environment Variables
See stare/settings/base.py for all environment variables that can be set. All environment variables for this package are prefixed with STARE
. As of now, there are:
STARE_USERNAME
: CERN account usernameSTARE_PASSWORD
: CERN account passwordSTARE_AUTH_URL
: authentication serverSTARE_SITE_URL
: API serverSTARE_CASSETTE_LIBRARY_DIR
: for tests, where to store recorded requests/responses
CLI Usage
Use stare --help
for the various options provided.
Python Usage
import stare
glance = stare.Glance()
# get publication information of a publication
pub_info = glance.publication('HDBS-2018-33')
# get publications for a given activity/reference code (see table below)
pubs = glance.publications(activity_id=26, reference_code='HIGG')
Activity IDs
Activity IDs are currently in a different API project (under SCAB Nominations) which SUSY conveners have access to. For now, this is a partial list to make it easier.
ID | CODE | NAME |
---|---|---|
36 | SUSY | SUSY |
37 | BGF | Background forum |
38 | CDM | Common Dark Matter |
39 | TGSK | 3rd generation squarks |
40 | EW | EW |
41 | ISG | InclSqGl |
42 | RPVL | RPVLL |
43 | RVEW | SUSY Review |
199 | STPR | Strong production |
200 | RUN2 | Run2 Summaries |
SSL
In order to get SSL handshakes working (certificate verification), one needs to make sure we add/trust the CERN Certification Authorities (CA) for both the Root and the Grid CAs. Specifically, we rely on the Root CA to sign/issue the Grid CA. The Grid CA is what's relied on for the SSL chain. To make this happen, we'll need both PEM for each CA combined into a single CERN_chain.pem
file which is bundled up with this package.
Going to the CERN CA Files website and downloading the CERN Root Certification Authority 2 (DER file) and CERN Grid Certification Authority (PEM file). We can then convert the DER to PEM as follows (for the Root CA):
openssl x509 -in CERN_ROOT_CA_2.crt -inform der -outform pem -out CERN_ROOT_CA_2.pem
and then combine the two
cat CERN_GRID_CA_2.pem CERN_ROOT_CA_2.pem > CERN_chain.pem
This can be passed into any python requests::Session
via verify='/path/to/CERN_chain.pem'
and SSL verification should work.
[1] DER vs PEM?
Reference
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
File details
Details for the file stare-0.1.2.tar.gz
.
File metadata
- Download URL: stare-0.1.2.tar.gz
- Upload date:
- Size: 30.2 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.2.0 pkginfo/1.6.1 requests/2.25.0 setuptools/50.3.2 requests-toolbelt/0.9.1 tqdm/4.53.0 CPython/3.7.9
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 62f3284d8e24d9939f88dcc16a4aecdd84748601a8826901624fd11bd49ae2a0 |
|
MD5 | b5bf109c06cb253551ddd8a3d7caeaab |
|
BLAKE2b-256 | 30c0a0facb0719c51c9679be83d70c2a31f5e3452ba90588e5491a5996fa080b |
File details
Details for the file stare-0.1.2-py2.py3-none-any.whl
.
File metadata
- Download URL: stare-0.1.2-py2.py3-none-any.whl
- Upload date:
- Size: 17.0 kB
- Tags: Python 2, Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.2.0 pkginfo/1.6.1 requests/2.25.0 setuptools/50.3.2 requests-toolbelt/0.9.1 tqdm/4.53.0 CPython/3.7.9
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | ba08e7903f307ea90f4229c92fe1436b4ec5b6c10042ef10d71b2469d195eb78 |
|
MD5 | f833cfbe77a17416a939e2060752b8e0 |
|
BLAKE2b-256 | ab170e70de98abc78d7c7dbb73f44484ac7d374953c904a828c6b7168af2c87a |