tabalyst 0.1.0__py3-none-any.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
tabalyst/__init__.py ADDED
@@ -0,0 +1,20 @@
1
+ """Public Python interface for Tabalyst."""
2
+
3
+ from tabalyst._version import __version__
4
+ from tabalyst.analysis import analyze_column as analyze_column
5
+ from tabalyst.config import AnalysisConfig as AnalysisConfig
6
+ from tabalyst.errors import ConfigurationError, InputError, ReportError, TabalystError
7
+ from tabalyst.reporting import render_report as render_report
8
+ from tabalyst.service import analyze
9
+ from tabalyst.service import analyze_csv as analyze_csv
10
+
11
+ __all__ = [
12
+ "ConfigurationError",
13
+ "InputError",
14
+ "ReportError",
15
+ "TabalystError",
16
+ "__version__",
17
+ "analyze",
18
+ ]
19
+
20
+ # Alpha compatibility imports remain available, but are not part of the 0.1.0 API.
tabalyst/__main__.py ADDED
@@ -0,0 +1,6 @@
1
+ """Run the Tabalyst command-line application with ``python -m tabalyst``."""
2
+
3
+ from tabalyst.cli import main
4
+
5
+ if __name__ == "__main__":
6
+ main()
tabalyst/_version.py ADDED
@@ -0,0 +1,23 @@
1
+ """Resolve the application version from its single packaging source of truth."""
2
+
3
+ import tomllib
4
+ from importlib.metadata import Distribution, PackageNotFoundError, version
5
+ from pathlib import Path
6
+
7
+
8
+ def get_version() -> str:
9
+ """Return source metadata in a checkout and installed metadata elsewhere."""
10
+ project_file = Path(__file__).resolve().parents[2] / "pyproject.toml"
11
+ if project_file.is_file():
12
+ project = tomllib.loads(project_file.read_text(encoding="utf-8"))
13
+ return str(project["project"]["version"])
14
+ package_root = Path(__file__).resolve().parent.parent
15
+ for metadata_dir in package_root.glob("tabalyst-*.dist-info"):
16
+ return Distribution.at(metadata_dir).version
17
+ try:
18
+ return version("tabalyst")
19
+ except PackageNotFoundError:
20
+ return "unknown"
21
+
22
+
23
+ __version__ = get_version()