Skip to main content

Modular subgraph mining library with unified API

Project description

submine

submine is a modular Python library for frequent subgraph mining that provides a unified, safe, and extensible interface over heterogeneous mining algorithms implemented in Python, C/C++, and Java.

The library is designed to support research-grade reproducibility and production-safe execution, while remaining lightweight and backend-agnostic.

Core Design Principles

  • Algorithm-agnostic API Users select an algorithm; submine handles format adaptation and execution.

  • No redundant graph rewrites Input graphs are converted directly into the format required by the selected algorithm.

  • Strict input validation & safety Resource limits, parameter validation, and hardened subprocess execution are enforced by default.

  • Clean extensibility model New algorithms can be plugged in without modifying core logic.

Package Layout

submine/
├── api.py                  # Public API entrypoint
├── errors.py               # Structured exception hierarchy
├── core/
│   ├── graph.py            # Canonical graph representation
│   └── result.py           # Mining result containers
├── algorithms/
│   ├── base.py             # Base miner abstraction
│   ├── gspan.py            # gSpan wrapper / implementation
│   ├── sopagrami.py        # SoPaGraMi backend wrapper
│   └── ...
├── io/
│   ├── common.py           # Shared readers / writers
│   ├── transcode.py        # Format detection & conversion
│   ├── gspan.py            # gSpan I/O
│   ├── sopagrami.py        # .lg I/O
│   └── ...
├── utils/
│   └── checks.py           # Input validation & resource limits
└── tests/
    ├── unit/
    └── functional/

Supported Algorithms

Algorithm Graph Type Backend Notes
gSpan Multiple graphs Python / C++ Frequent subgraph mining
SoPaGraMi Single large graph C++ Social pattern mining

Each algorithm declares:

  • required input format,
  • parameter schema,
  • execution strategy (in-process vs subprocess).

Supported Input Formats

submine accepts graphs in multiple formats and converts them directly into the format required by the selected algorithm:

  • Edge list (.txt, .edgelist)

  • gSpan datasets (.data, .data.x, .data.N)

  • SoPaGraMi .lg

  • GEXF (.gexf)

  • Format detection is automatic and deterministic.

Installation

Runtime installation

pip install submine

Dev installation

pip install -e ".[dev]"

Basic Usage

from submine.api import mine_subgraphs

results = mine_subgraphs(
    data="graph.data",
    algorithm="gspan",
    min_support=5
)

For SoPaGraMi:

results = mine_subgraphs("citeseer.lg", algorithm="sopagrami", 
                    min_support=100,
                    sorted_seeds=4,
                    dump_images_csv=True, #if you want to dump the images
                    dump_sample_embeddings=True, #if you want to dump the embeddings, not implemented yet
                    out_dir= "." # /path/to/dir to save the images and embeddings default is ./sopagrami_result
                    )

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

submine-0.1.0.tar.gz (5.7 MB view details)

Uploaded Source

Built Distributions

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

submine-0.1.0-cp311-cp311-win_amd64.whl (298.8 kB view details)

Uploaded CPython 3.11Windows x86-64

submine-0.1.0-cp311-cp311-win32.whl (272.4 kB view details)

Uploaded CPython 3.11Windows x86

submine-0.1.0-cp311-cp311-musllinux_1_2_x86_64.whl (1.3 MB view details)

Uploaded CPython 3.11musllinux: musl 1.2+ x86-64

submine-0.1.0-cp311-cp311-musllinux_1_2_i686.whl (1.5 MB view details)

Uploaded CPython 3.11musllinux: musl 1.2+ i686

submine-0.1.0-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (462.1 kB view details)

Uploaded CPython 3.11manylinux: glibc 2.17+ x86-64

submine-0.1.0-cp311-cp311-manylinux_2_17_i686.manylinux2014_i686.whl (494.4 kB view details)

Uploaded CPython 3.11manylinux: glibc 2.17+ i686

submine-0.1.0-cp311-cp311-macosx_11_0_arm64.whl (261.1 kB view details)

Uploaded CPython 3.11macOS 11.0+ ARM64

submine-0.1.0-cp310-cp310-win_amd64.whl (298.0 kB view details)

