info()
The info() function provides guidelines for using Connector.
info() can be called using a Connector object, without parameters:
from dataprep.connector import connect, info # Access tokens can be accessed generated here: https://www.yelp.com/developers/documentation/v3/authentication dc = connect('yelp', _auth={'access_token':'cCMHU4M4t7rdt*********vp3whGzFjgIKIm0'}) dc.info()
Or by specifying the API to query as a parameter:
info('yelp')
config_path is the path to the folder containing configuration files. There are two ways to load configuration files. Details can be found in the previous configuraton file section.
config_path
update is used to specify if new configuration files should be pulled from the GitHub repo where up to date configuration files are hosted.
update
Table displays table(s) of data that can be accessed. Each table has a corresponding API endpoint which will be queried automatically by connector.
Table
Parameters identifies parameters that can be used in the query function to access specific data. info() indicates if the parameter is required for all queries of the specified table.
Parameters
Examples shows how methods of the Connector class can be called. The access_token value must be replaced with an authorization key that can be generated by following instructions on the developer website of the API.
Examples
Schema displays column names and column data types of the DataFrame returned by the query function.
Schema
Below shows the case for the Yelp website. You can see:
Yelp has one table: “businesses”.
The businesses table has seven parameters: location, term, latitude, longitude, limit, categories and sort_by. The location parameter is required, while the other parameters are optional.
The example shows how to connect and query Yelp. More details can be found in the “connect” and “query” sections.
The schema shows there will be 20 columns of data returned. Each row of the schema displays a column name and its corresponding data type. For example the “name” and “image_url” columns contain string data while “latitude” and “longitude” columns contain float data.
from dataprep.connector import info info('yelp', update=True)