Skip to main content

No project description provided

Project description

nasa-csda-cli

This is a CLI and SDK for querying and downloading files from Spire's CSDA catalog.

Install it from PyPI

pip install nasa-csda

Using the CLI

See the command's help dialog for detailed usage information for all commands.

nasa-csda-cli --help

All of the commands require login information (the same username and password used to log into the web page). You can also set environment variables to provide these credentials.

export CSDA_USERNAME=<username>
export CSDA_PASSWORD=<password>

Bulk downloading files

The catalog's web page provides the ability to download a query configuration file that can be provided to the CLI to download all files matching the query created in the UI. To download all files using this configuration file,

nasa-csda-cli --username <username> --password <password> bulk-download download-config.json

Querying the catalog

You can also construct queries to perform custom tasks using the query command.

nasa-csda-cli query --start-date 2020-01-01 --end-date 2020-01-02 \
    --products opnGns,atmPhs \
    --min-latitude -50 --max-latitude 50 --min-longitude -50 --max-longitude 50

By default, this will download all matching files in the same way that the bulk download does. There are two additional modes of operation this command supports.

Listing download links

In list mode, a link to all files will be printed to STDOUT.

nasa-csda-cli query --start-date 2020-01-01 --end-date 2020-01-02 \
    --products opnGns,atmPhs \
    --min-latitude -50 --max-latitude 50 --min-longitude -100 --max-longitude 100 \
    --mode list --no-progress --limit 10
https://nasa-csda.wx.spire.com/download/spire/2020-01-01T23-56-00_FM104_R15_atmPhs/spire_gnss-ro_L1B_atmPhs_v06.01_2020-01-01T23-56-00_FM104_R15.nc
https://nasa-csda.wx.spire.com/download/spire/2020-01-01T23-55-05_FM105_R14_atmPhs/spire_gnss-ro_L1B_atmPhs_v06.01_2020-01-01T23-55-05_FM105_R14.nc
https://nasa-csda.wx.spire.com/download/spire/2020-01-01T23-54-35_FM105_G07_atmPhs/spire_gnss-ro_L1B_atmPhs_v06.01_2020-01-01T23-54-35_FM105_G07.nc
https://nasa-csda.wx.spire.com/download/spire/2020-01-01T23-54-12_FM104_G32_atmPhs/spire_gnss-ro_L1B_atmPhs_v06.01_2020-01-01T23-54-12_FM104_G32.nc
https://nasa-csda.wx.spire.com/download/spire/2020-01-01T23-53-50_FM105_G30_atmPhs/spire_gnss-ro_L1B_atmPhs_v06.01_2020-01-01T23-53-50_FM105_G30.nc
https://nasa-csda.wx.spire.com/download/spire/2020-01-01T23-52-32_FM085_G31_atmPhs/spire_gnss-ro_L1B_atmPhs_v06.01_2020-01-01T23-52-32_FM085_G31.nc
https://nasa-csda.wx.spire.com/download/spire/2020-01-01T23-52-07_FM105_G12_atmPhs/spire_gnss-ro_L1B_atmPhs_v06.01_2020-01-01T23-52-07_FM105_G12.nc
https://nasa-csda.wx.spire.com/download/spire/2020-01-01T23-51-38_FM106_G03_atmPhs/spire_gnss-ro_L1B_atmPhs_v06.01_2020-01-01T23-51-38_FM106_G03.nc
https://nasa-csda.wx.spire.com/download/spire/2020-01-01T23-51-35_FM105_E03_atmPhs/spire_gnss-ro_L1B_atmPhs_v06.01_2020-01-01T23-51-35_FM105_E03.nc
https://nasa-csda.wx.spire.com/download/spire/2020-01-01T23-51-32_FM104_G25_atmPhs/spire_gnss-ro_L1B_atmPhs_v06.01_2020-01-01T23-51-32_FM104_G25.nc

Getting raw GeoJSON objects

In raw mode, the command will stream out GeoJSON objects conforming to the STAC spec.

nasa-csda-cli query --start-date 2020-01-01 --end-date 2020-01-02 \
    --products opnGns,atmPhs \
    --min-latitude -50 --max-latitude 50 --min-longitude -100 --max-longitude 100 \
    --mode raw --no-progress --limit 1

Using the CLI to authenticate requests

Advanced users can use the token command to generate authentication headers that allow downloading files using other tools.

TOKEN="$(nasa-csda-cli token)"
curl -O -L -H "Authentication: Bearer ${TOKEN}" https://nasa-csda.wx.spire.com/download/spire/2020-01-01T23-56-00_FM104_R15_atmPhs/spire_gnss-ro_L1B_atmPhs_v06.01_2020-01-01T23-56-00_FM104_R15.nc

Using the SDK

The library can be directly for custom behavior. See the examples for information on how to use it.

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

nasa_csda-1.0.1.tar.gz (13.3 kB view details)

Uploaded Source

Built Distribution

nasa_csda-1.0.1-py3-none-any.whl (15.6 kB view details)

Uploaded Python 3

File details

Details for the file nasa_csda-1.0.1.tar.gz.

File metadata

  • Download URL: nasa_csda-1.0.1.tar.gz
  • Upload date:
  • Size: 13.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/5.1.0 CPython/3.12.5

File hashes

Hashes for nasa_csda-1.0.1.tar.gz
Algorithm Hash digest
SHA256 c2ca1a08f43516addd2083423e1f5c67129d61210a36222eb83e1fd4f89fbcff
MD5 2e967ede80e24cd6159a6d588384ddb8
BLAKE2b-256 b10aaf9d69ed58fbc0f5a215bdfb92c96936d77440f41e2c2a49846ece11fa9c

See more details on using hashes here.

File details

Details for the file nasa_csda-1.0.1-py3-none-any.whl.

File metadata

  • Download URL: nasa_csda-1.0.1-py3-none-any.whl
  • Upload date:
  • Size: 15.6 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/5.1.0 CPython/3.12.5

File hashes

Hashes for nasa_csda-1.0.1-py3-none-any.whl
Algorithm Hash digest
SHA256 d5ef649b75b74d96ba670dac03e818230c10dbb88ff93eba9f3e74efe8a93b45
MD5 e7d01f6e0fe0b3f8ed7c15904c7dfc73
BLAKE2b-256 fecda55b231da99737fcf2a9e51edf6f69f998b9730cd913650cdb18eca30d0e

See more details on using hashes here.

Supported by

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