Skip to main content

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.

Metadata

Release files for earthscope-cli 1.2.0

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

Source distribution (sdist)

Source distribution for earthscope-cli 1.2.0
File Size Uploaded
earthscope_cli-1.2.0.tar.gz 29.8 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for earthscope-cli 1.2.0
File Interpreter ABI Platform
earthscope_cli-1.2.0-py3-none-any.whl Python 3 none any Details

Total release size: 52.1 kB

Release files / earthscope_cli-1.2.0.tar.gz

Download URL earthscope_cli-1.2.0.tar.gz
Size 29.8 kB
Tags Source
SHA-256 checksum
How to use checksums
8af99bfaae86d81756dab8d0e983c96e0daa2388f9e13b72fb27fb27ecba5a54
BLAKE2b-256 checksum
How to use checksums
d3f71cb3605c609aa510e597fc89d3a6689f1079e0a7b6dfc686b75147c47a6a
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.10.19

Release files / earthscope_cli-1.2.0-py3-none-any.whl

Download URL earthscope_cli-1.2.0-py3-none-any.whl
Size 22.3 kB
Tags Python 3
SHA-256 checksum
How to use checksums
851b764460467ee7c6cce677571d72787d0b1262d81967dda4043580d9d67f48
BLAKE2b-256 checksum
How to use checksums
ca7d33ef69e569b47ba96c7d319621674ad36e8920339a90386babc584ad060f
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.10.19

Release history Release notifications | RSS feed

This release

1.2.0 This release

2 release files

1.1.2

2 release files

1.1.1

2 release files

1.1.0

2 release files

1.0.1

2 release files

1.0.0

2 release files

0.9.0

2 release files

0.8.2

2 release files

0.8.1

2 release files

0.8.0

2 release files

0.7.0

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