1234567891011121314151617181920212223242526272829303132333435363738 |
- """Hervul en Voorspel Systeem"""
- import os
- import logging
- import telegram
- from sqlalchemy import create_engine
- from sqlalchemy.orm import sessionmaker
- from dotenv import load_dotenv
- from apscheduler.schedulers.background import BackgroundScheduler
- from app.models import Base, Region, DeepExploration, ResourceTrack, ResourceStat
- load_dotenv()
- # Telegram
- TELEGRAM_BOT = telegram.Bot(os.environ['TELEGRAM_KEY'])
- # database
- ENGINE = create_engine(os.environ["DATABASE_URI"])
- SESSION = sessionmaker(bind=ENGINE)
- # scheduler
- SCHEDULER = BackgroundScheduler()
- SCHEDULER.start()
- logging.basicConfig(
- format='%(asctime)s - %(name)s - %(levelname)s - %(message)s',
- level=logging.INFO
- )
- LOGGER = logging.getLogger(__name__)
- # api
- BASE_URL = os.environ["API_URL"]
- HEADERS = {
- 'Authorization': os.environ["AUTHORIZATION"]
- }
|