relsynth 1.0.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.
Files changed (57) hide show
  1. relsynth/__init__.py +32 -0
  2. relsynth/__main__.py +5 -0
  3. relsynth/_version.py +2 -0
  4. relsynth/api.py +709 -0
  5. relsynth/cli.py +612 -0
  6. relsynth/connectors/__init__.py +129 -0
  7. relsynth/connectors/base.py +181 -0
  8. relsynth/connectors/ddl.py +229 -0
  9. relsynth/connectors/ddl_types.py +68 -0
  10. relsynth/connectors/files.py +180 -0
  11. relsynth/connectors/mssql.py +47 -0
  12. relsynth/connectors/oracle.py +31 -0
  13. relsynth/connectors/postgres.py +46 -0
  14. relsynth/connectors/sql.py +574 -0
  15. relsynth/connectors/sqlfuncs.py +148 -0
  16. relsynth/connectors/sqlite.py +36 -0
  17. relsynth/copula.py +412 -0
  18. relsynth/counts.py +98 -0
  19. relsynth/data.py +401 -0
  20. relsynth/diagnostics.py +149 -0
  21. relsynth/discovery.py +1437 -0
  22. relsynth/doctor.py +531 -0
  23. relsynth/engine.py +4936 -0
  24. relsynth/errors.py +64 -0
  25. relsynth/evaluate.py +1443 -0
  26. relsynth/export.py +1111 -0
  27. relsynth/expr.py +708 -0
  28. relsynth/introspect.py +1047 -0
  29. relsynth/kernels.py +69 -0
  30. relsynth/keyfind.py +618 -0
  31. relsynth/marginals.py +287 -0
  32. relsynth/model_report.py +298 -0
  33. relsynth/pii.py +66 -0
  34. relsynth/pipeline.py +255 -0
  35. relsynth/posterior.py +118 -0
  36. relsynth/prepare.py +359 -0
  37. relsynth/profiling.py +327 -0
  38. relsynth/pushdown/__init__.py +14 -0
  39. relsynth/pushdown/loader.py +103 -0
  40. relsynth/pushdown/planner.py +97 -0
  41. relsynth/pushdown/stats.py +201 -0
  42. relsynth/py.typed +0 -0
  43. relsynth/relational.py +1475 -0
  44. relsynth/replica.py +898 -0
  45. relsynth/schema.py +447 -0
  46. relsynth/source.py +224 -0
  47. relsynth/spec.py +953 -0
  48. relsynth/stancheck.py +197 -0
  49. relsynth/table_model.py +431 -0
  50. relsynth/text.py +206 -0
  51. relsynth/transform.py +642 -0
  52. relsynth/verify.py +299 -0
  53. relsynth-1.0.0.dist-info/METADATA +445 -0
  54. relsynth-1.0.0.dist-info/RECORD +57 -0
  55. relsynth-1.0.0.dist-info/WHEEL +5 -0
  56. relsynth-1.0.0.dist-info/entry_points.txt +2 -0
  57. relsynth-1.0.0.dist-info/top_level.txt +1 -0
relsynth/__init__.py ADDED
@@ -0,0 +1,32 @@
1
+ """relsynth: Bayesian synthetic data for relational databases.
2
+
3
+ import relsynth as rs
4
+ spec = rs.introspect("sqlite:shop.db") # draft a specification
5
+ model = rs.fit(spec) # fit the Bayesian model
6
+ data = model.sample(scale=2.0) # a synthetic database
7
+ model.evaluate(data).require(0.98) # quality gate
8
+ data.write("csv:synthetic/")
9
+
10
+ See README.md and docs/ for the user guide, the CLI, the connectors and the
11
+ theory (propositions and proofs).
12
+ """
13
+ from ._version import __version__
14
+
15
+ # Submodules named like API functions are loaded first: importing a submodule for
16
+ # the first time binds its name on the package, which would hide the function.
17
+ from . import doctor as _doctor_module # noqa: F401
18
+ from . import evaluate as _evaluate_module # noqa: F401
19
+ from . import introspect as _introspect_module # noqa: F401
20
+ from . import verify as _verify_module # noqa: F401
21
+ from .api import (Diagnosis, EvaluationReport, FittedModel, RunResult, Spec, SyntheticData, clone_schema, connect,
22
+ doctor, evaluate, export_model, fit, introspect, ping, profile, run, sample, tune, validate_spec,
23
+ verify)
24
+ from .engine import Synthesizer
25
+ from .errors import EngineError, QualityGateError, RelsynthError, SourceError
26
+ from .spec import SpecError, dump_spec, load_spec
27
+ from .verify import VerifyReport
28
+
29
+ __all__ = ["__version__", "Spec", "FittedModel", "SyntheticData", "EvaluationReport", "RunResult", "Diagnosis",
30
+ "introspect", "validate_spec", "fit", "sample", "evaluate", "run", "doctor", "tune", "export_model", "verify",
31
+ "clone_schema", "profile", "ping", "connect", "Synthesizer", "VerifyReport", "load_spec", "dump_spec",
32
+ "RelsynthError", "SpecError", "SourceError", "EngineError", "QualityGateError"]
relsynth/__main__.py ADDED
@@ -0,0 +1,5 @@
1
+ import sys
2
+
3
+ from .cli import main
4
+
5
+ sys.exit(main())
relsynth/_version.py ADDED
@@ -0,0 +1,2 @@
1
+ """The package version (single source: pyproject.toml reads it from here)."""
2
+ __version__ = "1.0.0"