Skip to main content

NtDownload

NtDownload is a tool for downloading and keeping up-to-date a local version of the NCBI Taxonomy database dump files

After download it creates a timestamp file, so that the next time the download is repeated only if a newer version is available.

Installation

The software is distributed as a Python 3 package and can be installed using pip install ntdownload.

Command line interface

ntdownload

To download the dump files, use the ntdownload script. Thereby the output directory is passed as CLI argument. If it does not exist, it is created. The file is downloaded using FTP, unless this does not work or the option --force-https is used, in which case HTTPS is used.

The dump files archive is unpacked after download and deleted, unless the option --no-unpack is used.

If the option --exitcode is used, then the exit code of the script is 100 if no newer version of the dump files was found, and thus nothing was downloaded. Otherwise the exit code is always 0 (or 1 on error).

ntnames

The script ntnames is provided, which, after download using ntdownload can be used for creating a list of taxonomy IDs and scientific names, which can be used as attribute source file for fastsubtrees.

API

Downloader

To download the dump files, use the Downloader class:

from ntdownload import Downloader
d = Downloader(output_directory_name)
has_downloaded = d.run()

The output directory is created if it does not exist. The dump files archive is unpacked and the archive deleted, except if the option unpack=False is used.

The download protocol is FTP unless it is not working or the option force_https=True is used, in which case HTTPS is used.

The return value of run() is True if a dump file was downloaded, False if no newer version was available.

Scientific names iterator

The function yield_scientific_names_from_dump(ntdumps_dir) yields tuples in the form (tax_id, scientific_name) reading them from the names.dmp file.

Test suite

The test suite is run using pytest.

Metadata

Release files for ntdownload 1.7.1

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for ntdownload 1.7.1
File Size Uploaded
ntdownload-1.7.1.tar.gz 5.9 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for ntdownload 1.7.1
File Interpreter ABI Platform
ntdownload-1.7.1-py3-none-any.whl Python 3 none any Details

Total release size: 13.2 kB

Release files / ntdownload-1.7.1.tar.gz

Download URL ntdownload-1.7.1.tar.gz
Size 5.9 kB
Tags Source
SHA-256 checksum
How to use checksums
545be1862a59ceb50b89754819f6e16356ac906e0aa0b1e93311051fb8771999
BLAKE2b-256 checksum
How to use checksums
c3c8d077469684ff239fb529d101243918d98b00fb494904e57d639197c6c11b
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/4.0.1 CPython/3.9.12

Release files / ntdownload-1.7.1-py3-none-any.whl

Download URL ntdownload-1.7.1-py3-none-any.whl
Size 7.3 kB
Tags Python 3
SHA-256 checksum
How to use checksums
192c5b89882199d2e3c3579a0f2242bcb4d9abd7ee686924f6bcd37db0605d56
BLAKE2b-256 checksum
How to use checksums
4632c92d9723deb1d7ada118263d08e876e250e2b27fb725a7103c9c662cb1b8
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/4.0.1 CPython/3.9.12

Release history Release notifications | RSS feed

This release

1.7.1 This release

2 release files

1.7

2 release files

1.6

2 release files

1.5

2 release files

1.4

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page