"""
q2netcdf - Manipulate Rockland Scientific's Q-files.

Provides tools to read, parse, and convert Q-files generated by
Rockland Scientific's ISDP data logger to NetCDF format.

Main classes:
- QFile: Read Q-files with context manager
- QHeader: Parse Q-file headers
- QData, QRecord: Handle data records
- QVersion: Q-file version enumeration
- QHexCodes: Identifier to name mapping

Usage:
    For record-by-record access to Q-file data, use QFile:

        >>> from q2netcdf import QFile
        >>> with QFile("data.q") as qf:
        ...     header = qf.header()
        ...     for record in qf.data():
        ...         process(record)

    For direct conversion to an xarray Dataset, use loadQfile:

        >>> from q2netcdf.q2netcdf import loadQfile, mergeDatasets
        >>> ds = loadQfile("data.q")

    QFile gives low-level, memory-efficient streaming access to individual
    records. loadQfile eagerly loads all data into an xarray Dataset ready
    for analysis or NetCDF export.
"""

from importlib.metadata import version, PackageNotFoundError

try:
    __version__ = version("q2netcdf")
except PackageNotFoundError:
    # Fallback for development installations
    __version__ = "0.0.0+unknown"

__author__ = "Pat Welch"
__email__ = "pat@mousebrains.com"

from .QFile import QFile
from .QHeader import QHeader
from .QData import QData, QRecord
from .QVersion import QVersion
from .QHexCodes import QHexCodes
from .QConfig import QConfig

__all__ = [
    "QFile",
    "QHeader",
    "QData",
    "QRecord",
    "QVersion",
    "QHexCodes",
    "QConfig",
]
