Bridges-Python-3.0.2  3.0.2
Bridges(PythonAPI)
Classes | Functions
bridges.data_src_dependent.data_source Namespace Reference

Classes

class  DataSource
 

Functions

def get_game_data ()
 Get meta data of the IGN games collection. More...
 
def parse_actor_movie_imdb (item)
 
def get_actor_movie_imdb_data (number=0)
 Get ActorMovie IMDB Data retrieved, formatted into a list of ActorMovieIMDB objects. More...
 
def get_actor_movie_imdb_data2 ()
 
def get_earthquake_usgs_data (number=0)
 Get USGS earthquake data USGS Tweet data (https://earthquake.usgs.gov/earthquakes/map/) retrieved, formatted into a list of EarthquakeUSGS objects. 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) This function retrieves, and formats the data into a list of GutenbergBook objects. More...
 
def get_cancer_incident_data (num=0)
 Retrieves the CDC dataset into a vector of records See CancerIncidence class for more information. More...
 
def get_song (songTitle, artistName=None)
 Get data of a particular songs (including lyrics) using the Genius API (https://docs.genius.com/), given the song title and artist name. More...
 
def get_song_data ()
 Get data of the songs (including lyrics) using the Genius API https://docs.genius.com/ Valid endpoints: https://bridgesdata.herokuapp.com/api/songs/. More...
 
def get_color_grid_from_assignment
 Reconstruct a ColorGrid from an existing ColorGrid on the bridges server. More...
 
def get_assignment
 This function obtains the JSON representation of a particular assignment as a string. More...
 
def osm_server_request (url)
 
def get_osm_data (args)
 Takes a location name as a string and returns an OsmData object :param :return: OsmData: More...
 
def elevation_server (url)
 
def get_elevation_data (args)
 This function returns elevation data for the requested location and resolution. More...
 
def get_wiki_data_actor_movie (year_begin, year_end)
 

Function Documentation

◆ elevation_server()

def bridges.data_src_dependent.data_source.elevation_server (   url)

◆ get_actor_movie_imdb_data()

def bridges.data_src_dependent.data_source.get_actor_movie_imdb_data (   number = 0)

Get ActorMovie IMDB Data retrieved, formatted into a list of ActorMovieIMDB objects.

Parameters
numberthe number of actor/movie pairs, but currently unused, returns all records.
Exceptions
Exceptionif the request fails
Returns
a list of ActorMovieIMDB objects, but only actor and movie fields in this version

◆ get_actor_movie_imdb_data2()

def bridges.data_src_dependent.data_source.get_actor_movie_imdb_data2 ( )

◆ get_assignment()

def bridges.data_src_dependent.data_source.get_assignment (   server)

This function obtains the JSON representation of a particular assignment as a string.

:param str server: internal server url of bridges object :param str user: the name of the user who uploaded the assignment :param int assignment: the ID of the assignment to get :param int subassignment: the ID of the subassignment to get (default 0) :return str that is the JSON representation of the subassignment as stored by the bridges server

◆ get_cancer_incident_data()

def bridges.data_src_dependent.data_source.get_cancer_incident_data (   num = 0)

Retrieves the CDC dataset into a vector of records See CancerIncidence class for more information.

◆ get_color_grid_from_assignment()

def bridges.data_src_dependent.data_source.get_color_grid_from_assignment (   server)

Reconstruct a ColorGrid from an existing ColorGrid on the bridges server.

:param str server: internal server url of bridges object :param str user: the name of the user who uploaded the assignment :param int assignment: the ID of the assignment to get :param int subassignment: the ID of the subassignment to get (default 0) :return: ColorGrid: the ColorGrid stored in the bridges server

◆ get_earthquake_usgs_data()

def bridges.data_src_dependent.data_source.get_earthquake_usgs_data (   number = 0)

Get USGS earthquake data USGS Tweet data (https://earthquake.usgs.gov/earthquakes/map/) retrieved, formatted into a list of EarthquakeUSGS objects.

Parameters
numberthe number of earthquake records retrieved, limited to 5000
Exceptions
Exceptionif the request fails
Returns
a list of earthquake records

◆ get_elevation_data()

def bridges.data_src_dependent.data_source.get_elevation_data (   args)

This function returns elevation data for the requested location and resolution.

Note that the data returned may be for a slightly different location and resolution than requested.

:param args[0]: a bounding box, aka an array [minLat, minLon, maxLat, maxLon] :param args[1]: spatial resolution, aka the distance between two samples (in degrees)

:return EleData for the bounding box and resolution requested (approximately)

◆ get_game_data()

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

Exceptions
Exceptionif the request fails
Returns
a list of Game objects,

◆ get_gutenberg_book_data()

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.

Exceptions
Exceptionif the request fails
Returns
a list of GutenbergBook objects,

◆ get_osm_data()

def bridges.data_src_dependent.data_source.get_osm_data (   args,
  OsmData 
)

Takes a location name as a string and returns an OsmData object :param :return: OsmData:

◆ get_shakespeare_data()

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 endpoints: 'poems','plays', <title> Valid queryParams: format{simple}

Exceptions
Exceptionif the request fails
Parameters
endpointcan be either "plays" or "poems". If this is specified, then only these types of works are retrieved.
textOnlyif this is set, then only the text is retrieved.
Returns
an array of Shakespeare objects

◆ get_song()

def bridges.data_src_dependent.data_source.get_song (   songTitle,
  artistName = None 
)

Get data of a particular songs (including lyrics) using the Genius API (https://docs.genius.com/), given the song title and artist name.

Valid endpoints: http://bridgesdata.herokuapp.com/api/songs/find/ Valid queryParams: 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

Exceptions
Exceptionif the request fails
Returns
a Song object,

◆ get_song_data()

def bridges.data_src_dependent.data_source.get_song_data ( )

Get data of the songs (including lyrics) using the Genius API https://docs.genius.com/ Valid endpoints: 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.

Exceptions
Exceptionif the request fails
Returns
a list of Song objects,

◆ get_wiki_data_actor_movie()

def bridges.data_src_dependent.data_source.get_wiki_data_actor_movie (   year_begin,
  year_end 
)

◆ osm_server_request()

def bridges.data_src_dependent.data_source.osm_server_request (   url)

◆ parse_actor_movie_imdb()

def bridges.data_src_dependent.data_source.parse_actor_movie_imdb (   item)