Skip to main content

A CLI for the EarthScope API

Project description

EarthScope CLI

A CLI for interacting with EarthScope's APIs

Getting Started

Requirements

To use the CLI you must have:

  • Registered an account with Earthscope (sign up now). See here for more information
  • Python >= 3.10

Installation

Install from PyPI

pip install earthscope-cli

Usage

A new es command is available in your terminal. Use --help with any command to explore commands and options.

es --help
es user --help

Login to your EarthScope account

es login

This will open your browser to a confirmation page with the same code shown on your command line. If you are on a device that does not have a web browser, you can copy the displayed url in a browser on another device (personal computer, mobile device, etc...) and complete the confirmation there.

The es login command will save your token locally. If this token is deleted, you will need to re-authenticate (login) to retrieve your token again.

Get your access token

es user get-access-token

The get-access-token command will display your access token. If your access token is close to expiration or expired, the default behavior is to automatically refresh your token.

If you want to manually refresh your token:

es user refresh-access-token

Never share your tokens. If you think your token has been compromised, please revoke your refresh token and re-authenticate (login):

es user revoke-refresh-token
es login

Get your user profile

es user get-profile

Documentation

For detailed usage examples, authentication guides, and advanced features, see the full documentation.

EarthScope SDK

If you would like to use EarthScope APIs from python, please use the earthscope-sdk directly.

FAQ/troubleshooting

  • How long does my access token last?
    • Your access token lasts 24 hours. Your refresh token can be used to refresh your access token.
  • How long does my refresh token last?
    • Your refresh token will never expire - unless you are inactive (do not use it) for one year. If it does expire, you will need to re-authenticate to get a new access and refresh token.
  • What is a refresh token and how does the CLI use it?
    • A refresh token is a special token that is used to renew your access token without you needing to log in again. The refresh token is obtained from your access token, and using the es user get-access-token command will automatically renew your access token if it is close to expiration. You can 'manually' refresh your access token by using the command es user refresh-access-token. If your access token is compromised, you can revoke your refresh token using es user revoke-refresh-token. Once your access token expires, it can no longer be renewed and you will need to re-login.
  • Should I hard-code my access token into my script?
    • No. We recommend you use the cli commands to retrieve your access tokens in your scripts. This way your access token will not be compromised by anyone viewing your script. The access token only lasts 24 hours and cannot be used afterwards unless refreshed.

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

earthscope_cli-1.2.0.tar.gz (29.8 kB view details)

Uploaded Source

Built Distribution

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

earthscope_cli-1.2.0-py3-none-any.whl (22.3 kB view details)

Uploaded Python 3

File details

Details for the file earthscope_cli-1.2.0.tar.gz.

File metadata

  • Download URL: earthscope_cli-1.2.0.tar.gz
  • Upload date:
  • Size: 29.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.10.19

File hashes

Hashes for earthscope_cli-1.2.0.tar.gz
Algorithm Hash digest
SHA256 8af99bfaae86d81756dab8d0e983c96e0daa2388f9e13b72fb27fb27ecba5a54
MD5 4dbfb69294dc3c7591ad2aaae3c8955e
BLAKE2b-256 d3f71cb3605c609aa510e597fc89d3a6689f1079e0a7b6dfc686b75147c47a6a

See more details on using hashes here.

File details

Details for the file earthscope_cli-1.2.0-py3-none-any.whl.

File metadata

  • Download URL: earthscope_cli-1.2.0-py3-none-any.whl
  • Upload date:
  • Size: 22.3 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.10.19

File hashes

Hashes for earthscope_cli-1.2.0-py3-none-any.whl
Algorithm Hash digest
SHA256 851b764460467ee7c6cce677571d72787d0b1262d81967dda4043580d9d67f48
MD5 d81240ea7b774e7e19af5cad32d84711
BLAKE2b-256 ca7d33ef69e569b47ba96c7d319621674ad36e8920339a90386babc584ad060f

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