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.9

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.1.1.tar.gz (27.2 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.1.1-py3-none-any.whl (20.3 kB view details)

Uploaded Python 3

File details

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

File metadata

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

File hashes

Hashes for earthscope_cli-1.1.1.tar.gz
Algorithm Hash digest
SHA256 8f3c35888165a650db270a53ea621b00a9f2a7e687e0202aca58b864d1d9bf66
MD5 a8ab1c7b813c4131cd4c24622b87ac37
BLAKE2b-256 1c643f10dd563cb88a761492bbaf2e393b2eeee08ca8c4b8320fd2445402e85a

See more details on using hashes here.

File details

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

File metadata

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

File hashes

Hashes for earthscope_cli-1.1.1-py3-none-any.whl
Algorithm Hash digest
SHA256 e6937df99593d69a66f440e201673ad3107af53267ceb3c877373e73f1e1213c
MD5 dcb149df5a48f4ad104def01ab4a5aff
BLAKE2b-256 a9f15ca0f95ad326d1a45af906ff24f5d6fae0adcbb24c085c65b680a2f217b6

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