Skip to content

atmoswing/atmoswing-api

Repository files navigation

AtmoSwing web API to serve the forecasts

Tests GitHub release Docker Image Version PyPI Static Badge

Setup

Specify the environment variables in a .env file:

# .env
# Directory where the forecasts are stored
data_dir=/opt/atmoswing/data

Usage with Docker

The easiest way to use the AtmoSwing API is through Docker (Image available on Docker Hub). Here is an example of a docker-compose.yml file:

version: "3.8"

services:
  atmoswing-api:
    image: atmoswing/atmoswing-api:main
    container_name: atmoswing-api-main
    ports:
      - "8000:8000"
    volumes:
      - /home/ubuntu/data:/app/data
      - /home/atmoswing_adn/home:/app/data/adn
      - /home/atmoswing_zap/home:/app/data/zap
    depends_on:
      - redis
    environment:
      - REDIS_HOST=redis
      - REDIS_PORT=6379
    restart: unless-stopped

  redis:
    image: redis:7
    container_name: atmoswing-redis
    ports:
      - "6379:6379"
    restart: unless-stopped

Cleanup

To remove the past forecasts automatically, set a cron tab to run:

sudo docker exec atmoswing-api-main python3 /app/atmoswing_api/app/utils/cleaner.py --data-dir /app/data --keep-days 60

Development

Run the local server from the IDE with:

uvicorn app.main:app --reload

Documentation

The API documentation is available at:

About

AtmoSwing API server to serve the forecasts on demand

Resources

License

Stars

Watchers

Forks

Packages

 
 
 

Contributors

Languages