https://github.com/guivaloz/nasa-cli
Command Line Interface made with Typer and Python for NASA API.
https://github.com/guivaloz/nasa-cli
nasa-api python
Last synced: 7 months ago
JSON representation
Command Line Interface made with Typer and Python for NASA API.
- Host: GitHub
- URL: https://github.com/guivaloz/nasa-cli
- Owner: guivaloz
- License: agpl-3.0
- Created: 2022-09-29T02:00:29.000Z (over 3 years ago)
- Default Branch: main
- Last Pushed: 2023-09-24T02:54:50.000Z (over 2 years ago)
- Last Synced: 2025-06-08T09:41:57.089Z (7 months ago)
- Topics: nasa-api, python
- Language: Python
- Homepage:
- Size: 61.5 KB
- Stars: 2
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# nasa-cli
Command Line Interface made with Typer and Python for NASA API.
## About NASA API
Go to [NASA API](https://api.nasa.gov/) to get started or read [NASA.md](NASA.md).
## Bashrc file
Create a configuration file named `.bashrc` in the root directory of the project
```bash
if [ -f ~/.bashrc ]
then
. ~/.bashrc
fi
if command -v figlet &> /dev/null
then
figlet NASA CLI
else
echo "== NASA CLI"
fi
echo
if [ -f .env ]
then
echo "-- Variables de entorno"
export $(grep -v '^#' .env | xargs)
echo " API_KEY: ${API_KEY}"
echo " TIMEOUT: ${TIMEOUT}"
echo
fi
if [ -d .venv ]
then
echo "-- Activando el entorno virtual"
source .venv/bin/activate
python --version
echo
alias nasa="python3 ${PWD}/nasa_cli/app.py"
echo "-- Ejecutar el CLI hecho con Typer"
echo " nasa --help"
echo
fi
```
## Environment variables
Create a configuration file named `.env` in the root directory of the project.
```ini
# Your API key
API_KEY=****************************************
# Requests
TIMEOUT=12
```
## Installation
Create a virtual environment
```bash
python3 -m venv .venv
```
Use poetry to install dependencies
```bash
poetry install
```
Show help
```bash
poetry run python nasa_api/app.py --help
```
## Usage
Retrieve the Astronomy Picture of the Day
```bash
nasa apod bajar
```