Skip to main content
https://badge.fury.io/py/PennSDK.png https://travis-ci.org/pennlabs/penn-sdk-python.svg

Penn SDK is the Python library for writing code that interfaces with University of Pennsylvania data. It consists of wrappers for the Registrar, Dining, and Directory API’s

Getting an API key

To use these libraries, you must first obtain an API token and password, which can be done here. There are separate API tokens and password for each of dining, registrar, news/events/maps, transit, and directory.

There is also a Laundry API, Study Spaces API, and Calendar, which don’t need a key.

Documentation

The full API documentation can be found at https://esb.isc-seo.upenn.edu/8091/documentation/.

Documentation for the wrapper can be found at http://penn-sdk.readthedocs.org/

Installation

You can install PennSDK easily using pip

$ sudo pip install PennSDK

easy_install also works

# sudo easy_install PennSDK

Getting Started

Once you have an API token and Password, you can use the wrapper as follows.

from penn import Registrar

REG_USERNAME = 'MY_REGISTAR_USERNAME'
REG_PASSWORD = 'MY_REGISTRAR_PASSWORD'

r = Registrar(REG_USERNAME, REG_PASSWORD)

cis120 = r.course('cis', '120')

# cis120 is a dictionary parsed from the API json
my_data = cis120['result_data']

All of other services (Dining, Directory, Transit, News, Map) follow this same basic format, except for the Laundry, Study Spaces, and Calendar API’s, which don’t need a username and password passed in at initialization. Refer to the wrapper documentation at http://penn-sdk.readthedocs.org/ for more info.

Running Tests

Once you have an API token and password, you can run the tests by creating a tests/credentials.py file with them as constants. Depending on what you want to test, include the following variables. They will be retrieved from your environment variables by default.

REG_USERNAME = 'MY_REGISTAR_USERNAME'
REG_PASSWORD = 'MY_REGISTAR_PASSWORD'

DIN_USERNAME = 'MY_DINING_USERNAME'
DIN_PASSWORD = 'MY_DINING_PASSWORD'

DIR_USERNAME = 'MY_DIRECTORY_USERNAME'
DIR_PASSWORD = 'MY_DIRECTORY_PASSWORD'

TRANSIT_USERNAME = 'MY_DIRECTORY_USERNAME'
TRANSIT_PASSWORD = 'MY_DIRECTORY_PASSWORD'

LIBCAL_ID = 'MY_LIBCAL_ID'
LIBCAL_SECRET = 'MY_LIBCAL_SECRET'

Then run make test to run all tests in your shell.

Contributing & Bug Reporting

If you find a bug, please submit it through the GitHub issues page.

Pull requests are welcome!

Release files for PennSDK 1.6.9

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for PennSDK 1.6.9
File Size Uploaded
PennSDK-1.6.9.tar.gz 15.6 kB Details

Built distributions (wheels)

Table of built distributions (wheels) for PennSDK 1.6.9
File Interpreter ABI Platform
PennSDK-1.6.9-py3-none-any.whl Python 3 none any Details
PennSDK-1.6.9-py2-none-any.whl Python 2 none any Details

Total release size: 56.6 kB

Release files / PennSDK-1.6.9.tar.gz

Download URL PennSDK-1.6.9.tar.gz
Size 15.6 kB
Tags Source
SHA-256 checksum
How to use checksums
566f228c76b5791a6b970cc16d722f1cf5e4ff6fccee981a7f070b52dec26974
BLAKE2b-256 checksum
How to use checksums
84630f7fb6e907fc748e4339e715636e5572aac421f85033cf011f599da9cf56
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No

Release files / PennSDK-1.6.9-py3-none-any.whl

Download URL PennSDK-1.6.9-py3-none-any.whl
Size 20.5 kB
Tags Python 3
SHA-256 checksum
How to use checksums
f9ed80750f6078e41ea01d8af2b46a95111d27acb60ceaa61f18411c90e2d6aa
BLAKE2b-256 checksum
How to use checksums
183e1cb36cf6053514ae23c682af8c4f7bf0351c275371dfb741ec417947500a
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No

Release files / PennSDK-1.6.9-py2-none-any.whl

Download URL PennSDK-1.6.9-py2-none-any.whl
Size 20.5 kB
Tags Python 2
SHA-256 checksum
How to use checksums
121d8a440d19918c52ad6b5672271412fc8b9423c399c070083cbee43a32237f
BLAKE2b-256 checksum
How to use checksums
7e10e7481866a3602efa12791e8c78d8b7c4253a7676d7e60c21ce4971e37118
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No

Release history Release notifications | RSS feed

1.8.9

2 release files

1.8.7

2 release files

1.8.6

2 release files

1.8.3

2 release files

1.8.2

2 release files

1.8.1

2 release files

1.8

2 release files

1.7.1

2 release files

1.7.0

3 release files

This release

1.6.9 This release

3 release files

1.6.8

2 release files

1.6.7

3 release files

1.6.6

3 release files

1.6.5

3 release files

1.6.4

3 release files

1.6.3

3 release files

1.6.2

2 release files

1.6.1

3 release files

1.5.3

3 release files

1.5.2

3 release files

1.5.1

3 release files

1.5.0

3 release files

1.4.0

3 release files

1.3.2

2 release files

1.3.1

3 release files

1.2.1

3 release files

1.2

1 release file

1.1

1 release file

1.0.1

1 release file

1.0

1 release file

0.1.4.1

1 release file

0.1.4

1 release file

0.1.3

1 release file

0.1.2

1 release file

0.1.1

1 release file

0.1.0

1 release file

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page