import logging
from importlib.metadata import PackageNotFoundError, version

from .ingest_data import ingest_and_write, ingest_data, process_data
from .query_data.query_build import build_query
from .query_data.query_rows import query_rows
from .settings import InfluxSettings, load_settings, write_settings_file
from .types import TUID
from .write_data.write_batch import write_batch
from .write_data.write_point import write_point
from .write_data.writer import InfluxWriteError

logging.getLogger(__name__).addHandler(logging.NullHandler())

try:
    __version__ = version("deteqt")
except PackageNotFoundError:
    __version__ = "0.0.0"

__all__ = [
    "__version__",
    "InfluxSettings",
    "build_query",
    "ingest_and_write",
    "ingest_data",
    "load_settings",
    "process_data",
    "query_rows",
    "write_settings_file",
    "write_batch",
    "write_point",
    "TUID",
    "InfluxWriteError",
]
