Module: ncbi.datasets.openapi.rest

NCBI Datasets API

Module: ncbi.datasets.openapi.rest

NCBI Datasets API

### NCBI Datasets is a resource that lets you easily gather data from NCBI. The Datasets version 1 API is considred stable and will not be subject to breaking changes. However, certain endpoints will be [deprecated](https://www.ncbi.nlm.nih.gov/datasets/docs/v1/reference-docs/rest-api/deprecated_apis/), and then sunset as newer versions are published. For some larger downloads, you may want to download a [dehydrated zip archive](https://www.ncbi.nlm.nih.gov/datasets/docs/v1/how-tos/genomes/large-download/), and retrieve the individual data files at a later time. # noqa: E501

The version of the OpenAPI document: v1 Generated by: https://openapi-generator.tech

class ncbi.datasets.openapi.rest.RESTResponse(resp)

Bases: io.IOBase

getheaders()

Returns a dictionary of the response headers.

getheader(name, default=None)

Returns a given response header.

class ncbi.datasets.openapi.rest.RESTClientObject(configuration, pools_size=4, maxsize=None)

Bases: object

request(method, url, query_params=None, headers=None, body=None, post_params=None, _preload_content=True, _request_timeout=None)

Perform requests.

Parameters
  • method – http request method

  • url – http request url

  • query_params – query parameters in the url

  • headers – http request headers

  • body – request json body, for application/json

  • post_params – request post parameters, application/x-www-form-urlencoded and multipart/form-data

  • _preload_content – if False, the urllib3.HTTPResponse object will be returned without reading/decoding response data. Default is True.

  • _request_timeout – timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of (connection, read) timeouts.

GET(url, headers=None, query_params=None, _preload_content=True, _request_timeout=None)
HEAD(url, headers=None, query_params=None, _preload_content=True, _request_timeout=None)
OPTIONS(url, headers=None, query_params=None, post_params=None, body=None, _preload_content=True, _request_timeout=None)
DELETE(url, headers=None, query_params=None, body=None, _preload_content=True, _request_timeout=None)
POST(url, headers=None, query_params=None, post_params=None, body=None, _preload_content=True, _request_timeout=None)
PUT(url, headers=None, query_params=None, post_params=None, body=None, _preload_content=True, _request_timeout=None)
PATCH(url, headers=None, query_params=None, post_params=None, body=None, _preload_content=True, _request_timeout=None)
Generated November 25, 2024