Skip to main content

Core utilities and classes for the CausalIQ ecosystem

Project description

causaliq-core

Python Versions License: MIT Coverage

This is the core package providing common functionality required by several CausalIQ packages. It is part of the CausalIQ ecosystem for intelligent causal discovery and inference.

Installation

Install from PyPI:

pip install causaliq-core

Status

🚧 Active Development - This repository is currently in active development, which involves:

  • migrating functionality from the legacy monolithic discovery repo
  • restructuring classes to reduce module size and improve maintainability and improve usability
  • ensure CausalIQ development standards are met
  • adding new core functionality required by several CausalIQ packages

Features

Currently implemented:

  • Release v0.1.0 - Foundation and utilities: CausalIQ compliant development environment and utility functions (timing, random numbers, environment detection, etc.)
  • Release v0.2.0 - Graph classes: Graph types for causal discovery including Summary Dependence Graphs (SDG), Partially Directed Acyclic Graphs (PDAG), Directed Acyclic Graphs (DAG), with conversion utilities and I/O support for Tetrad/Bayesys formats
  • Release v0.3.0 - Bayesian Networks: support for Bayesian Networks and their parameterised distributions and I/O support for DSC and XDSL formats
  • Release v0.4.0 - Caching Infrastructure [February 2026]: Token-based caching and (de)compression of JSON and GraphML.

Upcoming releases:

  • none planned

Quick Start

from causaliq_core.graph import PDAG, read, write

# Create a partially directed graph
pdag = PDAG(['X', 'Y', 'Z'], [('X', '->', 'Y'), ('Y', '--', 'Z')])

# Save and load graphs
write(pdag, "my_graph.csv")  # Bayesys format
loaded_graph = read("my_graph.csv")

# Convert between graph types
from causaliq_core.graph import extend_pdag
dag = extend_pdag(pdag)  # Extend PDAG to DAG

Getting started

Prerequisites

  • Git
  • Latest stable versions of Python 3.9, 3.10. 3.11, 3.12 and 3.13

Clone the new repo locally and check that it works

Clone the causaliq-core repo locally as normal

git clone https://github.com/causaliq/causaliq-core.git

Set up the Python virtual environments and activate the default Python virtual environment. You may see messages from VSCode (if you are using it as your IDE) that new Python environments are being created as the scripts/setup-env runs - these messages can be safely ignored at this stage.

scripts/setup-env -Install
scripts/activate

Check that the causaliq-core CLI is working, check that all CI tests pass, and start up the local mkdocs webserver. There should be no errors reported in any of these.

causaliq-core --help
scripts/check_ci
mkdocs serve

Enter http://127.0.0.1:8000/ in a browser and check that the causaliq-core documentation is visible.

If all of the above works, this confirms that the code is working successfully on your system.

Start work on new features

The real work of implementing the functionality of this new CausalIQ package can now begin!

Documentation

Full API documentation is available at: http://127.0.0.1:8000/ (when running mkdocs serve)

Contributing

This repository is part of the CausalIQ ecosystem. For development setup:

  1. Clone the repository
  2. Run scripts/setup-env -Install to set up environments
  3. Run scripts/check_ci to verify all tests pass
  4. Start documentation server with mkdocs serve

Supported Python Versions: 3.9, 3.10, 3.11, 3.12 , 3.13

Default Python Version: 3.11

License: MIT

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

causaliq_core-0.4.0.tar.gz (80.9 kB view details)

Uploaded Source

Built Distribution

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

causaliq_core-0.4.0-py3-none-any.whl (92.4 kB view details)

Uploaded Python 3

File details

Details for the file causaliq_core-0.4.0.tar.gz.

File metadata

  • Download URL: causaliq_core-0.4.0.tar.gz
  • Upload date:
  • Size: 80.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.11.9

File hashes

Hashes for causaliq_core-0.4.0.tar.gz
Algorithm Hash digest
SHA256 ea20eb242af11fa23d7c9a908bace97b092b6e2dbd9f5871c1a12d19746fdf88
MD5 991e4a49da6174995c3acf65758f91ad
BLAKE2b-256 fea56692341a7c933ccc75b77d149142c55baf95834baa23315489bc9c45d599

See more details on using hashes here.

File details

Details for the file causaliq_core-0.4.0-py3-none-any.whl.

File metadata

  • Download URL: causaliq_core-0.4.0-py3-none-any.whl
  • Upload date:
  • Size: 92.4 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.11.9

File hashes

Hashes for causaliq_core-0.4.0-py3-none-any.whl
Algorithm Hash digest
SHA256 a0e7c614f220a006d8cc82473ad5262f3b36910c6d994d69603c53b9dae26f05
MD5 a2104e65ab103be9eba3637c542f8e2d
BLAKE2b-256 230de84079988b261d9e5685e8bf16cdafd4eeabda40ab73b7e58509f7dc8bff

See more details on using hashes here.

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