Uploaded CPython 3.10Windows x86-64

submine-0.1.0-cp310-cp310-win32.whl (269.8 kB view details)

Uploaded CPython 3.10Windows x86

submine-0.1.0-cp310-cp310-musllinux_1_2_x86_64.whl (1.3 MB view details)

Uploaded CPython 3.10musllinux: musl 1.2+ x86-64

submine-0.1.0-cp310-cp310-musllinux_1_2_i686.whl (1.5 MB view details)

Uploaded CPython 3.10musllinux: musl 1.2+ i686

submine-0.1.0-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (459.0 kB view details)

Uploaded CPython 3.10manylinux: glibc 2.17+ x86-64

submine-0.1.0-cp310-cp310-manylinux_2_17_i686.manylinux2014_i686.whl (491.8 kB view details)

Uploaded CPython 3.10manylinux: glibc 2.17+ i686

submine-0.1.0-cp310-cp310-macosx_11_0_arm64.whl (258.6 kB view details)

Uploaded CPython 3.10macOS 11.0+ ARM64

File details

Details for the file submine-0.1.0.tar.gz.

File metadata

  • Download URL: submine-0.1.0.tar.gz
  • Upload date:
  • Size: 5.7 MB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.11.14

File hashes

Hashes for submine-0.1.0.tar.gz
Algorithm Hash digest
SHA256 682ccfddee1a41b6aa766775e2876c509bc09fe01901401715195cd49b65a38f
MD5 ca47489438f1550927b4ae89954c9b1d
BLAKE2b-256 0599f8f2c62a6c046eb361f06907090b54863ca6b27736c58b4ea00cfbab6993

See more details on using hashes here.

File details

Details for the file submine-0.1.0-cp311-cp311-win_amd64.whl.

File metadata

  • Download URL: submine-0.1.0-cp311-cp311-win_amd64.whl
  • Upload date:
  • Size: 298.8 kB
  • Tags: CPython 3.11, Windows x86-64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.11.14

File hashes

Hashes for submine-0.1.0-cp311-cp311-win_amd64.whl
Algorithm Hash digest
SHA256 585113f492757c357ef224adebf33d1286f65432e1ec8327710f9d80b7daf32d
MD5 1ceda566236f640210893ece0bd8216a
BLAKE2b-256 299e0ff534249ab2235fa0757aa881f1c52cb3d79fb7b8c027a4d546ff62b2af

See more details on using hashes here.

File details

Details for the file submine-0.1.0-cp311-cp311-win32.whl.

File metadata

  • Download URL: submine-0.1.0-cp311-cp311-win32.whl
  • Upload date:
  • Size: 272.4 kB
  • Tags: CPython 3.11, Windows x86
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for submine-0.1.0-cp311-cp311-win32.whl
Algorithm Hash digest
SHA256 e073a1cdf2d5024728a8355a3d33767974a37821f4161cb95f724a87fdc50163
MD5 c004d3721722adae84f11983d4322a10
BLAKE2b-256 a4a9584d4ab4e83c42b94f72e9e7da7e9cae1e1f4aaa36aa20c34c5f766b5d18

See more details on using hashes here.

Provenance

The following attestation bundles were made for submine-0.1.0-cp311-cp311-win32.whl:

Publisher: release.yml on instabaines/submine

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

File details

Details for the file submine-0.1.0-cp311-cp311-musllinux_1_2_x86_64.whl.

File metadata

File hashes

Hashes for submine-0.1.0-cp311-cp311-musllinux_1_2_x86_64.whl
Algorithm Hash digest
SHA256 7ed646f3a46e922b4471905be9f4ab2186820366b03d86ddbe909ac6269c202b
MD5 b00bfcfc1d3aa76c9ed0562be4ac1b75
BLAKE2b-256 f863a0789212415ddc3b56af087bb0029cf111daccc0f6666a0c0af899083d3e

See more details on using hashes here.

Provenance

The following attestation bundles were made for submine-0.1.0-cp311-cp311-musllinux_1_2_x86_64.whl:

Publisher: release.yml on instabaines/submine

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

File details

