Metadata-Version: 2.4
Name: mondher
Version: 0.1.0
Classifier: Development Status :: 3 - Alpha
Classifier: Intended Audience :: Science/Research
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.9
Classifier: Programming Language :: Python :: 3.10
Classifier: Programming Language :: Python :: 3.11
Classifier: Programming Language :: Python :: 3.12
Classifier: Programming Language :: Python :: 3.13
Classifier: Programming Language :: Rust
Classifier: Topic :: Scientific/Engineering :: Information Analysis
Classifier: Operating System :: POSIX :: Linux
Classifier: Operating System :: MacOS
Classifier: Operating System :: Microsoft :: Windows
Summary: Formal Concept Analysis engine with Python bindings
Keywords: formal-concept-analysis,fca,lattice,data-mining
Author-email: Anthony Feudjio <feudjio.anthony.tech@gmail.com>
License: Proprietary
Requires-Python: >=3.9
Description-Content-Type: text/markdown; charset=UTF-8; variant=GFM
Project-URL: Documentation, https://feudjio-anthony.github.io/mondher/
Project-URL: Homepage, https://github.com/Feudjio-Anthony/mondher
Project-URL: Issues, https://github.com/Feudjio-Anthony/mondher/issues
Project-URL: Repository, https://github.com/Feudjio-Anthony/mondher

# mondher

Python bindings to the [Mondher](https://github.com/Feudjio-Anthony/mondher)
formal-concept-analysis engine.

## Install

```bash
pip install mondher
```

## Quickstart

```python
import mondher

# Read a context file (Burmeister .cxt, CSV, DAT, XML, or JSON).
with open("breakfast.cxt", "rb") as f:
    ctx = mondher.parse_context(f.read(), filename="breakfast.cxt")

# Compute the concept lattice. Default algorithm is "next-closure".
concepts = mondher.compute_concepts(ctx)
print(f"{len(concepts)} concepts")
for c in concepts[:5]:
    print(f"  extent={c['extent']}  intent={c['intent']}")

# Use a different algorithm.
print(mondher.supported_algorithms())  # ['next-closure', 'in-close-5', 'fcbo']
concepts_fast = mondher.compute_concepts(ctx, algorithm="fcbo")

# Compute the Duquenne-Guigues canonical implication base.
implications = mondher.compute_implications(ctx)
for imp in implications[:3]:
    premise = ", ".join(imp["premise"])
    conclusion = ", ".join(imp["conclusion"])
    print(f"  {{{premise}}} -> {{{conclusion}}}")
```

## Supported formats

The `parse_context` function dispatches on the filename extension:

| Extension | Format |
|---|---|
| `.cxt` | Burmeister |
| `.csv` | Comma-separated values |
| `.dat` | NCI / dense binary |
| `.xml` | ConExp XML |
| `.json` | Mondher JSON |

If the filename has no recognized extension, parsing raises `ValueError`.

## License

Proprietary. See the main repository for details.
