from sqlalchemy.orm import sessionmaker class Shared: _client = None # For instagram _engine = None # For engine @classmethod def __init__(cls, cl, eng): cls._client = cl cls._engine = eng @classmethod def ig_get_client(cls): return cls._client @classmethod def db_get_session(cls): Session = sessionmaker(bind=cls._engine) return Session()