Skip to main content

Formal Concept Analysis engine with Python bindings

Project description

mondher

Python bindings to the Mondher formal-concept-analysis engine.

Install

pip install mondher

Quickstart

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 and get a list of dicts.
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. See `supported_algorithms()` for choices.
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}}}")

Jupyter notebooks

In a notebook cell, just put a Lattice as the last expression and Jupyter renders it inline as SVG:

import mondher

ctx = mondher.parse_context(open("breakfast.cxt", "rb").read(), filename="breakfast.cxt")
lattice = mondher.compute_lattice(ctx)
lattice  # Renders the Hasse diagram inline

The Lattice class also has:

  • .concepts() — returns the same list-of-dicts as compute_concepts
  • .svg() — returns the SVG string (e.g., for saving to a file)
  • .n_concepts — the number of concepts

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

License

Proprietary. See the main repository for details.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

mondher-0.2.0.tar.gz (97.5 kB view details)

Uploaded Source

Built Distributions

If you're not sure about the file name format, learn more about wheel file names.

mondher-0.2.0-cp39-abi3-win_amd64.whl (309.1 kB view details)

Uploaded CPython 3.9+Windows x86-64

mondher-0.2.0-cp39-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (396.9 kB view details)

Uploaded CPython 3.9+manylinux: glibc 2.17+ x86-64

mondher-0.2.0-cp39-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl (375.5 kB view details)

Uploaded CPython 3.9+manylinux: glibc 2.17+ ARM64

mondher-0.2.0-cp39-abi3-macosx_11_0_arm64.whl (357.5 kB view details)

Uploaded CPython 3.9+macOS 11.0+ ARM64

mondher-0.2.0-cp39-abi3-macosx_10_12_x86_64.whl (374.0 kB view details)

Uploaded CPython 3.9+macOS 10.12+ x86-64

File details

Details for the file mondher-0.2.0.tar.gz.

File metadata

  • Download URL: mondher-0.2.0.tar.gz
  • Upload date:
  • Size: 97.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for mondher-0.2.0.tar.gz
Algorithm Hash digest
SHA256 1e201b9364d11074032bcf440a4946ba21d7b4ffbe3c761d98c06a0df804c2b2
MD5 800b6709154b7bd2fb1b15dfcc65d7a0
BLAKE2b-256 4f440100d812909edccb1683b3a4798ceb701d69cb0e793238d5a74dbb0fc4de

See more details on using hashes here.

Provenance

The following attestation bundles were made for mondher-0.2.0.tar.gz:

Publisher: wheels.yml on Feudjio-Anthony/mondher

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file mondher-0.2.0-cp39-abi3-win_amd64.whl.

File metadata

  • Download URL: mondher-0.2.0-cp39-abi3-win_amd64.whl
  • Upload date:
  • Size: 309.1 kB
  • Tags: CPython 3.9+, Windows x86-64
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for mondher-0.2.0-cp39-abi3-win_amd64.whl
Algorithm Hash digest
SHA256 186ae3389aecafc34a4ffb4c1cfcada20d9e9e5c4aeee6d54962f12d8f4ff8c8
MD5 f4ef824e33b8085a9a49872dbe7b5784
BLAKE2b-256 a8d6f57a399088635b4d13bbc85248bc9fdc588b0d996e23442bf918de614735

See more details on using hashes here.

Provenance

The following attestation bundles were made for mondher-0.2.0-cp39-abi3-win_amd64.whl:

Publisher: wheels.yml on Feudjio-Anthony/mondher

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file mondher-0.2.0-cp39-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.

File metadata

File hashes

Hashes for mondher-0.2.0-cp39-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 8d34d1d40d92e863deeeaae8a9e31386b33937c1fd273510ba4dd221a0e8483e
MD5 685636b41fb88aad3389446ce8f2455d
BLAKE2b-256 eb2a8ea7906dc4f60450beac27d6cad878254ca4a0f5527514e5039d4804ac8f

See more details on using hashes here.

Provenance

The following attestation bundles were made for mondher-0.2.0-cp39-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl:

Publisher: wheels.yml on Feudjio-Anthony/mondher

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file mondher-0.2.0-cp39-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl.

File metadata

File hashes

Hashes for mondher-0.2.0-cp39-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl
Algorithm Hash digest
SHA256 5eccf700c4b3e6ea9e04893b65dfdfc20c9f45fc36badbda3d657b50b71b66f0
MD5 93484e36904fd375fb43572df270b956
BLAKE2b-256 c6b585f1ce76e8f8a0a230767fa1880002037f1c17bb09d031a2aaaa60b5dc9a

See more details on using hashes here.

Provenance

The following attestation bundles were made for mondher-0.2.0-cp39-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl:

Publisher: wheels.yml on Feudjio-Anthony/mondher

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file mondher-0.2.0-cp39-abi3-macosx_11_0_arm64.whl.

File metadata

File hashes

Hashes for mondher-0.2.0-cp39-abi3-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 24334872b24213537e08542cfa1527d36ddb7d2821087431f541e8a0ef687133
MD5 4f857f0cd8456b25e761e2f44b557aa8
BLAKE2b-256 5654e75217ad63fe10687e333927c1367780b7083f2ba9c6ea25acca32de3b68

See more details on using hashes here.

Provenance

The following attestation bundles were made for mondher-0.2.0-cp39-abi3-macosx_11_0_arm64.whl:

Publisher: wheels.yml on Feudjio-Anthony/mondher

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file mondher-0.2.0-cp39-abi3-macosx_10_12_x86_64.whl.

File metadata

File hashes

Hashes for mondher-0.2.0-cp39-abi3-macosx_10_12_x86_64.whl
Algorithm Hash digest
SHA256 aa111789c15fe5234ab3b655ae2c267547b2cb432edc2e8c96763ad4d27925fe
MD5 ad013f611a24f026efde8c2259ffc421
BLAKE2b-256 c4fcb2714011c804b90c957dc9c1aa96b734afddee9d7d48be7cd89cdcc6dec6

See more details on using hashes here.

Provenance

The following attestation bundles were made for mondher-0.2.0-cp39-abi3-macosx_10_12_x86_64.whl:

Publisher: wheels.yml on Feudjio-Anthony/mondher

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page