![]() |
Bridges-Python
3.2.0
Bridges(PythonAPI)
|
Classes | |
| class | DataSource |
Functions | |
| def | get_game_data () |
| Get meta data of the IGN games collection. More... | |
| def | parse_actor_movie_imdb (item) |
| Parses an actor movie pair. More... | |
| def | get_actor_movie_imdb_data (count=0) |
| Get ActorMovie IMDB Data. More... | |
| def | get_actor_movie_imdb_data2 () |
| Get ActorMovie IMDB Data. More... | |
| def | get_earthquake_usgs_data (count=0) |
| Get USGS earthquake data. More... | |
| def | get_shakespeare_data (endpoint="", textonly=False) |
| Get data of Shakespeare works (plays, poems) More... | |
| def | get_gutenberg_book_data (num=0) |
| Get meta data of the Gutenberg book collection (1000 books) More... | |
| def | get_cancer_incident_data (num=0) |
| Retrieves the CDC cancer incidence dataset. More... | |
| def | get_song (songTitle, artistName=None) |
| Get data of a particular song (including lyrics) using the Genius API. More... | |
| def | get_song_data () |
| Get data of the songs (including lyrics) using the Genius API. More... | |
| def | get_color_grid_from_assignment |
| Reconstruct a ColorGrid from an existing ColorGrid on the bridges server. More... | |
| def | get_assignment |
| This method retrieves a stored assignment from the server. More... | |
| def | osm_server_request (url) |
| Fulfills a server request for OpenStreetMap. More... | |
| def | get_osm_data (args) |
| def | elevation_server (url) |
| Fulfills a server request for elevation data. More... | |
| def | get_elevation_data (args) |
| def | get_wiki_data_actor_movie (year_begin, year_end) |
| This method retrieves an actor-movie data from Wikidata. More... | |
| def | get_amenity_data (args) |
| This method retrieves amenity data from Open Street Map datasets. More... | |
| def bridges.data_src_dependent.data_source.elevation_server | ( | url | ) |
Fulfills a server request for elevation data.
For internal use only
| def bridges.data_src_dependent.data_source.get_actor_movie_imdb_data | ( | count = 0 | ) |
Get ActorMovie IMDB Data.
Data is retrieved, formatted into a list of ActorMovieIMDB objects
| count | count of the number of actor/movie pairs, but currently unused, returns all records. |
| Exception | if the request fails |
| def bridges.data_src_dependent.data_source.get_actor_movie_imdb_data2 | ( | ) |
Get ActorMovie IMDB Data.
Data is retrieved, formatted into a list of ActorMovieIMDB objects
| count | the number of actor/movie pairs, but currently unused, |
| def bridges.data_src_dependent.data_source.get_amenity_data | ( | args | ) |
This method retrieves amenity data from Open Street Map datasets.
[0]: minimum latitude [1]: minimum longitude [2]: maximum latitude [3]: maximum longitude [4]: amenity type
| or | [0]: location string [1]: amenity type |
Valid types are "food", "school", "firestation", "airport", "heli"
| def bridges.data_src_dependent.data_source.get_assignment | ( | server | ) |
This method retrieves a stored assignment from the server.
| server | server holding the assignment |
| user | the name of the user who uploaded the assignment |
| assignment | assignment number |
| subassignment | sub-assignment number |
| def bridges.data_src_dependent.data_source.get_cancer_incident_data | ( | num = 0 | ) |
Retrieves the CDC cancer incidence dataset.
Returns a list of records. See CancerIncidence class for more information
| num | count of records to be retrieved |
| def bridges.data_src_dependent.data_source.get_color_grid_from_assignment | ( | server | ) |
Reconstruct a ColorGrid from an existing ColorGrid on the bridges server.
This method can be useful in early CS courses like CS1 or CS2 to work with an existing data structure holding a dataset, like an image.
| server | server holding the assignment |
| user | user name |
| assignment | assignment number |
| subassignment | sub-assignment number |
| def bridges.data_src_dependent.data_source.get_earthquake_usgs_data | ( | count = 0 | ) |
Get USGS earthquake data.
USGS Tweet data (https://earthquake.usgs.gov/earthquakes/map/). Data retrieved, formatted into a list of EarthquakeUSGS objects
| count | the number of earthquake records retrieved |
| Exception | if the request fails |
| def bridges.data_src_dependent.data_source.get_elevation_data | ( | args | ) |
| def bridges.data_src_dependent.data_source.get_game_data | ( | ) |
Get meta data of the IGN games collection.
This function retrieves and formats the data into a list of Game objects
| Exception | if the request fails |
| def bridges.data_src_dependent.data_source.get_gutenberg_book_data | ( | num = 0 | ) |
Get meta data of the Gutenberg book collection (1000 books)
This function retrieves, and formats the data into a list of GutenbergBook objects
| Exception | if the request fails |
| def bridges.data_src_dependent.data_source.get_osm_data | ( | args, | |
| OsmData | |||
| ) |
| def bridges.data_src_dependent.data_source.get_shakespeare_data | ( | endpoint = "", |
|
textonly = False |
|||
| ) |
Get data of Shakespeare works (plays, poems)
This function retrieves and formats the data into a a list of Shakespeare objects.
Valid 'poems','plays' Valid format{simple}
| Exception | if the request fails |
| endpoint | can be either "plays" or "poems". If this is specified, then only these types of works are retrieved. |
| textonly | if this is set, then only the text is retrieved. |
| def bridges.data_src_dependent.data_source.get_song | ( | songTitle, | |
artistName = None |
|||
| ) |
Get data of a particular song (including lyrics) using the Genius API.
Data from Genius API(https://docs.genius.com/), given the song title and artist name. Valid http://bridgesdata.herokuapp.com/api/songs/find/ Valid song title, artist name
This function retrieves and formats the data into a Song object. The song if not cached in the local DB is queried and added to the DB
| songTitle | title of song |
| artistName | name of artist |
| Exception | if the request fails |
| def bridges.data_src_dependent.data_source.get_song_data | ( | ) |
Get data of the songs (including lyrics) using the Genius API.
Song data from https://docs.genius.com/. Valid https://bridgesdata.herokuapp.com/api/songs/
This function retrieves and formats the data into a list of Song objects. This version of the API retrieves all the cached songs in the local DB.
| Exception | if the request fails |
| def bridges.data_src_dependent.data_source.get_wiki_data_actor_movie | ( | year_begin, | |
| year_end | |||
| ) |
This method retrieves an actor-movie data from Wikidata.
Usess a sparkl query
| year_begin | beginning year of data request |
| year_end | ending year of data request |
| def bridges.data_src_dependent.data_source.osm_server_request | ( | url | ) |
Fulfills a server request for OpenStreetMap.
For internal use only
| url | url for server to process |
| def bridges.data_src_dependent.data_source.parse_actor_movie_imdb | ( | item | ) |
Parses an actor movie pair.
| item | input actor-movie pair |
1.8.13