1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
|
%global _empty_manifest_terminate_build 0
Name: python-ncbi-datasets-pylib
Version: 14.26.0
Release: 1
Summary: Easily gather data from across NCBI databases
License: Public Domain
URL: https://www.ncbi.nlm.nih.gov/datasets
Source0: https://mirrors.nju.edu.cn/pypi/web/packages/3b/f7/8217f6cb4d2328ccd11791a19b668ad98861839d5b231f676905b086faa4/ncbi-datasets-pylib-14.26.0.tar.gz
BuildArch: noarch
%description
[NCBI Datasets]( https://www.ncbi.nlm.nih.gov/datasets/) is a new resource that lets you easily gather data from across NCBI databases.
Find and download sequence, annotation and metadata for genes and genomes using this python library with our [RESTful API](https://www.ncbi.nlm.nih.gov/datasets/docs/datasets-api/).
This Python library is automatically generated by the [OpenAPI Generator project](https://openapi-generator.tech/).
Build package: org.openapitools.codegen.languages.PythonClientCodegen
## Requirements
Python >= 3.7
## Installation
To install the pre-built python package, create a virtual environment and use pip:
```sh
python -m venv ve/
source ve/bin/activate
pip install ncbi-datasets-pylib
```
## Getting Started
Please follow the installation procedure above and then run the following:
```python
import time
import ncbi.datasets.openapi
from pprint import pprint
from ncbi.datasets.openapi.api import gene_api
from ncbi.datasets.openapi.model.rpc_status import RpcStatus
from ncbi.datasets.openapi.model.v1_download_summary import V1DownloadSummary
from ncbi.datasets.openapi.model.v1_fasta import V1Fasta
from ncbi.datasets.openapi.model.v1_gene_dataset_request import V1GeneDatasetRequest
from ncbi.datasets.openapi.model.v1_gene_dataset_request_content_type import V1GeneDatasetRequestContentType
from ncbi.datasets.openapi.model.v1_gene_dataset_request_sort_field import V1GeneDatasetRequestSortField
from ncbi.datasets.openapi.model.v1_gene_match import V1GeneMatch
from ncbi.datasets.openapi.model.v1_gene_metadata import V1GeneMetadata
from ncbi.datasets.openapi.model.v1_organism import V1Organism
from ncbi.datasets.openapi.model.v1_organism_query_request_tax_rank_filter import V1OrganismQueryRequestTaxRankFilter
from ncbi.datasets.openapi.model.v1_ortholog_request_content_type import V1OrthologRequestContentType
from ncbi.datasets.openapi.model.v1_ortholog_set import V1OrthologSet
from ncbi.datasets.openapi.model.v1_sci_name_and_ids import V1SciNameAndIds
from ncbi.datasets.openapi.model.v1_sort_direction import V1SortDirection
# Defining the host is optional and defaults to https://api.ncbi.nlm.nih.gov/datasets/v1
# See configuration.py for a list of all supported configuration parameters.
configuration = ncbi.datasets.openapi.Configuration(
host = "https://api.ncbi.nlm.nih.gov/datasets/v1"
)
# The client must configure the authentication and authorization parameters
# in accordance with the API server security policy.
# Examples for each auth method are provided below, use the example that
# satisfies your auth use case.
# Configure API key authorization: ApiKeyAuthHeader
configuration.api_key['ApiKeyAuthHeader'] = 'YOUR_API_KEY'
# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
# configuration.api_key_prefix['ApiKeyAuthHeader'] = 'Bearer'
# Enter a context with an instance of the API client
with ncbi.datasets.openapi.ApiClient(configuration) as api_client:
# Create an instance of the API class
api_instance = gene_api.GeneApi(api_client)
gene_ids = [
59067,
] # [int] | NCBI gene ids
include_annotation_type = [
V1Fasta("FASTA_UNSPECIFIED"),
] # [V1Fasta] | Select additional types of annotation to include in the data package. If unset, no annotation is provided. (optional)
fasta_filter = [
"fasta_filter_example",
] # [str] | Limit the FASTA sequences in the datasets package to these transcript and protein accessions (optional)
filename = "ncbi_dataset.zip" # str | Output file name. (optional) (default to "ncbi_dataset.zip")
try:
# Get a gene dataset by gene ID
api_response = api_instance.download_gene_package(gene_ids, include_annotation_type=include_annotation_type, fasta_filter=fasta_filter, filename=filename)
pprint(api_response)
except ncbi.datasets.openapi.ApiException as e:
print("Exception when calling GeneApi->download_gene_package: %s\n" % e)
```
## Documentation for API Endpoints
For detailed documentation of API endpoints, see our [GitHub page]( https://github.com/ncbi/datasets/tree/master/client_docs/python#documentation-for-api-endpoints).
## NCBI Datasets command-line tool
Alternatively, you may be interested in trying the NCBI Datasets command-line tools, datasets and dataformat.
Find out more about our command line tools in our [documentation]( https://www.ncbi.nlm.nih.gov/datasets/docs/v1/download-and-install/).
%package -n python3-ncbi-datasets-pylib
Summary: Easily gather data from across NCBI databases
Provides: python-ncbi-datasets-pylib
BuildRequires: python3-devel
BuildRequires: python3-setuptools
BuildRequires: python3-pip
%description -n python3-ncbi-datasets-pylib
[NCBI Datasets]( https://www.ncbi.nlm.nih.gov/datasets/) is a new resource that lets you easily gather data from across NCBI databases.
Find and download sequence, annotation and metadata for genes and genomes using this python library with our [RESTful API](https://www.ncbi.nlm.nih.gov/datasets/docs/datasets-api/).
This Python library is automatically generated by the [OpenAPI Generator project](https://openapi-generator.tech/).
Build package: org.openapitools.codegen.languages.PythonClientCodegen
## Requirements
Python >= 3.7
## Installation
To install the pre-built python package, create a virtual environment and use pip:
```sh
python -m venv ve/
source ve/bin/activate
pip install ncbi-datasets-pylib
```
## Getting Started
Please follow the installation procedure above and then run the following:
```python
import time
import ncbi.datasets.openapi
from pprint import pprint
from ncbi.datasets.openapi.api import gene_api
from ncbi.datasets.openapi.model.rpc_status import RpcStatus
from ncbi.datasets.openapi.model.v1_download_summary import V1DownloadSummary
from ncbi.datasets.openapi.model.v1_fasta import V1Fasta
from ncbi.datasets.openapi.model.v1_gene_dataset_request import V1GeneDatasetRequest
from ncbi.datasets.openapi.model.v1_gene_dataset_request_content_type import V1GeneDatasetRequestContentType
from ncbi.datasets.openapi.model.v1_gene_dataset_request_sort_field import V1GeneDatasetRequestSortField
from ncbi.datasets.openapi.model.v1_gene_match import V1GeneMatch
from ncbi.datasets.openapi.model.v1_gene_metadata import V1GeneMetadata
from ncbi.datasets.openapi.model.v1_organism import V1Organism
from ncbi.datasets.openapi.model.v1_organism_query_request_tax_rank_filter import V1OrganismQueryRequestTaxRankFilter
from ncbi.datasets.openapi.model.v1_ortholog_request_content_type import V1OrthologRequestContentType
from ncbi.datasets.openapi.model.v1_ortholog_set import V1OrthologSet
from ncbi.datasets.openapi.model.v1_sci_name_and_ids import V1SciNameAndIds
from ncbi.datasets.openapi.model.v1_sort_direction import V1SortDirection
# Defining the host is optional and defaults to https://api.ncbi.nlm.nih.gov/datasets/v1
# See configuration.py for a list of all supported configuration parameters.
configuration = ncbi.datasets.openapi.Configuration(
host = "https://api.ncbi.nlm.nih.gov/datasets/v1"
)
# The client must configure the authentication and authorization parameters
# in accordance with the API server security policy.
# Examples for each auth method are provided below, use the example that
# satisfies your auth use case.
# Configure API key authorization: ApiKeyAuthHeader
configuration.api_key['ApiKeyAuthHeader'] = 'YOUR_API_KEY'
# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
# configuration.api_key_prefix['ApiKeyAuthHeader'] = 'Bearer'
# Enter a context with an instance of the API client
with ncbi.datasets.openapi.ApiClient(configuration) as api_client:
# Create an instance of the API class
api_instance = gene_api.GeneApi(api_client)
gene_ids = [
59067,
] # [int] | NCBI gene ids
include_annotation_type = [
V1Fasta("FASTA_UNSPECIFIED"),
] # [V1Fasta] | Select additional types of annotation to include in the data package. If unset, no annotation is provided. (optional)
fasta_filter = [
"fasta_filter_example",
] # [str] | Limit the FASTA sequences in the datasets package to these transcript and protein accessions (optional)
filename = "ncbi_dataset.zip" # str | Output file name. (optional) (default to "ncbi_dataset.zip")
try:
# Get a gene dataset by gene ID
api_response = api_instance.download_gene_package(gene_ids, include_annotation_type=include_annotation_type, fasta_filter=fasta_filter, filename=filename)
pprint(api_response)
except ncbi.datasets.openapi.ApiException as e:
print("Exception when calling GeneApi->download_gene_package: %s\n" % e)
```
## Documentation for API Endpoints
For detailed documentation of API endpoints, see our [GitHub page]( https://github.com/ncbi/datasets/tree/master/client_docs/python#documentation-for-api-endpoints).
## NCBI Datasets command-line tool
Alternatively, you may be interested in trying the NCBI Datasets command-line tools, datasets and dataformat.
Find out more about our command line tools in our [documentation]( https://www.ncbi.nlm.nih.gov/datasets/docs/v1/download-and-install/).
%package help
Summary: Development documents and examples for ncbi-datasets-pylib
Provides: python3-ncbi-datasets-pylib-doc
%description help
[NCBI Datasets]( https://www.ncbi.nlm.nih.gov/datasets/) is a new resource that lets you easily gather data from across NCBI databases.
Find and download sequence, annotation and metadata for genes and genomes using this python library with our [RESTful API](https://www.ncbi.nlm.nih.gov/datasets/docs/datasets-api/).
This Python library is automatically generated by the [OpenAPI Generator project](https://openapi-generator.tech/).
Build package: org.openapitools.codegen.languages.PythonClientCodegen
## Requirements
Python >= 3.7
## Installation
To install the pre-built python package, create a virtual environment and use pip:
```sh
python -m venv ve/
source ve/bin/activate
pip install ncbi-datasets-pylib
```
## Getting Started
Please follow the installation procedure above and then run the following:
```python
import time
import ncbi.datasets.openapi
from pprint import pprint
from ncbi.datasets.openapi.api import gene_api
from ncbi.datasets.openapi.model.rpc_status import RpcStatus
from ncbi.datasets.openapi.model.v1_download_summary import V1DownloadSummary
from ncbi.datasets.openapi.model.v1_fasta import V1Fasta
from ncbi.datasets.openapi.model.v1_gene_dataset_request import V1GeneDatasetRequest
from ncbi.datasets.openapi.model.v1_gene_dataset_request_content_type import V1GeneDatasetRequestContentType
from ncbi.datasets.openapi.model.v1_gene_dataset_request_sort_field import V1GeneDatasetRequestSortField
from ncbi.datasets.openapi.model.v1_gene_match import V1GeneMatch
from ncbi.datasets.openapi.model.v1_gene_metadata import V1GeneMetadata
from ncbi.datasets.openapi.model.v1_organism import V1Organism
from ncbi.datasets.openapi.model.v1_organism_query_request_tax_rank_filter import V1OrganismQueryRequestTaxRankFilter
from ncbi.datasets.openapi.model.v1_ortholog_request_content_type import V1OrthologRequestContentType
from ncbi.datasets.openapi.model.v1_ortholog_set import V1OrthologSet
from ncbi.datasets.openapi.model.v1_sci_name_and_ids import V1SciNameAndIds
from ncbi.datasets.openapi.model.v1_sort_direction import V1SortDirection
# Defining the host is optional and defaults to https://api.ncbi.nlm.nih.gov/datasets/v1
# See configuration.py for a list of all supported configuration parameters.
configuration = ncbi.datasets.openapi.Configuration(
host = "https://api.ncbi.nlm.nih.gov/datasets/v1"
)
# The client must configure the authentication and authorization parameters
# in accordance with the API server security policy.
# Examples for each auth method are provided below, use the example that
# satisfies your auth use case.
# Configure API key authorization: ApiKeyAuthHeader
configuration.api_key['ApiKeyAuthHeader'] = 'YOUR_API_KEY'
# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
# configuration.api_key_prefix['ApiKeyAuthHeader'] = 'Bearer'
# Enter a context with an instance of the API client
with ncbi.datasets.openapi.ApiClient(configuration) as api_client:
# Create an instance of the API class
api_instance = gene_api.GeneApi(api_client)
gene_ids = [
59067,
] # [int] | NCBI gene ids
include_annotation_type = [
V1Fasta("FASTA_UNSPECIFIED"),
] # [V1Fasta] | Select additional types of annotation to include in the data package. If unset, no annotation is provided. (optional)
fasta_filter = [
"fasta_filter_example",
] # [str] | Limit the FASTA sequences in the datasets package to these transcript and protein accessions (optional)
filename = "ncbi_dataset.zip" # str | Output file name. (optional) (default to "ncbi_dataset.zip")
try:
# Get a gene dataset by gene ID
api_response = api_instance.download_gene_package(gene_ids, include_annotation_type=include_annotation_type, fasta_filter=fasta_filter, filename=filename)
pprint(api_response)
except ncbi.datasets.openapi.ApiException as e:
print("Exception when calling GeneApi->download_gene_package: %s\n" % e)
```
## Documentation for API Endpoints
For detailed documentation of API endpoints, see our [GitHub page]( https://github.com/ncbi/datasets/tree/master/client_docs/python#documentation-for-api-endpoints).
## NCBI Datasets command-line tool
Alternatively, you may be interested in trying the NCBI Datasets command-line tools, datasets and dataformat.
Find out more about our command line tools in our [documentation]( https://www.ncbi.nlm.nih.gov/datasets/docs/v1/download-and-install/).
%prep
%autosetup -n ncbi-datasets-pylib-14.26.0
%build
%py3_build
%install
%py3_install
install -d -m755 %{buildroot}/%{_pkgdocdir}
if [ -d doc ]; then cp -arf doc %{buildroot}/%{_pkgdocdir}; fi
if [ -d docs ]; then cp -arf docs %{buildroot}/%{_pkgdocdir}; fi
if [ -d example ]; then cp -arf example %{buildroot}/%{_pkgdocdir}; fi
if [ -d examples ]; then cp -arf examples %{buildroot}/%{_pkgdocdir}; fi
pushd %{buildroot}
if [ -d usr/lib ]; then
find usr/lib -type f -printf "/%h/%f\n" >> filelist.lst
fi
if [ -d usr/lib64 ]; then
find usr/lib64 -type f -printf "/%h/%f\n" >> filelist.lst
fi
if [ -d usr/bin ]; then
find usr/bin -type f -printf "/%h/%f\n" >> filelist.lst
fi
if [ -d usr/sbin ]; then
find usr/sbin -type f -printf "/%h/%f\n" >> filelist.lst
fi
touch doclist.lst
if [ -d usr/share/man ]; then
find usr/share/man -type f -printf "/%h/%f.gz\n" >> doclist.lst
fi
popd
mv %{buildroot}/filelist.lst .
mv %{buildroot}/doclist.lst .
%files -n python3-ncbi-datasets-pylib -f filelist.lst
%dir %{python3_sitelib}/*
%files help -f doclist.lst
%{_docdir}/*
%changelog
* Fri May 05 2023 Python_Bot <Python_Bot@openeuler.org> - 14.26.0-1
- Package Spec generated
|