Details for the file submine-0.1.0-cp311-cp311-musllinux_1_2_i686.whl.

File metadata

File hashes

Hashes for submine-0.1.0-cp311-cp311-musllinux_1_2_i686.whl
Algorithm Hash digest
SHA256 e73c2adc627b7799c28d580c1bf52f6a96760df06a700a1712d6043f45b32ea6
MD5 34abf6a3f3cabc2eb71c4d3c8e06cec6
BLAKE2b-256 773e453232c653197b0e3e7b1dd7d18dac44801415e8d3c4efe07e5ce836d819

See more details on using hashes here.

Provenance

The following attestation bundles were made for submine-0.1.0-cp311-cp311-musllinux_1_2_i686.whl:

Publisher: release.yml on instabaines/submine

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

File details

Details for the file submine-0.1.0-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.

File metadata

File hashes

Hashes for submine-0.1.0-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 dc93eb940189b3fbec76a3a994e4e1e5a9912434490abe28e1c20b0cce46e9ac
MD5 f1f4c3ab8d69ec66af27bdb3ebf89162
BLAKE2b-256 7fe3a7fcf414f4d9aeb2f9a5f8c948dfe064d502497d8ac5ef6f3a03b05534e4

See more details on using hashes here.

Provenance

The following attestation bundles were made for submine-0.1.0-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl:

Publisher: release.yml on instabaines/submine

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

File details

Details for the file submine-0.1.0-cp311-cp311-manylinux_2_17_i686.manylinux2014_i686.whl.

File metadata

File hashes

Hashes for submine-0.1.0-cp311-cp311-manylinux_2_17_i686.manylinux2014_i686.whl
Algorithm Hash digest
SHA256 3fa1dcde4c937d842ed2a77b01ba608176ac93464ca8f7c933fd028b6ebb45e7
MD5 17925a158021762b4017071af98afd00
BLAKE2b-256 69d58fbd289d75a968445ba2c6a5bac581d8c7dc358775519a45cab6905b1562

See more details on using hashes here.

Provenance

The following attestation bundles were made for submine-0.1.0-cp311-cp311-manylinux_2_17_i686.manylinux2014_i686.whl:

Publisher: release.yml on instabaines/submine

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

File details

Details for the file submine-0.1.0-cp311-cp311-macosx_11_0_arm64.whl.

File metadata

File hashes

Hashes for submine-0.1.0-cp311-cp311-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 298408b0913957c67803a4727ae70553e6f0c2863f428265475b2aaef3afb850
MD5 725545e6b051d86695df792a9d5e6d2e
BLAKE2b-256 7751ddd23a0510242111309a04e0c1ec3abec3132c33f27c82977944a93d35d4

See more details on using hashes here.

Provenance

The following attestation bundles were made for submine-0.1.0-cp311-cp311-macosx_11_0_arm64.whl:

Publisher: release.yml on instabaines/submine

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

File details

Details for the file submine-0.1.0-cp310-cp310-win_amd64.whl.

File metadata

  • Download URL: submine-0.1.0-cp310-cp310-win_amd64.whl
  • Upload date:
  • Size: 298.0 kB
  • Tags: CPython 3.10, Windows x86-64
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for submine-0.1.0-cp310-cp310-win_amd64.whl
Algorithm Hash digest
SHA256 95d6fce78ac3bfbaa16daec2ed572d235b704122d3f9192089590e865217a55d
MD5 e56f0aafb9b9454e9249aa4eec14fd32
BLAKE2b-256 929bb37b138e230cb9ca71dfd43a782a1dd2cb2d7a31606fa79cc141c4a0b477

See more details on using hashes here.

Provenance

The following attestation bundles were made for submine-0.1.0-cp310-cp310-win_amd64.whl:

Publisher: release.yml on instabaines/submine

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

File details

Details for the file submine-0.1.0-cp310-cp310-win32.whl.

File metadata

  • Download URL: submine-0.1.0-cp310-cp310-win32.whl
  • Upload date:
  • Size: 269.8 kB
  • Tags: CPython 3.10, Windows x86
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for submine-0.1.0-cp310-cp310-win32.whl
Algorithm Hash digest
SHA256 9a5f90308774a4ae3d6281f67ccb68d33dc9b3a8eb11bb228abbc394198a3fc4
MD5 d41dd8765a6cc1fa739c7796ae8d7c04
BLAKE2b-256 fae45300b4e4ea77977b2a568275e25d100b4453ff90f6ca14f174e05b539312

