23 lines
579 B
Python
23 lines
579 B
Python
"""Main file for the Ekilex API class."""
|
|
|
|
from ekilex.api.endpoints import EndpointsMixin
|
|
from ekilex.protocol import EkilexAPIBase
|
|
|
|
import aiohttp
|
|
import asyncio
|
|
|
|
class EkilexAPI(
|
|
EkilexAPIBase,
|
|
EndpointsMixin,
|
|
):
|
|
def __init__(self, api_key: str, url: str = "https://ekilex.ee") -> None:
|
|
self.url = url
|
|
self.api_key = api_key
|
|
self.headers = {
|
|
"ekilex-api-key": api_key,
|
|
"User-Agent": "EkilexPythonClient/1.0",
|
|
}
|
|
|
|
self._session: aiohttp.ClientSession | None = None
|
|
self._lock = asyncio.Lock()
|
|
|