Skip to main content

bubble-tools

python routines related to bubble format, usable in CLI or as a library.

Installation

pip install bubbletools

See below for usage.

Features

  • bubble to python
  • bubble to gexf
  • bubble to cytoscape.js
    • working implementation
    • test on fully valid bubble
    • unit testing
    • test on big graphs, for benchmarking (will probably not scale)
  • bubble to dot (via graphviz)
    • working implementation
    • test on fully valid bubble
    • unit testing
    • test on big graphs, for benchmarking (will probably not scale)
  • python to bubble
  • dot to python
  • unit testing on bubble describing cliques

CLI

bubbletools is usable through CLI.

validation

usage:

python3 -m bubbletools validate path/to/bubble/file

Try hard to find errors and inconsistancies in the given bubble file

Spot powernode overlapping, inclusions inconsistancies and empty or singleton powernodes. Profiling gives general informations about the file data.

conversion to dot

usage:

python3 bubbletool.py dot path/to/bubble/file path/to/output/file

Convert given bubble file in dot format. The optional --render flag can be used to show the graph after saving.

Same API is available for gexf format.

conversion to cytoscape.js

usage:

python3 -m bubbletools js path/to/bubble/file path/to/output/dir

Convert given bubble file in a fully working website using cytoscape.js to render the graph. The optional --render flag can be used to run the default web browser on the generated website. See Makefile recipe js for a usage example.

A website is a collection of files (css, js, html), with only one of them (js/graph.js) that changes according to the input data.

If the path/to/output/dir has a .js extension, only the js/graph.js file will be generated. This allow one to generates only the changing parts, not the full website each time. See Makefile recipe js-per-file for a usage example.

python API

Submodules validator and converter provides the functionnalities described above for CLI:

from bubbletools import validate, convert

for log in validate(open('path/to/bubble.lp'), profiling=True):
    print(log)
convert.to_dot(open('path/to/bubble.lp'), dotfile='path/to/dot.dot')

python representation of the graph

A lower level interface is the BubbleTree object, allowing one to manipulate the graph depicted by bubble data as python object. See unit tests for example of BubbleTree usage.

from bubbletools import BubbleTree

tree = BubbleTree.from_bubble_file('path/to/bubble.lp')
print(tree.edges, tree.inclusions, tree.roots)

edges is a mapping predecessor -> set of successors, inclusions is a mapping (power)node -> set of (power)nodes directly contained, and roots is a set of (power)nodes that are contained by nothing.

This representation holds all the data necessary for most work on the bubble. The BubbleTree.connected_components function maps a graph with its connected components:

cc, subroots = BubbleTree.connected_components()

Where cc and subroots are both mappings, respectively linking the root of a connected component with all nodes of the connected component, and the root of a connected component with the other roots of the same connected component. Thus, connected components are identified by one of their roots, which is key is both dictionaries.

access powernodes and their data

Follow an example of BubbleTree usage, retrieving data on powernodes:

tree = BubbleTree.from_bubble_file('bubbles/basic.bbl')
for pnode in tree.powernodes:
    data = tree.powernode_data(pnode)
    print(
        "{} contains nodes {{{}}}, and powernodes {{{}}}."
        "".format(pnode, data.contained_nodes, data.contained_pnodes)
    )

Metadata

Release files for bubbletools 0.6.13

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for bubbletools 0.6.13
File Size Uploaded
bubbletools-0.6.13.tar.gz 161.7 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for bubbletools 0.6.13
File Interpreter ABI Platform
bubbletools-0.6.13-py3-none-any.whl Python 3 none any Details

Total release size: 327.0 kB

Release files / bubbletools-0.6.13.tar.gz

Download URL bubbletools-0.6.13.tar.gz
Size 161.7 kB
Tags Source
SHA-256 checksum
How to use checksums
5ec85a07f261bfa8c44954d869c2c446d87b9728f6a4da7771e85607033f2eaa
BLAKE2b-256 checksum
How to use checksums
ae08c6ee97e3d8fcfa1045838d61018c1431dc79999eb61f7187586c5a95c7cb
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/6.1.0 CPython/3.13.14

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Jul 28, 2026.

Transparency log

Release files / bubbletools-0.6.13-py3-none-any.whl

Download URL bubbletools-0.6.13-py3-none-any.whl
Size 165.3 kB
Tags Python 3
SHA-256 checksum
How to use checksums
197f99ae1a08814be8dbf5a266c1ff04ed5677357033c3c5135c023cbb166061
BLAKE2b-256 checksum
How to use checksums
87ab7b9da0bedb1d64c32d465e1189a8e44b61d5309ad73971fc9992acb701c1
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/6.1.0 CPython/3.13.14

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Jul 28, 2026.

Transparency log

Release history Release notifications | RSS feed

This release

0.6.13 This release

2 release files

0.6.11

1 release file

0.6.10

1 release file

0.6.9

1 release file

0.6.8

1 release file

0.6.7

1 release file

0.6.6

1 release file

0.6.5

1 release file

0.6.4

1 release file

0.6.3

1 release file

0.6.2

1 release file

0.6.1

1 release file

0.5.3

1 release file

0.5.2

1 release file

0.5.1

1 release file

0.5.0

1 release file

0.4.1

1 release file

0.4.0

1 release file

0.3.1

1 release file

0.3.0

1 release file

0.2.1

1 release file

0.2.0

1 release file

0.1.4

1 release file

0.1.3

1 release file

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page