Python package to search for basic university information. This packages obtains information from Hipo/university-domains-list's database. It is fully compatible with Python 2.6 and up.
Your preference should be to use PyPi:
pip install universities
Source and wheel distributions are available in the releases tab as well.
import universities uni = universities.API() # can specify encoding for use in Python 2 canadian = uni.search(country = "Canada") only_mit = uni.search(domain = "mit.edu") all_data = uni.get_all() waterloo = uni.lucky(name = "Waterloo") # As in "I'm feeling lucky"
universities.searchsearches the entire database for universities matching the specified critera. You may filter by
countryas arguments to
search. This returns a list of
universities.luckyis an alias for
searchwhich only returns the first result of the search. All the same parameters are available, and a single
universities.get_allreturns all of the entries in the database, in the same format as
search. In fact, this is simply an alias for
searchthat uses no arguments.
Any query which reurns multiple objects will return a Generator.
universities.models.Universityis the basic model returned in all requests. It contains six fields:
name: The name of the university.
domains: A list of domain names the university uses (for emails, etc).
web_pages: A list of web pages associated with the university.
country_code: The two-letter ISO-3166 country code where the university is located.
stateprov: The state or province the university is located. This is usually not populated.
country: The full country name where the university is located.
The only requirement is
- Clone/fork the git repository.
cdto the directory and install the requirements if necessary:
pip install -r requirements.txt
- Edit to your heart's content!
- If you wish to contribute, push your changes to GitHub on your own fork and make a pull request.
Note: Any contributions should be made following the PEP8 standard.