Metadata-Version: 2.1
Name: nesydep
Version: 1.1.0
Summary: NeSyDep: fast neural-symbolic discovery of data dependencies (FDs, CFDs, and more)
Keywords: functional dependencies,CFD,data profiling,data quality,data dependencies
Author: NeSyDep Authors
License: MIT License
         
         Copyright (c) 2026 NeSyDep Authors
         
         Permission is hereby granted, free of charge, to any person obtaining a copy
         of this software and associated documentation files (the "Software"), to deal
         in the Software without restriction, including without limitation the rights
         to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
         copies of the Software, and to permit persons to whom the Software is
         furnished to do so, subject to the following conditions:
         
         The above copyright notice and this permission notice shall be included in all
         copies or substantial portions of the Software.
         
         THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
         IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
         FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
         AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
         LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
         OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
         SOFTWARE.
         
Classifier: Development Status :: 3 - Alpha
Classifier: Intended Audience :: Science/Research
Classifier: License :: OSI Approved :: MIT License
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: C++
Classifier: Topic :: Scientific/Engineering
Classifier: Topic :: Database
Project-URL: Homepage, https://github.com/Y-Staring/NeSyDep
Project-URL: Documentation, https://y-staring.github.io/NeSyDep/
Project-URL: Repository, https://github.com/Y-Staring/NeSyDep
Requires-Python: >=3.10
Requires-Dist: pandas>=1.5
Requires-Dist: numpy>=1.24
Requires-Dist: pydantic>=2.5
Requires-Dist: typer>=0.9
Requires-Dist: rich>=13
Provides-Extra: bn
Requires-Dist: pgmpy>=1.1.04; extra == "bn"
Requires-Dist: networkx>=3.0; extra == "bn"
Requires-Dist: joblib>=1.3; extra == "bn"
Provides-Extra: transformer
Requires-Dist: torch>=2.0; extra == "transformer"
Requires-Dist: sentence-transformers>=2.2; extra == "transformer"
Provides-Extra: lsh
Requires-Dist: datasketch>=1.6; extra == "lsh"
Provides-Extra: all
Requires-Dist: pgmpy>=1.1.04; extra == "all"
Requires-Dist: networkx>=3.0; extra == "all"
Requires-Dist: joblib>=1.3; extra == "all"
Requires-Dist: torch>=2.0; extra == "all"
Requires-Dist: sentence-transformers>=2.2; extra == "all"
Requires-Dist: datasketch>=1.6; extra == "all"
Provides-Extra: dev
Requires-Dist: pytest>=7.4; extra == "dev"
Requires-Dist: pytest-cov; extra == "dev"
Requires-Dist: ruff>=0.4; extra == "dev"
Requires-Dist: mypy>=1.8; extra == "dev"
Requires-Dist: pre-commit; extra == "dev"
Requires-Dist: mkdocs-material; extra == "dev"
Requires-Dist: mkdocstrings[python]; extra == "dev"
Description-Content-Type: text/markdown

# NeSyDep

**Ne**ural-**Sy**mbolic **Dep**endency discovery: fast mining of data dependencies
(functional dependencies, conditional functional dependencies, and more to come).

NeSyDep turns the research prototypes behind our papers into a usable, extensible
open-source tool for data scientists and data engineers:

- **BSFD** — fast FD discovery guided by Bayesian-network structure learning (ICDE 2026)
- **SCFDM** — fast CFD discovery via Transformer-guided relation partitioning (VLDB 2027)
- **FastAFD** — approximate FD mining (FDm) boosted by clustering and covariance
  analysis (ICDE 2024); fastest on wide tables, with statistical recall guarantees

Mining kernels are C++ (exposed through pybind11); orchestration, sampling,
correlation extraction and evaluation are pure Python.

> Status: early development. See the roadmap below.

## Install

```bash
pip install nesydep            # core (FD/CFD mining + lightweight correlation)
pip install "nesydep[bn]"      # + Bayesian-network correlation (BSFD default)
pip install "nesydep[transformer]"  # + Transformer AttrFinder (large, pulls torch)
pip install "nesydep[all]"     # everything
```

## Quick start

```python
import pandas as pd
import nesydep as nd

# A small hospital table ships with the repo — load it straight from GitHub.
url = "https://raw.githubusercontent.com/ruochunjin/NeSyDep/main/examples/data/hospital_sample.csv"
df = pd.read_csv(url)

# One-liner FD discovery
fds = nd.discover(df, algo="bsfd", support=2, confidence=0.95)
for fd in fds.fds:
    print(fd)   # e.g. [Zip] -> City, [Zip] -> State, [Address] -> PhoneNumber

# CFD discovery with full control
miner = nd.SCFDM(correlation="pearson", strategy="FD-First-DFS-dfs",
                 support=2, confidence=0.9, max_lhs=2)
result = miner.discover(df)
result.to_csv("cfds.csv")
```

CLI:

```bash
curl -O https://raw.githubusercontent.com/ruochunjin/NeSyDep/main/examples/data/hospital_sample.csv
nesydep discover hospital_sample.csv --algo bsfd --support 2 -o fds.txt
nesydep algorithms            # list registered algorithms and parameters
```

## Roadmap

- **v0.1 (MVP)**: BSFD, SCFDM (lightweight correlation), TANE/DFD/CTane baselines,
  evaluation, CLI.
- **v0.2**: Transformer AttrFinder, all 10 SCFDM strategies, prebuilt wheels.
- **v1.0**: PyPI release, full docs, plugin tutorial.
- Later: more fast mining algorithms over relational data and more dependency
  types (OD, DC, UC, ...) as plugins.

Out of scope for v1: direct database connections, distributed (MPI) wheels.

## Citing

If you use NeSyDep in academic work, please cite:

**CFD discovery (SCFDM):**

```bibtex
@article{jin2027fast,
  title={Fast Discovery of Conditional Functional Dependencies via Transformer-Guided Relation Partitioning},
  author={Jin, Ruochun and Chen, Shenglin and Wang, Xi and Yang, Siyi and Wang, Ting},
  journal={Proceedings of the VLDB Endowment},
  year={2027}
}
```

**FD discovery (BSFD):**

```bibtex
@inproceedings{yang2026fast,
  title={Fast Discovery of Functional Dependencies via Bayesian Network Learning},
  author={Yang, Siyi and Chen, Shenglin and Wang, Xi and Tang, Yuhua and Jin, Ruochun},
  booktitle={2026 IEEE 42nd International Conference on Data Engineering (ICDE)},
  pages={44--57},
  year={2026},
  organization={IEEE}
}
```

**Also from our group** (its algorithms will be integrated into NeSyDep in a future release):

```bibtex
@inproceedings{wang2024boosting,
  title={Boosting meaningful dependency mining with clustering and covariance analysis},
  author={Wang, Xi and Jin, Ruochun and Huang, Wanrong and Tang, Yuhua},
  booktitle={2024 IEEE 40th International Conference on Data Engineering (ICDE)},
  pages={639--652},
  year={2024},
  organization={IEEE}
}
```

## License

MIT — see [LICENSE](LICENSE).