See more details on using hashes here.

Provenance

The following attestation bundles were made for submine-0.1.0-cp310-cp310-win32.whl:

Publisher: release.yml on instabaines/submine

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

File details

Details for the file submine-0.1.0-cp310-cp310-musllinux_1_2_x86_64.whl.

File metadata

File hashes

Hashes for submine-0.1.0-cp310-cp310-musllinux_1_2_x86_64.whl
Algorithm Hash digest
SHA256 e4a14b21c93b82f835803ef96e4f4eb2bf688f03f9a8ed4f5dca3ab11c63155e
MD5 1667c415316a5ef048e450fff0ba1289
BLAKE2b-256 4c1bb75ec7ba70ae07d8e0470c4319b29c7720fd7c3464cf6b16c11859affee0

See more details on using hashes here.

Provenance

The following attestation bundles were made for submine-0.1.0-cp310-cp310-musllinux_1_2_x86_64.whl:

Publisher: release.yml on instabaines/submine

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

File details

Details for the file submine-0.1.0-cp310-cp310-musllinux_1_2_i686.whl.

File metadata

File hashes

Hashes for submine-0.1.0-cp310-cp310-musllinux_1_2_i686.whl
Algorithm Hash digest
SHA256 accba505cd21a5a447e12146192f34ff979a2144021f98f8d09138cd775791dc
MD5 924091a56e681aa3ca27a662ea16e773
BLAKE2b-256 6d22f75bf98398381ccd9ce505645f997fab64c9c288b2014e86e698bb3cf862

See more details on using hashes here.

Provenance

The following attestation bundles were made for submine-0.1.0-cp310-cp310-musllinux_1_2_i686.whl:

Publisher: release.yml on instabaines/submine

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

File details

Details for the file submine-0.1.0-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.

File metadata

File hashes

Hashes for submine-0.1.0-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 059f2dd8684d987e7464e132badb5daf70fcb829a063fff5f6c72a1b1fe906c3
MD5 7da3d93cd349fc2378fa88c21e072513
BLAKE2b-256 b92ba7dad8034b363c6499cde9e0f835acd8f7e1667a008daa9247d49a0e28f7

See more details on using hashes here.

Provenance

The following attestation bundles were made for submine-0.1.0-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl:

Publisher: release.yml on instabaines/submine

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

File details

Details for the file submine-0.1.0-cp310-cp310-manylinux_2_17_i686.manylinux2014_i686.whl.

File metadata

File hashes

Hashes for submine-0.1.0-cp310-cp310-manylinux_2_17_i686.manylinux2014_i686.whl
Algorithm Hash digest
SHA256 09a7b8a7a08d342ef6a4e77617d9abb8de332f5650beacb7f27350596ec8c1c0
MD5 e0804d877587059f21ca03df1b55fab6
BLAKE2b-256 58a6742d485b664a9c5ea44bfb620ad851b7d283f1609659ecd70f58f195c281

See more details on using hashes here.

Provenance

The following attestation bundles were made for submine-0.1.0-cp310-cp310-manylinux_2_17_i686.manylinux2014_i686.whl:

Publisher: release.yml on instabaines/submine

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

File details

Details for the file submine-0.1.0-cp310-cp310-macosx_11_0_arm64.whl.

File metadata

File hashes

Hashes for submine-0.1.0-cp310-cp310-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 1578a5c2452bbfdbd49f92a6a155913ccde608fdbc16bd758e238b62a76a10b0
MD5 d84f2343fc6ed444f343c4fc1fddf2ea
BLAKE2b-256 b15300c1d67216e9d378ef95be158beb3419fe76f216fa981a3de7e13eeb9f44

See more details on using hashes here.

Provenance

The following attestation bundles were made for submine-0.1.0-cp310-cp310-macosx_11_0_arm64.whl:

Publisher: release.yml on instabaines/submine

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