repository_name
stringlengths
5
67
func_path_in_repository
stringlengths
4
234
func_name
stringlengths
0
314
whole_func_string
stringlengths
52
3.87M
language
stringclasses
6 values
func_code_string
stringlengths
52
3.87M
func_documentation_string
stringlengths
1
47.2k
func_code_url
stringlengths
85
339
datadotworld/data.world-py
datadotworld/client/api.py
RestApiClient.create_insight
def create_insight(self, project_key, **kwargs): """Create a new insight :param project_key: Project identifier, in the form of projectOwner/projectid :type project_key: str :param title: Insight title :type title: str :param description: Insight description. ...
python
def create_insight(self, project_key, **kwargs): """Create a new insight :param project_key: Project identifier, in the form of projectOwner/projectid :type project_key: str :param title: Insight title :type title: str :param description: Insight description. ...
Create a new insight :param project_key: Project identifier, in the form of projectOwner/projectid :type project_key: str :param title: Insight title :type title: str :param description: Insight description. :type description: str, optional :param image_u...
https://github.com/datadotworld/data.world-py/blob/ffaeb115f358731ab0b805b0c43b7ff2e3cf0a77/datadotworld/client/api.py#L1149-L1202
datadotworld/data.world-py
datadotworld/client/api.py
RestApiClient.replace_insight
def replace_insight(self, project_key, insight_id, **kwargs): """Replace an insight. :param project_key: Projrct identifier, in the form of projectOwner/projectid :type project_key: str :param insight_id: Insight unique identifier. :type insight_id: str :param ti...
python
def replace_insight(self, project_key, insight_id, **kwargs): """Replace an insight. :param project_key: Projrct identifier, in the form of projectOwner/projectid :type project_key: str :param insight_id: Insight unique identifier. :type insight_id: str :param ti...
Replace an insight. :param project_key: Projrct identifier, in the form of projectOwner/projectid :type project_key: str :param insight_id: Insight unique identifier. :type insight_id: str :param title: Insight title :type title: str :param description: I...
https://github.com/datadotworld/data.world-py/blob/ffaeb115f358731ab0b805b0c43b7ff2e3cf0a77/datadotworld/client/api.py#L1204-L1258
datadotworld/data.world-py
datadotworld/client/api.py
RestApiClient.update_insight
def update_insight(self, project_key, insight_id, **kwargs): """Update an insight. **Note that only elements included in the request will be updated. All omitted elements will remain untouched. :param project_key: Projrct identifier, in the form of projectOwner/projectid ...
python
def update_insight(self, project_key, insight_id, **kwargs): """Update an insight. **Note that only elements included in the request will be updated. All omitted elements will remain untouched. :param project_key: Projrct identifier, in the form of projectOwner/projectid ...
Update an insight. **Note that only elements included in the request will be updated. All omitted elements will remain untouched. :param project_key: Projrct identifier, in the form of projectOwner/projectid :type project_key: str :param insight_id: Insight unique identi...
https://github.com/datadotworld/data.world-py/blob/ffaeb115f358731ab0b805b0c43b7ff2e3cf0a77/datadotworld/client/api.py#L1260-L1306
datadotworld/data.world-py
datadotworld/client/api.py
RestApiClient.delete_insight
def delete_insight(self, project_key, insight_id): """Delete an existing insight. :params project_key: Project identifier, in the form of projectOwner/projectId :type project_key: str :params insight_id: Insight unique id :type insight_id: str :raises RestApiExce...
python
def delete_insight(self, project_key, insight_id): """Delete an existing insight. :params project_key: Project identifier, in the form of projectOwner/projectId :type project_key: str :params insight_id: Insight unique id :type insight_id: str :raises RestApiExce...
Delete an existing insight. :params project_key: Project identifier, in the form of projectOwner/projectId :type project_key: str :params insight_id: Insight unique id :type insight_id: str :raises RestApiException: If a server error occurs Examples ----...
https://github.com/datadotworld/data.world-py/blob/ffaeb115f358731ab0b805b0c43b7ff2e3cf0a77/datadotworld/client/api.py#L1308-L1331
datadotworld/data.world-py
datadotworld/util.py
parse_dataset_key
def parse_dataset_key(dataset_key): """Parse a dataset URL or path and return the owner and the dataset id :param dataset_key: Dataset key (in the form of owner/id) or dataset URL :type dataset_key: str :returns: User name of the dataset owner and ID of the dataset :rtype: dataset_owner, dataset_id...
python
def parse_dataset_key(dataset_key): """Parse a dataset URL or path and return the owner and the dataset id :param dataset_key: Dataset key (in the form of owner/id) or dataset URL :type dataset_key: str :returns: User name of the dataset owner and ID of the dataset :rtype: dataset_owner, dataset_id...
Parse a dataset URL or path and return the owner and the dataset id :param dataset_key: Dataset key (in the form of owner/id) or dataset URL :type dataset_key: str :returns: User name of the dataset owner and ID of the dataset :rtype: dataset_owner, dataset_id :raises ValueError: If the provided ke...
https://github.com/datadotworld/data.world-py/blob/ffaeb115f358731ab0b805b0c43b7ff2e3cf0a77/datadotworld/util.py#L32-L54
datadotworld/data.world-py
datadotworld/util.py
LazyLoadedDict.from_keys
def from_keys(cls, keys, loader_func, type_hint=None): """Factory method for `LazyLoadedDict` Accepts a ``loader_func`` that is to be applied to all ``keys``. :param keys: List of keys to create the dictionary with :type keys: iterable :param loader_func: Function to be applied...
python
def from_keys(cls, keys, loader_func, type_hint=None): """Factory method for `LazyLoadedDict` Accepts a ``loader_func`` that is to be applied to all ``keys``. :param keys: List of keys to create the dictionary with :type keys: iterable :param loader_func: Function to be applied...
Factory method for `LazyLoadedDict` Accepts a ``loader_func`` that is to be applied to all ``keys``. :param keys: List of keys to create the dictionary with :type keys: iterable :param loader_func: Function to be applied to all keys :type loader_func: function :param ty...
https://github.com/datadotworld/data.world-py/blob/ffaeb115f358731ab0b805b0c43b7ff2e3cf0a77/datadotworld/util.py#L78-L94
datadotworld/data.world-py
datadotworld/client/_swagger/models/file_create_or_update_request.py
FileCreateOrUpdateRequest.name
def name(self, name): """ Sets the name of this FileCreateOrUpdateRequest. File name. Should include type extension always when possible. Must not include slashes. :param name: The name of this FileCreateOrUpdateRequest. :type: str """ if name is None: ...
python
def name(self, name): """ Sets the name of this FileCreateOrUpdateRequest. File name. Should include type extension always when possible. Must not include slashes. :param name: The name of this FileCreateOrUpdateRequest. :type: str """ if name is None: ...
Sets the name of this FileCreateOrUpdateRequest. File name. Should include type extension always when possible. Must not include slashes. :param name: The name of this FileCreateOrUpdateRequest. :type: str
https://github.com/datadotworld/data.world-py/blob/ffaeb115f358731ab0b805b0c43b7ff2e3cf0a77/datadotworld/client/_swagger/models/file_create_or_update_request.py#L77-L94
datadotworld/data.world-py
datadotworld/client/_swagger/models/file_create_or_update_request.py
FileCreateOrUpdateRequest.labels
def labels(self, labels): """ Sets the labels of this FileCreateOrUpdateRequest. File labels. :param labels: The labels of this FileCreateOrUpdateRequest. :type: list[str] """ allowed_values = ["raw data", "documentation", "visualization", "clean data", "script",...
python
def labels(self, labels): """ Sets the labels of this FileCreateOrUpdateRequest. File labels. :param labels: The labels of this FileCreateOrUpdateRequest. :type: list[str] """ allowed_values = ["raw data", "documentation", "visualization", "clean data", "script",...
Sets the labels of this FileCreateOrUpdateRequest. File labels. :param labels: The labels of this FileCreateOrUpdateRequest. :type: list[str]
https://github.com/datadotworld/data.world-py/blob/ffaeb115f358731ab0b805b0c43b7ff2e3cf0a77/datadotworld/client/_swagger/models/file_create_or_update_request.py#L156-L172
datadotworld/data.world-py
datadotworld/client/_swagger/models/web_credentials.py
WebCredentials.user
def user(self, user): """ Sets the user of this WebCredentials. The name of the account to login to. :param user: The user of this WebCredentials. :type: str """ if user is None: raise ValueError("Invalid value for `user`, must not be `None`") ...
python
def user(self, user): """ Sets the user of this WebCredentials. The name of the account to login to. :param user: The user of this WebCredentials. :type: str """ if user is None: raise ValueError("Invalid value for `user`, must not be `None`") ...
Sets the user of this WebCredentials. The name of the account to login to. :param user: The user of this WebCredentials. :type: str
https://github.com/datadotworld/data.world-py/blob/ffaeb115f358731ab0b805b0c43b7ff2e3cf0a77/datadotworld/client/_swagger/models/web_credentials.py#L67-L80
datadotworld/data.world-py
datadotworld/client/_swagger/models/web_credentials.py
WebCredentials.password
def password(self, password): """ Sets the password of this WebCredentials. The secret password. This field is write-only. It is omitted by read operations. If authorization is required, the `password` value must be provided whenever a File Source is created or modified. An update to a dataset...
python
def password(self, password): """ Sets the password of this WebCredentials. The secret password. This field is write-only. It is omitted by read operations. If authorization is required, the `password` value must be provided whenever a File Source is created or modified. An update to a dataset...
Sets the password of this WebCredentials. The secret password. This field is write-only. It is omitted by read operations. If authorization is required, the `password` value must be provided whenever a File Source is created or modified. An update to a dataset that does not change the File Source may omit the...
https://github.com/datadotworld/data.world-py/blob/ffaeb115f358731ab0b805b0c43b7ff2e3cf0a77/datadotworld/client/_swagger/models/web_credentials.py#L94-L105
datadotworld/data.world-py
datadotworld/client/_swagger/models/oauth_token_reference.py
OauthTokenReference.owner
def owner(self, owner): """ Sets the owner of this OauthTokenReference. User name of the owner of the OAuth token within data.world. :param owner: The owner of this OauthTokenReference. :type: str """ if owner is None: raise ValueError("Invalid value ...
python
def owner(self, owner): """ Sets the owner of this OauthTokenReference. User name of the owner of the OAuth token within data.world. :param owner: The owner of this OauthTokenReference. :type: str """ if owner is None: raise ValueError("Invalid value ...
Sets the owner of this OauthTokenReference. User name of the owner of the OAuth token within data.world. :param owner: The owner of this OauthTokenReference. :type: str
https://github.com/datadotworld/data.world-py/blob/ffaeb115f358731ab0b805b0c43b7ff2e3cf0a77/datadotworld/client/_swagger/models/oauth_token_reference.py#L70-L87
datadotworld/data.world-py
datadotworld/client/_swagger/models/oauth_token_reference.py
OauthTokenReference.site
def site(self, site): """ Sets the site of this OauthTokenReference. :param site: The site of this OauthTokenReference. :type: str """ if site is None: raise ValueError("Invalid value for `site`, must not be `None`") if site is not None and len(site) ...
python
def site(self, site): """ Sets the site of this OauthTokenReference. :param site: The site of this OauthTokenReference. :type: str """ if site is None: raise ValueError("Invalid value for `site`, must not be `None`") if site is not None and len(site) ...
Sets the site of this OauthTokenReference. :param site: The site of this OauthTokenReference. :type: str
https://github.com/datadotworld/data.world-py/blob/ffaeb115f358731ab0b805b0c43b7ff2e3cf0a77/datadotworld/client/_swagger/models/oauth_token_reference.py#L100-L116
datadotworld/data.world-py
datadotworld/client/_swagger/apis/sql_api.py
SqlApi.sql_get
def sql_get(self, owner, id, query, **kwargs): """ SQL query (via GET) This endpoint executes SQL queries against a dataset. SQL results are available in a variety of formats. By default, `application/json` will be returned. Set the `Accept` header to one of the following values in accordance w...
python
def sql_get(self, owner, id, query, **kwargs): """ SQL query (via GET) This endpoint executes SQL queries against a dataset. SQL results are available in a variety of formats. By default, `application/json` will be returned. Set the `Accept` header to one of the following values in accordance w...
SQL query (via GET) This endpoint executes SQL queries against a dataset. SQL results are available in a variety of formats. By default, `application/json` will be returned. Set the `Accept` header to one of the following values in accordance with your preference: * `text/csv` * `application/json` * `applicat...
https://github.com/datadotworld/data.world-py/blob/ffaeb115f358731ab0b805b0c43b7ff2e3cf0a77/datadotworld/client/_swagger/apis/sql_api.py#L43-L70
datadotworld/data.world-py
datadotworld/client/_swagger/apis/sql_api.py
SqlApi.sql_post
def sql_post(self, owner, id, query, **kwargs): """ SQL query This endpoint executes SQL queries against a dataset. SQL results are available in a variety of formats. By default, `application/json` will be returned. Set the `Accept` header to one of the following values in accordance with your ...
python
def sql_post(self, owner, id, query, **kwargs): """ SQL query This endpoint executes SQL queries against a dataset. SQL results are available in a variety of formats. By default, `application/json` will be returned. Set the `Accept` header to one of the following values in accordance with your ...
SQL query This endpoint executes SQL queries against a dataset. SQL results are available in a variety of formats. By default, `application/json` will be returned. Set the `Accept` header to one of the following values in accordance with your preference: * `text/csv` * `application/json` * `application/json-l...
https://github.com/datadotworld/data.world-py/blob/ffaeb115f358731ab0b805b0c43b7ff2e3cf0a77/datadotworld/client/_swagger/apis/sql_api.py#L167-L194
datadotworld/data.world-py
datadotworld/client/_swagger/models/file_source_create_request.py
FileSourceCreateRequest.url
def url(self, url): """ Sets the url of this FileSourceCreateRequest. Source URL of file. Must be an http, https. :param url: The url of this FileSourceCreateRequest. :type: str """ if url is None: raise ValueError("Invalid value for `url`, must not b...
python
def url(self, url): """ Sets the url of this FileSourceCreateRequest. Source URL of file. Must be an http, https. :param url: The url of this FileSourceCreateRequest. :type: str """ if url is None: raise ValueError("Invalid value for `url`, must not b...
Sets the url of this FileSourceCreateRequest. Source URL of file. Must be an http, https. :param url: The url of this FileSourceCreateRequest. :type: str
https://github.com/datadotworld/data.world-py/blob/ffaeb115f358731ab0b805b0c43b7ff2e3cf0a77/datadotworld/client/_swagger/models/file_source_create_request.py#L96-L113
datadotworld/data.world-py
datadotworld/client/_swagger/apis/uploads_api.py
UploadsApi.upload_file
def upload_file(self, owner, id, name, **kwargs): """ Upload file Upload one file at a time to a dataset. This endpoint expects requests of type `application/octet-stream`. For example, assuming that you want to upload a local file named `file1.csv` to a hypothetical dataset `https://data.worl...
python
def upload_file(self, owner, id, name, **kwargs): """ Upload file Upload one file at a time to a dataset. This endpoint expects requests of type `application/octet-stream`. For example, assuming that you want to upload a local file named `file1.csv` to a hypothetical dataset `https://data.worl...
Upload file Upload one file at a time to a dataset. This endpoint expects requests of type `application/octet-stream`. For example, assuming that you want to upload a local file named `file1.csv` to a hypothetical dataset `https://data.world/awesome-user/awesome-dataset` and choose its name on data.world to b...
https://github.com/datadotworld/data.world-py/blob/ffaeb115f358731ab0b805b0c43b7ff2e3cf0a77/datadotworld/client/_swagger/apis/uploads_api.py#L43-L70
datadotworld/data.world-py
datadotworld/client/_swagger/apis/uploads_api.py
UploadsApi.upload_files
def upload_files(self, owner, id, file, **kwargs): """ Upload files Upload multiple files at once to a dataset via multipart request. This endpoint expects requests of type `multipart/form-data` and you can include one or more parts named `file`, each containing a different file to be uploaded....
python
def upload_files(self, owner, id, file, **kwargs): """ Upload files Upload multiple files at once to a dataset via multipart request. This endpoint expects requests of type `multipart/form-data` and you can include one or more parts named `file`, each containing a different file to be uploaded....
Upload files Upload multiple files at once to a dataset via multipart request. This endpoint expects requests of type `multipart/form-data` and you can include one or more parts named `file`, each containing a different file to be uploaded. For example, assuming that, you want to upload two local files named ...
https://github.com/datadotworld/data.world-py/blob/ffaeb115f358731ab0b805b0c43b7ff2e3cf0a77/datadotworld/client/_swagger/apis/uploads_api.py#L175-L202
datadotworld/data.world-py
datadotworld/datadotworld.py
DataDotWorld.query
def query(self, dataset_key, query, query_type="sql", parameters=None): """Query an existing dataset :param dataset_key: Dataset identifier, in the form of owner/id or of a url :type dataset_key: str :param query: SQL or SPARQL query :type query: str :param q...
python
def query(self, dataset_key, query, query_type="sql", parameters=None): """Query an existing dataset :param dataset_key: Dataset identifier, in the form of owner/id or of a url :type dataset_key: str :param query: SQL or SPARQL query :type query: str :param q...
Query an existing dataset :param dataset_key: Dataset identifier, in the form of owner/id or of a url :type dataset_key: str :param query: SQL or SPARQL query :type query: str :param query_type: The type of the query. Must be either 'sql' or 'sparql'. (De...
https://github.com/datadotworld/data.world-py/blob/ffaeb115f358731ab0b805b0c43b7ff2e3cf0a77/datadotworld/datadotworld.py#L61-L114
datadotworld/data.world-py
datadotworld/datadotworld.py
DataDotWorld.load_dataset
def load_dataset(self, dataset_key, force_update=False, auto_update=False): """Load a dataset from the local filesystem, downloading it from data.world first, if necessary. This function returns an object of type `LocalDataset`. The object allows access to metedata via it's `describe()`...
python
def load_dataset(self, dataset_key, force_update=False, auto_update=False): """Load a dataset from the local filesystem, downloading it from data.world first, if necessary. This function returns an object of type `LocalDataset`. The object allows access to metedata via it's `describe()`...
Load a dataset from the local filesystem, downloading it from data.world first, if necessary. This function returns an object of type `LocalDataset`. The object allows access to metedata via it's `describe()` method and to all the data via three properties `raw_data`, `tables` and `data...
https://github.com/datadotworld/data.world-py/blob/ffaeb115f358731ab0b805b0c43b7ff2e3cf0a77/datadotworld/datadotworld.py#L116-L199
datadotworld/data.world-py
datadotworld/datadotworld.py
DataDotWorld.open_remote_file
def open_remote_file(self, dataset_key, file_name, mode='w', **kwargs): """Open a remote file object that can be used to write to or read from a file in a data.world dataset :param dataset_key: Dataset identifier, in the form of owner/id :type dataset_key: str ...
python
def open_remote_file(self, dataset_key, file_name, mode='w', **kwargs): """Open a remote file object that can be used to write to or read from a file in a data.world dataset :param dataset_key: Dataset identifier, in the form of owner/id :type dataset_key: str ...
Open a remote file object that can be used to write to or read from a file in a data.world dataset :param dataset_key: Dataset identifier, in the form of owner/id :type dataset_key: str :param file_name: The name of the file to open :type file_name: str :param mode: the ...
https://github.com/datadotworld/data.world-py/blob/ffaeb115f358731ab0b805b0c43b7ff2e3cf0a77/datadotworld/datadotworld.py#L201-L282
datadotworld/data.world-py
datadotworld/client/_swagger/apis/datasets_api.py
DatasetsApi.add_files_by_source
def add_files_by_source(self, owner, id, body, **kwargs): """ Add files This method allows files published on the web to be added to a data.world dataset via their URL. The source URL will be stored so you can easily update your file anytime it changes via the *fetch latest* link on the [data.wo...
python
def add_files_by_source(self, owner, id, body, **kwargs): """ Add files This method allows files published on the web to be added to a data.world dataset via their URL. The source URL will be stored so you can easily update your file anytime it changes via the *fetch latest* link on the [data.wo...
Add files This method allows files published on the web to be added to a data.world dataset via their URL. The source URL will be stored so you can easily update your file anytime it changes via the *fetch latest* link on the [data.world](https://data.world/) dataset page or by triggering the GET:/sync endpoint...
https://github.com/datadotworld/data.world-py/blob/ffaeb115f358731ab0b805b0c43b7ff2e3cf0a77/datadotworld/client/_swagger/apis/datasets_api.py#L43-L69
datadotworld/data.world-py
datadotworld/client/_swagger/apis/datasets_api.py
DatasetsApi.create_dataset
def create_dataset(self, owner, body, **kwargs): """ Create a dataset Create a new dataset. This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please define a `callback` function to be invoked when receiving the response. ...
python
def create_dataset(self, owner, body, **kwargs): """ Create a dataset Create a new dataset. This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please define a `callback` function to be invoked when receiving the response. ...
Create a dataset Create a new dataset. This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please define a `callback` function to be invoked when receiving the response. >>> def callback_function(response): >>> pprint(respons...
https://github.com/datadotworld/data.world-py/blob/ffaeb115f358731ab0b805b0c43b7ff2e3cf0a77/datadotworld/client/_swagger/apis/datasets_api.py#L167-L192
datadotworld/data.world-py
datadotworld/client/_swagger/apis/datasets_api.py
DatasetsApi.delete_dataset
def delete_dataset(self, owner, id, **kwargs): """ Delete a dataset Permanently deletes a dataset and all data associated with it. This operation cannot be undone, although a new dataset may be created with the same id. This method makes a synchronous HTTP request by default. To make an ...
python
def delete_dataset(self, owner, id, **kwargs): """ Delete a dataset Permanently deletes a dataset and all data associated with it. This operation cannot be undone, although a new dataset may be created with the same id. This method makes a synchronous HTTP request by default. To make an ...
Delete a dataset Permanently deletes a dataset and all data associated with it. This operation cannot be undone, although a new dataset may be created with the same id. This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please define a `callback` funct...
https://github.com/datadotworld/data.world-py/blob/ffaeb115f358731ab0b805b0c43b7ff2e3cf0a77/datadotworld/client/_swagger/apis/datasets_api.py#L282-L307
datadotworld/data.world-py
datadotworld/client/_swagger/apis/datasets_api.py
DatasetsApi.delete_file_and_sync_source
def delete_file_and_sync_source(self, owner, id, name, **kwargs): """ Delete a file Delete a single file from a dataset by their name, including files added via URL. This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please define a `ca...
python
def delete_file_and_sync_source(self, owner, id, name, **kwargs): """ Delete a file Delete a single file from a dataset by their name, including files added via URL. This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please define a `ca...
Delete a file Delete a single file from a dataset by their name, including files added via URL. This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please define a `callback` function to be invoked when receiving the response. >>> def ca...
https://github.com/datadotworld/data.world-py/blob/ffaeb115f358731ab0b805b0c43b7ff2e3cf0a77/datadotworld/client/_swagger/apis/datasets_api.py#L395-L421
datadotworld/data.world-py
datadotworld/client/_swagger/apis/datasets_api.py
DatasetsApi.delete_files_and_sync_sources
def delete_files_and_sync_sources(self, owner, id, name, **kwargs): """ Delete files Delete one or more files from a dataset by their name, including files added via URL. **Batching** Note that the `name` parameter can be include multiple times in the query string, once for each file that ...
python
def delete_files_and_sync_sources(self, owner, id, name, **kwargs): """ Delete files Delete one or more files from a dataset by their name, including files added via URL. **Batching** Note that the `name` parameter can be include multiple times in the query string, once for each file that ...
Delete files Delete one or more files from a dataset by their name, including files added via URL. **Batching** Note that the `name` parameter can be include multiple times in the query string, once for each file that is to be deleted together in a single request. This method makes a synchronous H...
https://github.com/datadotworld/data.world-py/blob/ffaeb115f358731ab0b805b0c43b7ff2e3cf0a77/datadotworld/client/_swagger/apis/datasets_api.py#L519-L545
datadotworld/data.world-py
datadotworld/client/_swagger/apis/datasets_api.py
DatasetsApi.get_dataset
def get_dataset(self, owner, id, **kwargs): """ Retrieve a dataset Return details on the dataset. This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please define a `callback` function to be invoked when receiving the response. ...
python
def get_dataset(self, owner, id, **kwargs): """ Retrieve a dataset Return details on the dataset. This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please define a `callback` function to be invoked when receiving the response. ...
Retrieve a dataset Return details on the dataset. This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please define a `callback` function to be invoked when receiving the response. >>> def callback_function(response): >>> ppr...
https://github.com/datadotworld/data.world-py/blob/ffaeb115f358731ab0b805b0c43b7ff2e3cf0a77/datadotworld/client/_swagger/apis/datasets_api.py#L640-L665
datadotworld/data.world-py
datadotworld/client/_swagger/apis/datasets_api.py
DatasetsApi.patch_dataset
def patch_dataset(self, owner, id, body, **kwargs): """ Update a dataset Update an existing dataset. Note that only elements or files included in the request will be updated. All omitted elements or files will remain untouched. This method makes a synchronous HTTP request by default. To ...
python
def patch_dataset(self, owner, id, body, **kwargs): """ Update a dataset Update an existing dataset. Note that only elements or files included in the request will be updated. All omitted elements or files will remain untouched. This method makes a synchronous HTTP request by default. To ...
Update a dataset Update an existing dataset. Note that only elements or files included in the request will be updated. All omitted elements or files will remain untouched. This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please define a `callback` fu...
https://github.com/datadotworld/data.world-py/blob/ffaeb115f358731ab0b805b0c43b7ff2e3cf0a77/datadotworld/client/_swagger/apis/datasets_api.py#L753-L779
datadotworld/data.world-py
datadotworld/client/_swagger/apis/datasets_api.py
DatasetsApi.replace_dataset
def replace_dataset(self, owner, id, body, **kwargs): """ Create / Replace a dataset Create a dataset with a given id or completely rewrite the dataset, including any previously added files, if one already exists with the given id. This method makes a synchronous HTTP request by default....
python
def replace_dataset(self, owner, id, body, **kwargs): """ Create / Replace a dataset Create a dataset with a given id or completely rewrite the dataset, including any previously added files, if one already exists with the given id. This method makes a synchronous HTTP request by default....
Create / Replace a dataset Create a dataset with a given id or completely rewrite the dataset, including any previously added files, if one already exists with the given id. This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please define a `callback` ...
https://github.com/datadotworld/data.world-py/blob/ffaeb115f358731ab0b805b0c43b7ff2e3cf0a77/datadotworld/client/_swagger/apis/datasets_api.py#L877-L903
datadotworld/data.world-py
datadotworld/client/_swagger/apis/datasets_api.py
DatasetsApi.sync
def sync(self, owner, id, **kwargs): """ Sync files Update all files within a dataset that have originally been added via URL (e.g. via /datasets endpoints or on data.world). Check-out or tutorials for tips on how to add Google Sheets, GitHub and S3 files via URL and how to use webhooks or scr...
python
def sync(self, owner, id, **kwargs): """ Sync files Update all files within a dataset that have originally been added via URL (e.g. via /datasets endpoints or on data.world). Check-out or tutorials for tips on how to add Google Sheets, GitHub and S3 files via URL and how to use webhooks or scr...
Sync files Update all files within a dataset that have originally been added via URL (e.g. via /datasets endpoints or on data.world). Check-out or tutorials for tips on how to add Google Sheets, GitHub and S3 files via URL and how to use webhooks or scripts to keep them always in sync. This method mak...
https://github.com/datadotworld/data.world-py/blob/ffaeb115f358731ab0b805b0c43b7ff2e3cf0a77/datadotworld/client/_swagger/apis/datasets_api.py#L1001-L1026
datadotworld/data.world-py
datadotworld/client/_swagger/apis/datasets_api.py
DatasetsApi.sync_via_get
def sync_via_get(self, owner, id, **kwargs): """ Sync files (via GET) Update all files within a dataset that have originally been added via URL (e.g. via /datasets endpoints or on data.world). Check-out or tutorials for tips on how to add Google Sheets, GitHub and S3 files via URL and how to us...
python
def sync_via_get(self, owner, id, **kwargs): """ Sync files (via GET) Update all files within a dataset that have originally been added via URL (e.g. via /datasets endpoints or on data.world). Check-out or tutorials for tips on how to add Google Sheets, GitHub and S3 files via URL and how to us...
Sync files (via GET) Update all files within a dataset that have originally been added via URL (e.g. via /datasets endpoints or on data.world). Check-out or tutorials for tips on how to add Google Sheets, GitHub and S3 files via URL and how to use webhooks or scripts to keep them always in sync. This m...
https://github.com/datadotworld/data.world-py/blob/ffaeb115f358731ab0b805b0c43b7ff2e3cf0a77/datadotworld/client/_swagger/apis/datasets_api.py#L1114-L1139
datadotworld/data.world-py
datadotworld/client/_swagger/apis/user_api.py
UserApi.fetch_contributing_datasets
def fetch_contributing_datasets(self, **kwargs): """ List datasets as contributor Fetch datasets that the currently authenticated user has access to because he or she is a contributor. This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, ...
python
def fetch_contributing_datasets(self, **kwargs): """ List datasets as contributor Fetch datasets that the currently authenticated user has access to because he or she is a contributor. This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, ...
List datasets as contributor Fetch datasets that the currently authenticated user has access to because he or she is a contributor. This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please define a `callback` function to be invoked when receiv...
https://github.com/datadotworld/data.world-py/blob/ffaeb115f358731ab0b805b0c43b7ff2e3cf0a77/datadotworld/client/_swagger/apis/user_api.py#L43-L68
datadotworld/data.world-py
datadotworld/client/_swagger/apis/user_api.py
UserApi.fetch_contributing_projects
def fetch_contributing_projects(self, **kwargs): """ List projects as contributor Fetch projects that the currently authenticated user has access to because he or she is a contributor. This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, ...
python
def fetch_contributing_projects(self, **kwargs): """ List projects as contributor Fetch projects that the currently authenticated user has access to because he or she is a contributor. This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, ...
List projects as contributor Fetch projects that the currently authenticated user has access to because he or she is a contributor. This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please define a `callback` function to be invoked when receiv...
https://github.com/datadotworld/data.world-py/blob/ffaeb115f358731ab0b805b0c43b7ff2e3cf0a77/datadotworld/client/_swagger/apis/user_api.py#L146-L169
datadotworld/data.world-py
datadotworld/client/_swagger/apis/user_api.py
UserApi.fetch_datasets
def fetch_datasets(self, **kwargs): """ List datasets as owner Fetch datasets that the currently authenticated user has access to because he or she is the owner of the dataset. This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please d...
python
def fetch_datasets(self, **kwargs): """ List datasets as owner Fetch datasets that the currently authenticated user has access to because he or she is the owner of the dataset. This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please d...
List datasets as owner Fetch datasets that the currently authenticated user has access to because he or she is the owner of the dataset. This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please define a `callback` function to be invoked when r...
https://github.com/datadotworld/data.world-py/blob/ffaeb115f358731ab0b805b0c43b7ff2e3cf0a77/datadotworld/client/_swagger/apis/user_api.py#L240-L265
datadotworld/data.world-py
datadotworld/client/_swagger/apis/user_api.py
UserApi.fetch_liked_datasets
def fetch_liked_datasets(self, **kwargs): """ List liked datasets Fetch datasets that the currently authenticated user likes. This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please define a `callback` function to be invoked w...
python
def fetch_liked_datasets(self, **kwargs): """ List liked datasets Fetch datasets that the currently authenticated user likes. This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please define a `callback` function to be invoked w...
List liked datasets Fetch datasets that the currently authenticated user likes. This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please define a `callback` function to be invoked when receiving the response. >>> def callback_function(...
https://github.com/datadotworld/data.world-py/blob/ffaeb115f358731ab0b805b0c43b7ff2e3cf0a77/datadotworld/client/_swagger/apis/user_api.py#L343-L368
datadotworld/data.world-py
datadotworld/client/_swagger/apis/user_api.py
UserApi.fetch_liked_projects
def fetch_liked_projects(self, **kwargs): """ List liked projects Fetch projects that the currently authenticated user likes. This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please define a `callback` function to be invoked w...
python
def fetch_liked_projects(self, **kwargs): """ List liked projects Fetch projects that the currently authenticated user likes. This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please define a `callback` function to be invoked w...
List liked projects Fetch projects that the currently authenticated user likes. This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please define a `callback` function to be invoked when receiving the response. >>> def callback_function(...
https://github.com/datadotworld/data.world-py/blob/ffaeb115f358731ab0b805b0c43b7ff2e3cf0a77/datadotworld/client/_swagger/apis/user_api.py#L446-L469
datadotworld/data.world-py
datadotworld/client/_swagger/apis/user_api.py
UserApi.fetch_projects
def fetch_projects(self, **kwargs): """ List projects owned Fetch projects that the currently authenticated user has access to because he or she is the owner of the project. This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please defi...
python
def fetch_projects(self, **kwargs): """ List projects owned Fetch projects that the currently authenticated user has access to because he or she is the owner of the project. This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please defi...
List projects owned Fetch projects that the currently authenticated user has access to because he or she is the owner of the project. This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please define a `callback` function to be invoked when rece...
https://github.com/datadotworld/data.world-py/blob/ffaeb115f358731ab0b805b0c43b7ff2e3cf0a77/datadotworld/client/_swagger/apis/user_api.py#L540-L563
datadotworld/data.world-py
datadotworld/client/_swagger/apis/user_api.py
UserApi.get_user_data
def get_user_data(self, **kwargs): """ Get user data Return profile information for the currently authenticated user. This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please define a `callback` function to be invoked when rece...
python
def get_user_data(self, **kwargs): """ Get user data Return profile information for the currently authenticated user. This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please define a `callback` function to be invoked when rece...
Get user data Return profile information for the currently authenticated user. This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please define a `callback` function to be invoked when receiving the response. >>> def callback_function(r...
https://github.com/datadotworld/data.world-py/blob/ffaeb115f358731ab0b805b0c43b7ff2e3cf0a77/datadotworld/client/_swagger/apis/user_api.py#L634-L657
datadotworld/data.world-py
datadotworld/client/_swagger/models/linked_dataset_create_or_update_request.py
LinkedDatasetCreateOrUpdateRequest.owner
def owner(self, owner): """ Sets the owner of this LinkedDatasetCreateOrUpdateRequest. User name and unique identifier of the creator of the dataset. :param owner: The owner of this LinkedDatasetCreateOrUpdateRequest. :type: str """ if owner is None: ...
python
def owner(self, owner): """ Sets the owner of this LinkedDatasetCreateOrUpdateRequest. User name and unique identifier of the creator of the dataset. :param owner: The owner of this LinkedDatasetCreateOrUpdateRequest. :type: str """ if owner is None: ...
Sets the owner of this LinkedDatasetCreateOrUpdateRequest. User name and unique identifier of the creator of the dataset. :param owner: The owner of this LinkedDatasetCreateOrUpdateRequest. :type: str
https://github.com/datadotworld/data.world-py/blob/ffaeb115f358731ab0b805b0c43b7ff2e3cf0a77/datadotworld/client/_swagger/models/linked_dataset_create_or_update_request.py#L66-L79
datadotworld/data.world-py
datadotworld/files.py
RemoteFile.write
def write(self, value): """write the given value to the stream - if the object is a bytearray, write it as-is - otherwise, convert the object to a string with `str()` and write the UTF-8 bytes :param value: the value to write :type value: str or bytearray :raises TypeErr...
python
def write(self, value): """write the given value to the stream - if the object is a bytearray, write it as-is - otherwise, convert the object to a string with `str()` and write the UTF-8 bytes :param value: the value to write :type value: str or bytearray :raises TypeErr...
write the given value to the stream - if the object is a bytearray, write it as-is - otherwise, convert the object to a string with `str()` and write the UTF-8 bytes :param value: the value to write :type value: str or bytearray :raises TypeError: if the type of the value provid...
https://github.com/datadotworld/data.world-py/blob/ffaeb115f358731ab0b805b0c43b7ff2e3cf0a77/datadotworld/files.py#L92-L116
datadotworld/data.world-py
datadotworld/files.py
RemoteFile.read
def read(self): """read the contents of the file that's been opened in read mode""" if 'r' == self._mode: return self._read_response.text elif 'rb' == self._mode: return self._read_response.content else: raise IOError("File not opened in read mode.")
python
def read(self): """read the contents of the file that's been opened in read mode""" if 'r' == self._mode: return self._read_response.text elif 'rb' == self._mode: return self._read_response.content else: raise IOError("File not opened in read mode.")
read the contents of the file that's been opened in read mode
https://github.com/datadotworld/data.world-py/blob/ffaeb115f358731ab0b805b0c43b7ff2e3cf0a77/datadotworld/files.py#L118-L125
datadotworld/data.world-py
datadotworld/files.py
RemoteFile._open_for_read
def _open_for_read(self): """open the file in read mode""" ownerid, datasetid = parse_dataset_key(self._dataset_key) response = requests.get( '{}/file_download/{}/{}/{}'.format( self._query_host, ownerid, datasetid, self._file_name), headers={ ...
python
def _open_for_read(self): """open the file in read mode""" ownerid, datasetid = parse_dataset_key(self._dataset_key) response = requests.get( '{}/file_download/{}/{}/{}'.format( self._query_host, ownerid, datasetid, self._file_name), headers={ ...
open the file in read mode
https://github.com/datadotworld/data.world-py/blob/ffaeb115f358731ab0b805b0c43b7ff2e3cf0a77/datadotworld/files.py#L152-L167
datadotworld/data.world-py
datadotworld/files.py
RemoteFile._open_for_write
def _open_for_write(self): """open the file in write mode""" def put_request(body): """ :param body: """ ownerid, datasetid = parse_dataset_key(self._dataset_key) response = requests.put( "{}/uploads/{}/{}/files/{}".format( ...
python
def _open_for_write(self): """open the file in write mode""" def put_request(body): """ :param body: """ ownerid, datasetid = parse_dataset_key(self._dataset_key) response = requests.put( "{}/uploads/{}/{}/files/{}".format( ...
open the file in write mode
https://github.com/datadotworld/data.world-py/blob/ffaeb115f358731ab0b805b0c43b7ff2e3cf0a77/datadotworld/files.py#L169-L190
datadotworld/data.world-py
datadotworld/files.py
RemoteFile.close
def close(self): """in write mode, closing the handle adds the sentinel value into the queue and joins the thread executing the HTTP request. in read mode, this clears out the read response object so there are no references to it, and the resources can be reclaimed. """ ...
python
def close(self): """in write mode, closing the handle adds the sentinel value into the queue and joins the thread executing the HTTP request. in read mode, this clears out the read response object so there are no references to it, and the resources can be reclaimed. """ ...
in write mode, closing the handle adds the sentinel value into the queue and joins the thread executing the HTTP request. in read mode, this clears out the read response object so there are no references to it, and the resources can be reclaimed.
https://github.com/datadotworld/data.world-py/blob/ffaeb115f358731ab0b805b0c43b7ff2e3cf0a77/datadotworld/files.py#L192-L211
matthisk/django-jchart
jchart/views/mixins.py
JSONResponseMixin.render_json_response
def render_json_response(self, context, status=200): """ Serialize the context dictionary as JSON and return it as a HTTP Repsonse object. This method only allows serialization of simple objects (i.e. no model instances) """ json_context = json.dumps(context, cls=self.jso...
python
def render_json_response(self, context, status=200): """ Serialize the context dictionary as JSON and return it as a HTTP Repsonse object. This method only allows serialization of simple objects (i.e. no model instances) """ json_context = json.dumps(context, cls=self.jso...
Serialize the context dictionary as JSON and return it as a HTTP Repsonse object. This method only allows serialization of simple objects (i.e. no model instances)
https://github.com/matthisk/django-jchart/blob/2e224f061cdb5804814a6031c4d23899408d62e4/jchart/views/mixins.py#L27-L37
matthisk/django-jchart
jchart/views/__init__.py
ChartView.get
def get(self, request, *args, **kwargs): """ Main entry. This View only responds to GET requests. """ context = self.chart_instance.chartjs_configuration(*args, **kwargs) return self.render_json_response(context)
python
def get(self, request, *args, **kwargs): """ Main entry. This View only responds to GET requests. """ context = self.chart_instance.chartjs_configuration(*args, **kwargs) return self.render_json_response(context)
Main entry. This View only responds to GET requests.
https://github.com/matthisk/django-jchart/blob/2e224f061cdb5804814a6031c4d23899408d62e4/jchart/views/__init__.py#L43-L48
bblfsh/client-python
bblfsh/client.py
BblfshClient.parse
def parse(self, filename: str, language: Optional[str]=None, contents: Optional[str]=None, mode: Optional[ModeType]=None, timeout: Optional[int]=None) -> ResultContext: """ Queries the Babelfish server and receives the UAST response for the specified file. :p...
python
def parse(self, filename: str, language: Optional[str]=None, contents: Optional[str]=None, mode: Optional[ModeType]=None, timeout: Optional[int]=None) -> ResultContext: """ Queries the Babelfish server and receives the UAST response for the specified file. :p...
Queries the Babelfish server and receives the UAST response for the specified file. :param filename: The path to the file. Can be arbitrary if contents \ is not None. :param language: The programming language of the file. Refer to \ https://doc....
https://github.com/bblfsh/client-python/blob/815835d191d5e385973f3c685849cc3b46aa20a5/bblfsh/client.py#L56-L85
bblfsh/client-python
bblfsh/client.py
BblfshClient.close
def close(self) -> None: """ Close the gRPC channel and free the acquired resources. Using a closed client is not supported. """ self._channel.close() self._channel = self._stub_v1 = self._stub_v2 = None
python
def close(self) -> None: """ Close the gRPC channel and free the acquired resources. Using a closed client is not supported. """ self._channel.close() self._channel = self._stub_v1 = self._stub_v2 = None
Close the gRPC channel and free the acquired resources. Using a closed client is not supported.
https://github.com/bblfsh/client-python/blob/815835d191d5e385973f3c685849cc3b46aa20a5/bblfsh/client.py#L110-L116
bblfsh/client-python
bblfsh/compat.py
iterator
def iterator(n: Union[Node, CompatNodeIterator, dict], order: TreeOrder = TreeOrder.PRE_ORDER) -> CompatNodeIterator: """ This function has the same signature as the pre-v3 iterator() call returning a compatibility CompatNodeIterator. """ if isinstance(n, CompatNodeIterator): return...
python
def iterator(n: Union[Node, CompatNodeIterator, dict], order: TreeOrder = TreeOrder.PRE_ORDER) -> CompatNodeIterator: """ This function has the same signature as the pre-v3 iterator() call returning a compatibility CompatNodeIterator. """ if isinstance(n, CompatNodeIterator): return...
This function has the same signature as the pre-v3 iterator() call returning a compatibility CompatNodeIterator.
https://github.com/bblfsh/client-python/blob/815835d191d5e385973f3c685849cc3b46aa20a5/bblfsh/compat.py#L240-L258
bblfsh/client-python
bblfsh/compat.py
filter
def filter(n: Node, query: str) -> CompatNodeIterator: """ This function has the same signature as the pre-v3 filter() returning a compatibility CompatNodeIterator. """ ctx = uast() return CompatNodeIterator(NodeIterator(ctx.filter(query, n.internal_node), ctx))
python
def filter(n: Node, query: str) -> CompatNodeIterator: """ This function has the same signature as the pre-v3 filter() returning a compatibility CompatNodeIterator. """ ctx = uast() return CompatNodeIterator(NodeIterator(ctx.filter(query, n.internal_node), ctx))
This function has the same signature as the pre-v3 filter() returning a compatibility CompatNodeIterator.
https://github.com/bblfsh/client-python/blob/815835d191d5e385973f3c685849cc3b46aa20a5/bblfsh/compat.py#L261-L267
bblfsh/client-python
bblfsh/compat.py
filter_nodes
def filter_nodes(n: Node, query: str) -> CompatNodeIterator: """ Utility function. Same as filter() but will only filter for nodes (i. e. it will exclude scalars and positions). """ return CompatNodeIterator(filter(n, query)._nodeit, only_nodes=True)
python
def filter_nodes(n: Node, query: str) -> CompatNodeIterator: """ Utility function. Same as filter() but will only filter for nodes (i. e. it will exclude scalars and positions). """ return CompatNodeIterator(filter(n, query)._nodeit, only_nodes=True)
Utility function. Same as filter() but will only filter for nodes (i. e. it will exclude scalars and positions).
https://github.com/bblfsh/client-python/blob/815835d191d5e385973f3c685849cc3b46aa20a5/bblfsh/compat.py#L270-L275
bblfsh/client-python
bblfsh/compat.py
filter_string
def filter_string(n: Node, query: str) -> str: """ Filter and ensure that the returned value is of string type. """ return _scalariter2item(n, query, str)
python
def filter_string(n: Node, query: str) -> str: """ Filter and ensure that the returned value is of string type. """ return _scalariter2item(n, query, str)
Filter and ensure that the returned value is of string type.
https://github.com/bblfsh/client-python/blob/815835d191d5e385973f3c685849cc3b46aa20a5/bblfsh/compat.py#L307-L311
bblfsh/client-python
bblfsh/compat.py
filter_bool
def filter_bool(n: Node, query: str) -> bool: """ Filter and ensure that the returned value is of type bool. """ return _scalariter2item(n, query, bool)
python
def filter_bool(n: Node, query: str) -> bool: """ Filter and ensure that the returned value is of type bool. """ return _scalariter2item(n, query, bool)
Filter and ensure that the returned value is of type bool.
https://github.com/bblfsh/client-python/blob/815835d191d5e385973f3c685849cc3b46aa20a5/bblfsh/compat.py#L314-L318
bblfsh/client-python
bblfsh/compat.py
filter_int
def filter_int(n: Node, query: str) -> int: """ Filter and ensure that the returned value is of type int. """ return _scalariter2item(n, query, int)
python
def filter_int(n: Node, query: str) -> int: """ Filter and ensure that the returned value is of type int. """ return _scalariter2item(n, query, int)
Filter and ensure that the returned value is of type int.
https://github.com/bblfsh/client-python/blob/815835d191d5e385973f3c685849cc3b46aa20a5/bblfsh/compat.py#L321-L325
bblfsh/client-python
bblfsh/compat.py
filter_float
def filter_float(n: Node, query: str) -> float: """ Filter and ensure that the returned value is of type int. """ return _scalariter2item(n, query, float)
python
def filter_float(n: Node, query: str) -> float: """ Filter and ensure that the returned value is of type int. """ return _scalariter2item(n, query, float)
Filter and ensure that the returned value is of type int.
https://github.com/bblfsh/client-python/blob/815835d191d5e385973f3c685849cc3b46aa20a5/bblfsh/compat.py#L328-L332
bblfsh/client-python
bblfsh/compat.py
CompatBblfshClient.parse
def parse(self, filename: str, language: str = None, contents: str = None, timeout: float = None) -> CompatParseResponse: """ Parse the specified filename or contents and return a CompatParseResponse. """ return self._parse(filename, language, contents, timeout, ...
python
def parse(self, filename: str, language: str = None, contents: str = None, timeout: float = None) -> CompatParseResponse: """ Parse the specified filename or contents and return a CompatParseResponse. """ return self._parse(filename, language, contents, timeout, ...
Parse the specified filename or contents and return a CompatParseResponse.
https://github.com/bblfsh/client-python/blob/815835d191d5e385973f3c685849cc3b46aa20a5/bblfsh/compat.py#L140-L148
bblfsh/client-python
bblfsh/compat.py
CompatNodeIterator.filter
def filter(self, query: str) -> Optional['CompatNodeIterator']: """ Further filter the results using this iterator as base. """ if not self._last_node: return None return filter(self._last_node, query)
python
def filter(self, query: str) -> Optional['CompatNodeIterator']: """ Further filter the results using this iterator as base. """ if not self._last_node: return None return filter(self._last_node, query)
Further filter the results using this iterator as base.
https://github.com/bblfsh/client-python/blob/815835d191d5e385973f3c685849cc3b46aa20a5/bblfsh/compat.py#L220-L227
bblfsh/client-python
bblfsh/compat.py
CompatNodeIterator.properties
def properties(self) -> dict: """ Returns the properties of the current node in the iteration. """ if isinstance(self._last_node, dict): return self._last_node.keys() else: return {}
python
def properties(self) -> dict: """ Returns the properties of the current node in the iteration. """ if isinstance(self._last_node, dict): return self._last_node.keys() else: return {}
Returns the properties of the current node in the iteration.
https://github.com/bblfsh/client-python/blob/815835d191d5e385973f3c685849cc3b46aa20a5/bblfsh/compat.py#L230-L237
echonest/pyechonest
examples/try_new_things.py
write_xspf
def write_xspf(f, tuples): """send me a list of (artist,title,mp3_url)""" xml = XmlWriter(f, indentAmount=' ') xml.prolog() xml.start('playlist', { 'xmlns': 'http://xspf.org/ns/0/', 'version': '1' }) xml.start('trackList') for tupe in tuples: xml.start('track') xml.elem('creator...
python
def write_xspf(f, tuples): """send me a list of (artist,title,mp3_url)""" xml = XmlWriter(f, indentAmount=' ') xml.prolog() xml.start('playlist', { 'xmlns': 'http://xspf.org/ns/0/', 'version': '1' }) xml.start('trackList') for tupe in tuples: xml.start('track') xml.elem('creator...
send me a list of (artist,title,mp3_url)
https://github.com/echonest/pyechonest/blob/d8c7af6c1da699b50b2f4b1bd3c0febe72e7f1ee/examples/try_new_things.py#L95-L109
echonest/pyechonest
pyechonest/util.py
callm
def callm(method, param_dict, POST=False, socket_timeout=None, data=None): """ Call the api! Param_dict is a *regular* *python* *dictionary* so if you want to have multi-valued params put them in a list. ** note, if we require 2.6, we can get rid of this timeout munging. """ try: ...
python
def callm(method, param_dict, POST=False, socket_timeout=None, data=None): """ Call the api! Param_dict is a *regular* *python* *dictionary* so if you want to have multi-valued params put them in a list. ** note, if we require 2.6, we can get rid of this timeout munging. """ try: ...
Call the api! Param_dict is a *regular* *python* *dictionary* so if you want to have multi-valued params put them in a list. ** note, if we require 2.6, we can get rid of this timeout munging.
https://github.com/echonest/pyechonest/blob/d8c7af6c1da699b50b2f4b1bd3c0febe72e7f1ee/pyechonest/util.py#L130-L212
echonest/pyechonest
pyechonest/util.py
oauthgetm
def oauthgetm(method, param_dict, socket_timeout=None): try: import oauth2 # lazy import this so oauth2 is not a hard dep except ImportError: raise Exception("You must install the python-oauth2 library to use this method.") """ Call the api! With Oauth! Param_dict is a *regular* *p...
python
def oauthgetm(method, param_dict, socket_timeout=None): try: import oauth2 # lazy import this so oauth2 is not a hard dep except ImportError: raise Exception("You must install the python-oauth2 library to use this method.") """ Call the api! With Oauth! Param_dict is a *regular* *p...
Call the api! With Oauth! Param_dict is a *regular* *python* *dictionary* so if you want to have multi-valued params put them in a list. ** note, if we require 2.6, we can get rid of this timeout munging.
https://github.com/echonest/pyechonest/blob/d8c7af6c1da699b50b2f4b1bd3c0febe72e7f1ee/pyechonest/util.py#L214-L270
echonest/pyechonest
pyechonest/util.py
postChunked
def postChunked(host, selector, fields, files): """ Attempt to replace postMultipart() with nearly-identical interface. (The files tuple no longer requires the filename, and we only return the response body.) Uses the urllib2_file.py originally from http://fabien.seisen.org which was also draw...
python
def postChunked(host, selector, fields, files): """ Attempt to replace postMultipart() with nearly-identical interface. (The files tuple no longer requires the filename, and we only return the response body.) Uses the urllib2_file.py originally from http://fabien.seisen.org which was also draw...
Attempt to replace postMultipart() with nearly-identical interface. (The files tuple no longer requires the filename, and we only return the response body.) Uses the urllib2_file.py originally from http://fabien.seisen.org which was also drawn heavily from http://code.activestate.com/recipes/1463...
https://github.com/echonest/pyechonest/blob/d8c7af6c1da699b50b2f4b1bd3c0febe72e7f1ee/pyechonest/util.py#L273-L292
echonest/pyechonest
pyechonest/catalog.py
create_catalog_by_name
def create_catalog_by_name(name, T="general"): """ Creates a catalog object, with a given name. Does not check to see if the catalog already exists. Create a catalog object like """ result = util.callm("catalog/create", {}, POST=True, data={"name":name, "type":T}) r...
python
def create_catalog_by_name(name, T="general"): """ Creates a catalog object, with a given name. Does not check to see if the catalog already exists. Create a catalog object like """ result = util.callm("catalog/create", {}, POST=True, data={"name":name, "type":T}) r...
Creates a catalog object, with a given name. Does not check to see if the catalog already exists. Create a catalog object like
https://github.com/echonest/pyechonest/blob/d8c7af6c1da699b50b2f4b1bd3c0febe72e7f1ee/pyechonest/catalog.py#L25-L34
echonest/pyechonest
pyechonest/catalog.py
get_catalog_by_name
def get_catalog_by_name(name): """ Grabs a catalog by name, if its there on the api key. Otherwise, an error is thrown (mirroring the API) """ kwargs = { 'name' : name, } result = util.callm("%s/%s" % ('catalog', 'profile'), kwargs) return Catalog(**util.fix(result['respo...
python
def get_catalog_by_name(name): """ Grabs a catalog by name, if its there on the api key. Otherwise, an error is thrown (mirroring the API) """ kwargs = { 'name' : name, } result = util.callm("%s/%s" % ('catalog', 'profile'), kwargs) return Catalog(**util.fix(result['respo...
Grabs a catalog by name, if its there on the api key. Otherwise, an error is thrown (mirroring the API)
https://github.com/echonest/pyechonest/blob/d8c7af6c1da699b50b2f4b1bd3c0febe72e7f1ee/pyechonest/catalog.py#L380-L389
echonest/pyechonest
pyechonest/catalog.py
list_catalogs
def list_catalogs(results=30, start=0): """ Returns list of all catalogs created on this API key Args: Kwargs: results (int): An integer number of results to return start (int): An integer starting value for the result set Returns: A list of catalog objects Example: ...
python
def list_catalogs(results=30, start=0): """ Returns list of all catalogs created on this API key Args: Kwargs: results (int): An integer number of results to return start (int): An integer starting value for the result set Returns: A list of catalog objects Example: ...
Returns list of all catalogs created on this API key Args: Kwargs: results (int): An integer number of results to return start (int): An integer starting value for the result set Returns: A list of catalog objects Example: >>> catalog.list_catalogs() [<catalog - tes...
https://github.com/echonest/pyechonest/blob/d8c7af6c1da699b50b2f4b1bd3c0febe72e7f1ee/pyechonest/catalog.py#L391-L416
echonest/pyechonest
pyechonest/catalog.py
Catalog.update
def update(self, items): """ Update a catalog object Args: items (list): A list of dicts describing update data and action codes (see api docs) Kwargs: Returns: A ticket id Example: >>> c = catalog.Catalog('my_songs', type='song') ...
python
def update(self, items): """ Update a catalog object Args: items (list): A list of dicts describing update data and action codes (see api docs) Kwargs: Returns: A ticket id Example: >>> c = catalog.Catalog('my_songs', type='song') ...
Update a catalog object Args: items (list): A list of dicts describing update data and action codes (see api docs) Kwargs: Returns: A ticket id Example: >>> c = catalog.Catalog('my_songs', type='song') >>> items [{'action': 'update', ...
https://github.com/echonest/pyechonest/blob/d8c7af6c1da699b50b2f4b1bd3c0febe72e7f1ee/pyechonest/catalog.py#L86-L126
echonest/pyechonest
pyechonest/catalog.py
Catalog.read_items
def read_items(self, buckets=None, results=15, start=0,item_ids=None): """ Returns data from the catalog; also expanded for the requested buckets. This method is provided for backwards-compatibility Args: Kwargs: buckets (list): A list of strings specifying which bu...
python
def read_items(self, buckets=None, results=15, start=0,item_ids=None): """ Returns data from the catalog; also expanded for the requested buckets. This method is provided for backwards-compatibility Args: Kwargs: buckets (list): A list of strings specifying which bu...
Returns data from the catalog; also expanded for the requested buckets. This method is provided for backwards-compatibility Args: Kwargs: buckets (list): A list of strings specifying which buckets to retrieve results (int): An integer number of results to return ...
https://github.com/echonest/pyechonest/blob/d8c7af6c1da699b50b2f4b1bd3c0febe72e7f1ee/pyechonest/catalog.py#L180-L237
echonest/pyechonest
pyechonest/catalog.py
Catalog.get_item_dicts
def get_item_dicts(self, buckets=None, results=15, start=0,item_ids=None): """ Returns data from the catalog; also expanded for the requested buckets Args: Kwargs: buckets (list): A list of strings specifying which buckets to retrieve results (int): An integer ...
python
def get_item_dicts(self, buckets=None, results=15, start=0,item_ids=None): """ Returns data from the catalog; also expanded for the requested buckets Args: Kwargs: buckets (list): A list of strings specifying which buckets to retrieve results (int): An integer ...
Returns data from the catalog; also expanded for the requested buckets Args: Kwargs: buckets (list): A list of strings specifying which buckets to retrieve results (int): An integer number of results to return start (int): An integer starting value for the result ...
https://github.com/echonest/pyechonest/blob/d8c7af6c1da699b50b2f4b1bd3c0febe72e7f1ee/pyechonest/catalog.py#L241-L289
echonest/pyechonest
pyechonest/catalog.py
Catalog.get_feed
def get_feed(self, buckets=None, since=None, results=15, start=0): """ Returns feed (news, blogs, reviews, audio, video) for the catalog artists; response depends on requested buckets Args: Kwargs: buckets (list): A list of strings specifying which feed items to retrieve ...
python
def get_feed(self, buckets=None, since=None, results=15, start=0): """ Returns feed (news, blogs, reviews, audio, video) for the catalog artists; response depends on requested buckets Args: Kwargs: buckets (list): A list of strings specifying which feed items to retrieve ...
Returns feed (news, blogs, reviews, audio, video) for the catalog artists; response depends on requested buckets Args: Kwargs: buckets (list): A list of strings specifying which feed items to retrieve results (int): An integer number of results to return start (in...
https://github.com/echonest/pyechonest/blob/d8c7af6c1da699b50b2f4b1bd3c0febe72e7f1ee/pyechonest/catalog.py#L293-L331
echonest/pyechonest
examples/show_attrs.py
_show_one
def _show_one(audio_file): "given an audio file, print out the artist, title and some audio attributes of the song" print 'File: ', audio_file pytrack = track.track_from_filename(audio_file) print 'Artist: ', pytrack.artist if hasattr(pytrack, 'artist') else 'Unknown' print 'Title: ...
python
def _show_one(audio_file): "given an audio file, print out the artist, title and some audio attributes of the song" print 'File: ', audio_file pytrack = track.track_from_filename(audio_file) print 'Artist: ', pytrack.artist if hasattr(pytrack, 'artist') else 'Unknown' print 'Title: ...
given an audio file, print out the artist, title and some audio attributes of the song
https://github.com/echonest/pyechonest/blob/d8c7af6c1da699b50b2f4b1bd3c0febe72e7f1ee/examples/show_attrs.py#L23-L37
echonest/pyechonest
examples/show_attrs.py
show_attrs
def show_attrs(directory): "print out the tempo for each audio file in the given directory" for f in os.listdir(directory): if _is_audio(f): path = os.path.join(directory, f) _show_one(path)
python
def show_attrs(directory): "print out the tempo for each audio file in the given directory" for f in os.listdir(directory): if _is_audio(f): path = os.path.join(directory, f) _show_one(path)
print out the tempo for each audio file in the given directory
https://github.com/echonest/pyechonest/blob/d8c7af6c1da699b50b2f4b1bd3c0febe72e7f1ee/examples/show_attrs.py#L40-L45
echonest/pyechonest
pyechonest/song.py
search
def search(title=None, artist=None, artist_id=None, combined=None, description=None, style=None, mood=None, results=None, start=None, max_tempo=None, min_tempo=None, max_duration=None, min_duration=None, max_loudness=None, min_loudness=None, artist_max_familiarity=None, artist_min_famil...
python
def search(title=None, artist=None, artist_id=None, combined=None, description=None, style=None, mood=None, results=None, start=None, max_tempo=None, min_tempo=None, max_duration=None, min_duration=None, max_loudness=None, min_loudness=None, artist_max_familiarity=None, artist_min_famil...
Search for songs by name, description, or constraint. Args: Kwargs: title (str): the name of a song artist (str): the name of an artist artist_id (str): the artist_id combined (str): the artist name and song title description (str): A string describing the artist and so...
https://github.com/echonest/pyechonest/blob/d8c7af6c1da699b50b2f4b1bd3c0febe72e7f1ee/pyechonest/song.py#L359-L448
echonest/pyechonest
pyechonest/song.py
profile
def profile(ids=None, track_ids=None, buckets=None, limit=False): """get the profiles for multiple songs at once Args: ids (str or list): a song ID or list of song IDs Kwargs: buckets (list): A list of strings specifying which buckets to retrieve limit (bool): A boolea...
python
def profile(ids=None, track_ids=None, buckets=None, limit=False): """get the profiles for multiple songs at once Args: ids (str or list): a song ID or list of song IDs Kwargs: buckets (list): A list of strings specifying which buckets to retrieve limit (bool): A boolea...
get the profiles for multiple songs at once Args: ids (str or list): a song ID or list of song IDs Kwargs: buckets (list): A list of strings specifying which buckets to retrieve limit (bool): A boolean indicating whether or not to limit the results to one of the id spaces ...
https://github.com/echonest/pyechonest/blob/d8c7af6c1da699b50b2f4b1bd3c0febe72e7f1ee/pyechonest/song.py#L450-L507
echonest/pyechonest
pyechonest/song.py
Song.get_audio_summary
def get_audio_summary(self, cache=True): """Get an audio summary of a song containing mode, tempo, key, duration, time signature, loudness, danceability, energy, and analysis_url. Args: Kwargs: cache (bool): A boolean indicating whether or not the cached value shoul...
python
def get_audio_summary(self, cache=True): """Get an audio summary of a song containing mode, tempo, key, duration, time signature, loudness, danceability, energy, and analysis_url. Args: Kwargs: cache (bool): A boolean indicating whether or not the cached value shoul...
Get an audio summary of a song containing mode, tempo, key, duration, time signature, loudness, danceability, energy, and analysis_url. Args: Kwargs: cache (bool): A boolean indicating whether or not the cached value should be used (if available). Defaults to True. ...
https://github.com/echonest/pyechonest/blob/d8c7af6c1da699b50b2f4b1bd3c0febe72e7f1ee/pyechonest/song.py#L81-L116
echonest/pyechonest
pyechonest/song.py
Song.get_song_hotttnesss
def get_song_hotttnesss(self, cache=True): """Get our numerical description of how hottt a song currently is Args: Kwargs: cache (bool): A boolean indicating whether or not the cached value should be used (if available). Defaults to True. Returns: ...
python
def get_song_hotttnesss(self, cache=True): """Get our numerical description of how hottt a song currently is Args: Kwargs: cache (bool): A boolean indicating whether or not the cached value should be used (if available). Defaults to True. Returns: ...
Get our numerical description of how hottt a song currently is Args: Kwargs: cache (bool): A boolean indicating whether or not the cached value should be used (if available). Defaults to True. Returns: A float representing hotttnesss. ...
https://github.com/echonest/pyechonest/blob/d8c7af6c1da699b50b2f4b1bd3c0febe72e7f1ee/pyechonest/song.py#L120-L143
echonest/pyechonest
pyechonest/song.py
Song.get_song_type
def get_song_type(self, cache=True): """Get the types of a song. Args: cache (boolean): A boolean indicating whether or not the cached value should be used (if available). Defaults to True. Returns: A list of strings, each representing a song...
python
def get_song_type(self, cache=True): """Get the types of a song. Args: cache (boolean): A boolean indicating whether or not the cached value should be used (if available). Defaults to True. Returns: A list of strings, each representing a song...
Get the types of a song. Args: cache (boolean): A boolean indicating whether or not the cached value should be used (if available). Defaults to True. Returns: A list of strings, each representing a song type: 'christmas', for example. ...
https://github.com/echonest/pyechonest/blob/d8c7af6c1da699b50b2f4b1bd3c0febe72e7f1ee/pyechonest/song.py#L147-L170
echonest/pyechonest
pyechonest/song.py
Song.get_artist_hotttnesss
def get_artist_hotttnesss(self, cache=True): """Get our numerical description of how hottt a song's artist currently is Args: Kwargs: cache (bool): A boolean indicating whether or not the cached value should be used (if available). Defaults to True. ...
python
def get_artist_hotttnesss(self, cache=True): """Get our numerical description of how hottt a song's artist currently is Args: Kwargs: cache (bool): A boolean indicating whether or not the cached value should be used (if available). Defaults to True. ...
Get our numerical description of how hottt a song's artist currently is Args: Kwargs: cache (bool): A boolean indicating whether or not the cached value should be used (if available). Defaults to True. Returns: A float representing hotttnesss. ...
https://github.com/echonest/pyechonest/blob/d8c7af6c1da699b50b2f4b1bd3c0febe72e7f1ee/pyechonest/song.py#L174-L197
echonest/pyechonest
pyechonest/song.py
Song.get_artist_familiarity
def get_artist_familiarity(self, cache=True): """Get our numerical estimation of how familiar a song's artist currently is to the world Args: cache (bool): A boolean indicating whether or not the cached value should be used (if available). Defaults to True. Returns:...
python
def get_artist_familiarity(self, cache=True): """Get our numerical estimation of how familiar a song's artist currently is to the world Args: cache (bool): A boolean indicating whether or not the cached value should be used (if available). Defaults to True. Returns:...
Get our numerical estimation of how familiar a song's artist currently is to the world Args: cache (bool): A boolean indicating whether or not the cached value should be used (if available). Defaults to True. Returns: A float representing familiarity. ...
https://github.com/echonest/pyechonest/blob/d8c7af6c1da699b50b2f4b1bd3c0febe72e7f1ee/pyechonest/song.py#L201-L221
echonest/pyechonest
pyechonest/song.py
Song.get_artist_location
def get_artist_location(self, cache=True): """Get the location of a song's artist. Args: cache (bool): A boolean indicating whether or not the cached value should be used (if available). Defaults to True. Returns: An artist location object. ...
python
def get_artist_location(self, cache=True): """Get the location of a song's artist. Args: cache (bool): A boolean indicating whether or not the cached value should be used (if available). Defaults to True. Returns: An artist location object. ...
Get the location of a song's artist. Args: cache (bool): A boolean indicating whether or not the cached value should be used (if available). Defaults to True. Returns: An artist location object. Example: >>> s = song.Song('SOQKVPH12A...
https://github.com/echonest/pyechonest/blob/d8c7af6c1da699b50b2f4b1bd3c0febe72e7f1ee/pyechonest/song.py#L225-L244
echonest/pyechonest
pyechonest/song.py
Song.get_song_discovery
def get_song_discovery(self, cache=True): """ Args: cache (bool): A boolean indicating whether or not the cached value should be used (if available). Defaults to True. Returns: A float representing a song's discovery rank. Example: >>> s = song.Song(...
python
def get_song_discovery(self, cache=True): """ Args: cache (bool): A boolean indicating whether or not the cached value should be used (if available). Defaults to True. Returns: A float representing a song's discovery rank. Example: >>> s = song.Song(...
Args: cache (bool): A boolean indicating whether or not the cached value should be used (if available). Defaults to True. Returns: A float representing a song's discovery rank. Example: >>> s = song.Song('SOQKVPH12A58A7AF4D') >>> s.get_song_discovery() ...
https://github.com/echonest/pyechonest/blob/d8c7af6c1da699b50b2f4b1bd3c0febe72e7f1ee/pyechonest/song.py#L277-L296
echonest/pyechonest
pyechonest/song.py
Song.get_song_currency
def get_song_currency(self, cache=True): """ Args: cache (bool): A boolean indicating whether or not the cached value should be used (if available). Defaults to True. Returns: A float representing a song's currency rank. Example: ...
python
def get_song_currency(self, cache=True): """ Args: cache (bool): A boolean indicating whether or not the cached value should be used (if available). Defaults to True. Returns: A float representing a song's currency rank. Example: ...
Args: cache (bool): A boolean indicating whether or not the cached value should be used (if available). Defaults to True. Returns: A float representing a song's currency rank. Example: >>> s = song.Song('SOQKVPH12A58A7AF4D') >>> s.get...
https://github.com/echonest/pyechonest/blob/d8c7af6c1da699b50b2f4b1bd3c0febe72e7f1ee/pyechonest/song.py#L300-L319
echonest/pyechonest
pyechonest/song.py
Song.get_tracks
def get_tracks(self, catalog, cache=True): """Get the tracks for a song given a catalog. Args: catalog (str): a string representing the catalog whose track you want to retrieve. Returns: A list of Track dicts. Example: >>> s ...
python
def get_tracks(self, catalog, cache=True): """Get the tracks for a song given a catalog. Args: catalog (str): a string representing the catalog whose track you want to retrieve. Returns: A list of Track dicts. Example: >>> s ...
Get the tracks for a song given a catalog. Args: catalog (str): a string representing the catalog whose track you want to retrieve. Returns: A list of Track dicts. Example: >>> s = song.Song('SOWDASQ12A6310F24F') >>> s.ge...
https://github.com/echonest/pyechonest/blob/d8c7af6c1da699b50b2f4b1bd3c0febe72e7f1ee/pyechonest/song.py#L323-L356
echonest/pyechonest
pyechonest/playlist.py
basic
def basic(type='artist-radio', artist_id=None, artist=None, song_id=None, song=None, track_id=None, dmca=False, results=15, buckets=None, limit=False,genres=None,): """Get a basic playlist Args: Kwargs: type (str): a string representing the playlist type ('artist-radio' or 'song-...
python
def basic(type='artist-radio', artist_id=None, artist=None, song_id=None, song=None, track_id=None, dmca=False, results=15, buckets=None, limit=False,genres=None,): """Get a basic playlist Args: Kwargs: type (str): a string representing the playlist type ('artist-radio' or 'song-...
Get a basic playlist Args: Kwargs: type (str): a string representing the playlist type ('artist-radio' or 'song-radio') artist_id (str): the artist_id to seed the playlist artist (str): the name of an artist to seed the playlist song_id (str):...
https://github.com/echonest/pyechonest/blob/d8c7af6c1da699b50b2f4b1bd3c0febe72e7f1ee/pyechonest/playlist.py#L20-L58
echonest/pyechonest
pyechonest/playlist.py
static
def static(type='artist', artist_pick='song_hotttnesss-desc', variety=.5, artist_id=None, artist=None, song_id=None, track_id=None, description=None, style=None, mood=None, results=15, max_tempo=None, min_tempo=None, max_duration=None, min_duration=None, max_loudness=None, min_loudness=None, max_d...
python
def static(type='artist', artist_pick='song_hotttnesss-desc', variety=.5, artist_id=None, artist=None, song_id=None, track_id=None, description=None, style=None, mood=None, results=15, max_tempo=None, min_tempo=None, max_duration=None, min_duration=None, max_loudness=None, min_loudness=None, max_d...
Get a static playlist Args: Kwargs: type (str): a string representing the playlist type ('artist', 'artist-radio', ...) artist_pick (str): How songs should be chosen for each artist variety (float): A number between 0 and 1 specifying the variety of the playli...
https://github.com/echonest/pyechonest/blob/d8c7af6c1da699b50b2f4b1bd3c0febe72e7f1ee/pyechonest/playlist.py#L61-L209
echonest/pyechonest
pyechonest/track.py
_track_from_response
def _track_from_response(result, timeout): """ This is the function that actually creates the track object """ response = result['response'] status = response['track']['status'].lower() if status == 'pending': # Need to wait for async upload or analyze call to finish. result = _...
python
def _track_from_response(result, timeout): """ This is the function that actually creates the track object """ response = result['response'] status = response['track']['status'].lower() if status == 'pending': # Need to wait for async upload or analyze call to finish. result = _...
This is the function that actually creates the track object
https://github.com/echonest/pyechonest/blob/d8c7af6c1da699b50b2f4b1bd3c0febe72e7f1ee/pyechonest/track.py#L164-L193
echonest/pyechonest
pyechonest/track.py
_upload
def _upload(param_dict, timeout, data): """ Calls upload either with a local audio file, or a url. Returns a track object. """ param_dict['format'] = 'json' param_dict['wait'] = 'true' param_dict['bucket'] = 'audio_summary' result = util.callm('track/upload', param_dict, POST = True, soc...
python
def _upload(param_dict, timeout, data): """ Calls upload either with a local audio file, or a url. Returns a track object. """ param_dict['format'] = 'json' param_dict['wait'] = 'true' param_dict['bucket'] = 'audio_summary' result = util.callm('track/upload', param_dict, POST = True, soc...
Calls upload either with a local audio file, or a url. Returns a track object.
https://github.com/echonest/pyechonest/blob/d8c7af6c1da699b50b2f4b1bd3c0febe72e7f1ee/pyechonest/track.py#L195-L204
echonest/pyechonest
pyechonest/track.py
track_from_file
def track_from_file(file_object, filetype, timeout=DEFAULT_ASYNC_TIMEOUT, force_upload=False): """ Create a track object from a file-like object. NOTE: Does not create the detailed analysis for the Track. Call Track.get_analysis() for that. Args: file_object: a file-like Python object ...
python
def track_from_file(file_object, filetype, timeout=DEFAULT_ASYNC_TIMEOUT, force_upload=False): """ Create a track object from a file-like object. NOTE: Does not create the detailed analysis for the Track. Call Track.get_analysis() for that. Args: file_object: a file-like Python object ...
Create a track object from a file-like object. NOTE: Does not create the detailed analysis for the Track. Call Track.get_analysis() for that. Args: file_object: a file-like Python object filetype: the file type. Supported types include mp3, ogg, wav, m4a, mp4, au force_upload: skip...
https://github.com/echonest/pyechonest/blob/d8c7af6c1da699b50b2f4b1bd3c0febe72e7f1ee/pyechonest/track.py#L220-L249
echonest/pyechonest
pyechonest/track.py
track_from_filename
def track_from_filename(filename, filetype = None, timeout=DEFAULT_ASYNC_TIMEOUT, force_upload=False): """ Create a track object from a filename. NOTE: Does not create the detailed analysis for the Track. Call Track.get_analysis() for that. Args: filename: A string containing the path to t...
python
def track_from_filename(filename, filetype = None, timeout=DEFAULT_ASYNC_TIMEOUT, force_upload=False): """ Create a track object from a filename. NOTE: Does not create the detailed analysis for the Track. Call Track.get_analysis() for that. Args: filename: A string containing the path to t...
Create a track object from a filename. NOTE: Does not create the detailed analysis for the Track. Call Track.get_analysis() for that. Args: filename: A string containing the path to the input file. filetype: A string indicating the filetype; Defaults to None (type determined by file extens...
https://github.com/echonest/pyechonest/blob/d8c7af6c1da699b50b2f4b1bd3c0febe72e7f1ee/pyechonest/track.py#L251-L273
echonest/pyechonest
pyechonest/track.py
track_from_url
def track_from_url(url, timeout=DEFAULT_ASYNC_TIMEOUT): """ Create a track object from a public http URL. NOTE: Does not create the detailed analysis for the Track. Call Track.get_analysis() for that. Args: url: A string giving the URL to read from. This must be on a public machine accessi...
python
def track_from_url(url, timeout=DEFAULT_ASYNC_TIMEOUT): """ Create a track object from a public http URL. NOTE: Does not create the detailed analysis for the Track. Call Track.get_analysis() for that. Args: url: A string giving the URL to read from. This must be on a public machine accessi...
Create a track object from a public http URL. NOTE: Does not create the detailed analysis for the Track. Call Track.get_analysis() for that. Args: url: A string giving the URL to read from. This must be on a public machine accessible by HTTP. Example: >>> t = track.track_from_url("htt...
https://github.com/echonest/pyechonest/blob/d8c7af6c1da699b50b2f4b1bd3c0febe72e7f1ee/pyechonest/track.py#L275-L293
echonest/pyechonest
pyechonest/track.py
track_from_id
def track_from_id(identifier, timeout=DEFAULT_ASYNC_TIMEOUT): """ Create a track object from an Echo Nest track ID. NOTE: Does not create the detailed analysis for the Track. Call Track.get_analysis() for that. Args: identifier: A string containing the ID of a previously analyzed track. ...
python
def track_from_id(identifier, timeout=DEFAULT_ASYNC_TIMEOUT): """ Create a track object from an Echo Nest track ID. NOTE: Does not create the detailed analysis for the Track. Call Track.get_analysis() for that. Args: identifier: A string containing the ID of a previously analyzed track. ...
Create a track object from an Echo Nest track ID. NOTE: Does not create the detailed analysis for the Track. Call Track.get_analysis() for that. Args: identifier: A string containing the ID of a previously analyzed track. Example: >>> t = track.track_from_id("TRWFIDS128F92CC4CA") ...
https://github.com/echonest/pyechonest/blob/d8c7af6c1da699b50b2f4b1bd3c0febe72e7f1ee/pyechonest/track.py#L295-L312
echonest/pyechonest
pyechonest/track.py
track_from_md5
def track_from_md5(md5, timeout=DEFAULT_ASYNC_TIMEOUT): """ Create a track object from an md5 hash. NOTE: Does not create the detailed analysis for the Track. Call Track.get_analysis() for that. Args: md5: A string 32 characters long giving the md5 checksum of a track already analyzed. ...
python
def track_from_md5(md5, timeout=DEFAULT_ASYNC_TIMEOUT): """ Create a track object from an md5 hash. NOTE: Does not create the detailed analysis for the Track. Call Track.get_analysis() for that. Args: md5: A string 32 characters long giving the md5 checksum of a track already analyzed. ...
Create a track object from an md5 hash. NOTE: Does not create the detailed analysis for the Track. Call Track.get_analysis() for that. Args: md5: A string 32 characters long giving the md5 checksum of a track already analyzed. Example: >>> t = track.track_from_md5('b8abf85746ab3416ada...
https://github.com/echonest/pyechonest/blob/d8c7af6c1da699b50b2f4b1bd3c0febe72e7f1ee/pyechonest/track.py#L314-L331
echonest/pyechonest
pyechonest/track.py
Track.get_analysis
def get_analysis(self): """ Retrieve the detailed analysis for the track, if available. Raises Exception if unable to create the detailed analysis. """ if self.analysis_url: try: # Try the existing analysis_url first. This expires shortly # after ...
python
def get_analysis(self): """ Retrieve the detailed analysis for the track, if available. Raises Exception if unable to create the detailed analysis. """ if self.analysis_url: try: # Try the existing analysis_url first. This expires shortly # after ...
Retrieve the detailed analysis for the track, if available. Raises Exception if unable to create the detailed analysis.
https://github.com/echonest/pyechonest/blob/d8c7af6c1da699b50b2f4b1bd3c0febe72e7f1ee/pyechonest/track.py#L117-L144
echonest/pyechonest
examples/tempo.py
get_tempo
def get_tempo(artist, title): "gets the tempo for a song" results = song.search(artist=artist, title=title, results=1, buckets=['audio_summary']) if len(results) > 0: return results[0].audio_summary['tempo'] else: return None
python
def get_tempo(artist, title): "gets the tempo for a song" results = song.search(artist=artist, title=title, results=1, buckets=['audio_summary']) if len(results) > 0: return results[0].audio_summary['tempo'] else: return None
gets the tempo for a song
https://github.com/echonest/pyechonest/blob/d8c7af6c1da699b50b2f4b1bd3c0febe72e7f1ee/examples/tempo.py#L4-L10
echonest/pyechonest
pyechonest/sandbox.py
list
def list(sandbox_name, results=15, start=0): """ Returns a list of all assets available in this sandbox Args: sandbox_name (str): A string representing the name of the sandbox Kwargs: results (int): An integer number of results to return start (int): An integer sta...
python
def list(sandbox_name, results=15, start=0): """ Returns a list of all assets available in this sandbox Args: sandbox_name (str): A string representing the name of the sandbox Kwargs: results (int): An integer number of results to return start (int): An integer sta...
Returns a list of all assets available in this sandbox Args: sandbox_name (str): A string representing the name of the sandbox Kwargs: results (int): An integer number of results to return start (int): An integer starting value for the result set Returns: ...
https://github.com/echonest/pyechonest/blob/d8c7af6c1da699b50b2f4b1bd3c0febe72e7f1ee/pyechonest/sandbox.py#L20-L48
echonest/pyechonest
pyechonest/artist.py
search
def search(name=None, description=None, style=None, mood=None, start=0, \ results=15, buckets=None, limit=False, \ fuzzy_match=False, sort=None, max_familiarity=None, min_familiarity=None, \ max_hotttnesss=None, min_hotttnesss=None, test_new_things=None, rank_type=None, \ ...
python
def search(name=None, description=None, style=None, mood=None, start=0, \ results=15, buckets=None, limit=False, \ fuzzy_match=False, sort=None, max_familiarity=None, min_familiarity=None, \ max_hotttnesss=None, min_hotttnesss=None, test_new_things=None, rank_type=None, \ ...
Search for artists by name, description, or constraint. Args: Kwargs: name (str): the name of an artist description (str): A string describing the artist style (str): A string describing the style/genre of the artist mood (str): A string descr...
https://github.com/echonest/pyechonest/blob/d8c7af6c1da699b50b2f4b1bd3c0febe72e7f1ee/pyechonest/artist.py#L731-L795
echonest/pyechonest
pyechonest/artist.py
top_hottt
def top_hottt(start=0, results=15, buckets = None, limit=False): """Get the top hotttest artists, according to The Echo Nest Args: Kwargs: results (int): An integer number of results to return start (int): An integer starting value for the result set bucke...
python
def top_hottt(start=0, results=15, buckets = None, limit=False): """Get the top hotttest artists, according to The Echo Nest Args: Kwargs: results (int): An integer number of results to return start (int): An integer starting value for the result set bucke...
Get the top hotttest artists, according to The Echo Nest Args: Kwargs: results (int): An integer number of results to return start (int): An integer starting value for the result set buckets (list): A list of strings specifying which buckets to retrieve ...
https://github.com/echonest/pyechonest/blob/d8c7af6c1da699b50b2f4b1bd3c0febe72e7f1ee/pyechonest/artist.py#L797-L835
echonest/pyechonest
pyechonest/artist.py
top_terms
def top_terms(results=15): """Get a list of the top overall terms Args: Kwargs: results (int): An integer number of results to return Returns: A list of term document dicts Example: >>> terms = artist.top_terms(results=5) >>> terms [{u'fre...
python
def top_terms(results=15): """Get a list of the top overall terms Args: Kwargs: results (int): An integer number of results to return Returns: A list of term document dicts Example: >>> terms = artist.top_terms(results=5) >>> terms [{u'fre...
Get a list of the top overall terms Args: Kwargs: results (int): An integer number of results to return Returns: A list of term document dicts Example: >>> terms = artist.top_terms(results=5) >>> terms [{u'frequency': 1.0, u'name': u'rock'}, ...
https://github.com/echonest/pyechonest/blob/d8c7af6c1da699b50b2f4b1bd3c0febe72e7f1ee/pyechonest/artist.py#L838-L867
echonest/pyechonest
pyechonest/artist.py
similar
def similar(names=None, ids=None, start=0, results=15, buckets=None, limit=False, max_familiarity=None, min_familiarity=None, max_hotttnesss=None, min_hotttnesss=None, seed_catalog=None,artist_start_year_before=None, \ artist_start_year_after=None,artist_end_year_before=None,artist_end_year_afte...
python
def similar(names=None, ids=None, start=0, results=15, buckets=None, limit=False, max_familiarity=None, min_familiarity=None, max_hotttnesss=None, min_hotttnesss=None, seed_catalog=None,artist_start_year_before=None, \ artist_start_year_after=None,artist_end_year_before=None,artist_end_year_afte...
Return similar artists to this one Args: Kwargs: ids (str/list): An artist id or list of ids names (str/list): An artist name or list of names results (int): An integer number of results to return buckets (list): A list of strings specifying w...
https://github.com/echonest/pyechonest/blob/d8c7af6c1da699b50b2f4b1bd3c0febe72e7f1ee/pyechonest/artist.py#L911-L996
echonest/pyechonest
pyechonest/artist.py
extract
def extract(text='', start=0, results=15, buckets=None, limit=False, max_familiarity=None, min_familiarity=None, max_hotttnesss=None, min_hotttnesss=None): """Extract artist names from a block of text. Args: Kwargs: text (str): The text to extract artists from ...
python
def extract(text='', start=0, results=15, buckets=None, limit=False, max_familiarity=None, min_familiarity=None, max_hotttnesss=None, min_hotttnesss=None): """Extract artist names from a block of text. Args: Kwargs: text (str): The text to extract artists from ...
Extract artist names from a block of text. Args: Kwargs: text (str): The text to extract artists from start (int): An integer starting value for the result set results (int): An integer number of results to return buckets (list): A list of strings specify...
https://github.com/echonest/pyechonest/blob/d8c7af6c1da699b50b2f4b1bd3c0febe72e7f1ee/pyechonest/artist.py#L998-L1059
echonest/pyechonest
pyechonest/artist.py
suggest
def suggest(q='', results=15, buckets=None, limit=False, max_familiarity=None, min_familiarity=None, max_hotttnesss=None, min_hotttnesss=None): """Suggest artists based upon partial names. Args: Kwargs: q (str): The text to suggest artists from results (int): An integer nu...
python
def suggest(q='', results=15, buckets=None, limit=False, max_familiarity=None, min_familiarity=None, max_hotttnesss=None, min_hotttnesss=None): """Suggest artists based upon partial names. Args: Kwargs: q (str): The text to suggest artists from results (int): An integer nu...
Suggest artists based upon partial names. Args: Kwargs: q (str): The text to suggest artists from results (int): An integer number of results to return buckets (list): A list of strings specifying which buckets to retrieve limit (bool): A boolean indicating whether or not to...
https://github.com/echonest/pyechonest/blob/d8c7af6c1da699b50b2f4b1bd3c0febe72e7f1ee/pyechonest/artist.py#L1062-L1119
echonest/pyechonest
pyechonest/artist.py
Artist.get_biographies
def get_biographies(self, results=15, start=0, license=None, cache=True): """Get a list of artist biographies Args: Kwargs: cache (bool): A boolean indicating whether or not the cached value should be used (if available). Defaults to True. r...
python
def get_biographies(self, results=15, start=0, license=None, cache=True): """Get a list of artist biographies Args: Kwargs: cache (bool): A boolean indicating whether or not the cached value should be used (if available). Defaults to True. r...
Get a list of artist biographies Args: Kwargs: cache (bool): A boolean indicating whether or not the cached value should be used (if available). Defaults to True. results (int): An integer number of results to return start (...
https://github.com/echonest/pyechonest/blob/d8c7af6c1da699b50b2f4b1bd3c0febe72e7f1ee/pyechonest/artist.py#L130-L161