__init__.py 835 B

1234567891011121314151617181920212223242526272829303132333435363738
  1. """Hervul en Voorspel Systeem"""
  2. import os
  3. import logging
  4. import telegram
  5. from sqlalchemy import create_engine
  6. from sqlalchemy.orm import sessionmaker
  7. from dotenv import load_dotenv
  8. from apscheduler.schedulers.background import BackgroundScheduler
  9. from app.models import Base, Region, DeepExploration, ResourceTrack, ResourceStat
  10. load_dotenv()
  11. # Telegram
  12. TELEGRAM_BOT = telegram.Bot(os.environ['TELEGRAM_KEY'])
  13. # database
  14. ENGINE = create_engine(os.environ["DATABASE_URI"])
  15. SESSION = sessionmaker(bind=ENGINE)
  16. # scheduler
  17. SCHEDULER = BackgroundScheduler()
  18. SCHEDULER.start()
  19. logging.basicConfig(
  20. format='%(asctime)s - %(name)s - %(levelname)s - %(message)s',
  21. level=logging.INFO
  22. )
  23. LOGGER = logging.getLogger(__name__)
  24. # api
  25. BASE_URL = os.environ["API_URL"]
  26. HEADERS = {
  27. 'Authorization': os.environ["AUTHORIZATION"]
  28. }