A CLI for the EarthScope API
Project description
EarthScope CLI
A Typer CLI for authenticating with the EarthScope API
Getting Started
-
(Optional) Suggest setting up and activating a python virtual environment so as to not clutter your system python
python3 -m venv venv . venv/bin/activate
-
Install the CLI:
pip install earthscope-cli
-
Use the CLI. The package has a
console_scripts
section which makes a shortcut calledes
available in your python environment.es --help
Use the CLI with your user profile
# Login to EarthScope with Device Authorization Flow using one of the following
es sso login
es sso login --token
# Get access token
es sso access --token
# Refresh access token
es sso refresh
# Get your user profile from the `user-management-api` running behind https://test-idm.unavco.org/user/profile/
es user get
# Explore the CLI
es --help
es sso --help
Use the CLI with machine-to-machine client credentials
# Set required environment variables
export ES_CLI_M2M_CLIENT_ID=my_m2m_client_id
export ES_CLI_M2M_CLIENT_SECRET=my_m2m_client_secret
# Login to EarthScope with Client Credentials Flow using one of the following
es m2m login
es m2m login --token
# Get access token
es m2m access --token
# Lookup a user's anonymous profile info
es user lookup --id 'google-oauth2|115207392315468355758'
# Explore the CLI
es m2m --help
Project details
Release history Release notifications | RSS feed
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-0.7.0.tar.gz
(15.7 kB
view hashes)
Built Distribution
Close
Hashes for earthscope_cli-0.7.0-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 0a174f52d3514a0af0ef193f81e4720cd6f34450a18644ee4aef167e23a78c12 |
|
MD5 | 674aa741914edddf79246edd587fced8 |
|
BLAKE2b-256 | 37cc3ea160f6345cf14683567a9c210f7975a237eac423fdec5c10ae714a31e9 |