Skip to main content

Data Link CLI Bulk Download Utility

Project description

bulkdownload

Utility script to retrieve bulk downloads

Environment Variables

Env Var Description Required
NDL_APIKEY Data Link api key. Used for all requests to perform bulk download. Yes
NDL_HOSTNAME Alternative hostname to retrieve files. No

Install

Create a venv or pyenv if you like and activate.

pip install ndlbulkdownload

Usage

The '--param' accepts key/value pairs as you would define query parameters. For any given product documentation, define the key as necessary.

Note, for collections, you can specify multiple of the same key. Use RFC brackets [] for lists of a given key. See examples below.

usage: bulkdownload [-h] --code VC/TC
                    [--param [key value [value ...]]]
                    [--output-directory /tmp/ndl]
                    [--debug]
                    [--verbose]
                    [--skip-proxy] [--skip-ssl-verify]
                    [--redirect | --no-redirect]
                    [--workers W]
                    [--host hostname]
                    [--version]

Bulk Download from Data Link.

options:
  -h, --help            show this help message and exit
  --code VC/TC          The vendor_code/table_code you are trying to download.
                        Example: FOO/BAR
  --param key value [value ...]
                        Add query param key/value pair
  -O O, --output-directory O
                        Directory to output files. Example: /tmp/ndl (default: current directory)
  --debug               Increase log level to DEBUG
  --verbose             Show logging output
  --skip-proxy          Ignore proxy environment variables
  --skip-ssl-verify     Do not verify SSL (not recommended in most situations)
  --redirect, --no-redirect
                        Request redirect to files (default: true)
  --workers W           Total parallel workers (default: min(32, os.cpu_count()))
  --host hostname       Define an alternative hostname
  --version             show program's version number and exit

Examples

# download data on a particular date:
bulkdownload --code FOO/BAR --param date.eq 2024-09-01

# download multiple tickers between a given date [start, end)
bulkdownload --code FOO/BAR --param 'symbols.in[]' MSFT AAPL --param date.gte 2024-01-01 --param date.lt 2024-04-01

# download multiple tickers between a given date [start, end) and with output directory
bulkdownload --code FOO/BAR --param 'symbols.in[]' MSFT --param 'symbols.in[]' AAPL --param date.gte 2024-01-01 --param date.lt 2024-04-01 -O /tmp/ndl

External Documentation

Please read more about possible arguments for a given table. You can read more about the api parameter specification here.

Development

Be sure to install optional dependencies. You can run the following to install development related tools:

make install-devtools

To try your changes with a localized shim:

make install-dev

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

ndlbulkdownload-0.2.0.tar.gz (6.4 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

ndlbulkdownload-0.2.0-py3-none-any.whl (8.2 kB view details)

Uploaded Python 3

File details

Details for the file ndlbulkdownload-0.2.0.tar.gz.

File metadata

  • Download URL: ndlbulkdownload-0.2.0.tar.gz
  • Upload date:
  • Size: 6.4 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.11.2

File hashes

Hashes for ndlbulkdownload-0.2.0.tar.gz
Algorithm Hash digest
SHA256 0bf49a4fbd68fa290c9e18c556206afc375929c6bf92387dfe07729e452ea2ad
MD5 23ce5c6c52dd30c12064772a32426415
BLAKE2b-256 08dd54eaad918c5f268085ad20944261a87cf69bc930bb4981158ae371208f0a

See more details on using hashes here.

File details

Details for the file ndlbulkdownload-0.2.0-py3-none-any.whl.

File metadata

File hashes

Hashes for ndlbulkdownload-0.2.0-py3-none-any.whl
Algorithm Hash digest
SHA256 3471990745852e9af0c0e1b305fc901c678a3c7f00c9928d7c513356a2dd9a9b
MD5 68c56d4f3710896e8de701ac0b001f79
BLAKE2b-256 ac006bb5b7e1758729a955be2bac83d7886cc8079090d044942b4d9c34f56951

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page