{"id":18818906,"url":"https://github.com/py-why/pywhy-graphs","last_synced_at":"2025-04-06T13:09:42.758Z","repository":{"id":50115643,"uuid":"513851799","full_name":"py-why/pywhy-graphs","owner":"py-why","description":"[Experimental] Causal graphs that are networkx-compliant for the py-why ecosystem.","archived":false,"fork":false,"pushed_at":"2024-10-19T06:11:10.000Z","size":20919,"stargazers_count":47,"open_issues_count":23,"forks_count":8,"subscribers_count":2,"default_branch":"main","last_synced_at":"2024-10-19T08:43:34.451Z","etag":null,"topics":["causality","graphs","networkx","python"],"latest_commit_sha":null,"homepage":"https://py-why.github.io/pywhy-graphs/dev/index.html","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/py-why.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":"CONTRIBUTING.md","funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":"CITATION.cff","codeowners":null,"security":null,"support":null,"governance":"GOVERNANCE.md","roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2022-07-14T10:12:05.000Z","updated_at":"2024-10-18T07:36:56.000Z","dependencies_parsed_at":"2024-01-04T06:31:32.070Z","dependency_job_id":"08a94455-1ba9-45a0-9722-23b060a0994a","html_url":"https://github.com/py-why/pywhy-graphs","commit_stats":null,"previous_names":[],"tags_count":1,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/py-why%2Fpywhy-graphs","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/py-why%2Fpywhy-graphs/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/py-why%2Fpywhy-graphs/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/py-why%2Fpywhy-graphs/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/py-why","download_url":"https://codeload.github.com/py-why/pywhy-graphs/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247485287,"owners_count":20946398,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["causality","graphs","networkx","python"],"created_at":"2024-11-08T00:19:23.507Z","updated_at":"2025-04-06T13:09:42.727Z","avatar_url":"https://github.com/py-why.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"[![Code style: black](https://img.shields.io/badge/code%20style-black-000000.svg)](https://github.com/psf/black)\n[![CircleCI](https://circleci.com/gh/py-why/pywhy-graphs/tree/main.svg?style=svg)](https://circleci.com/gh/py-why/pywhy-graphs/tree/main)\n[![unit-tests](https://github.com/py-why/pywhy-graphs/actions/workflows/main.yml/badge.svg)](https://github.com/py-why/pywhy-graphs/actions/workflows/main.yml)\n[![Checked with mypy](http://www.mypy-lang.org/static/mypy_badge.svg)](http://mypy-lang.org/)\n[![codecov](https://codecov.io/gh/py-why/pywhy-graphs/branch/main/graph/badge.svg?token=H1reh7Qwf4)](https://codecov.io/gh/py-why/pywhy-graphs)\n[![PyPI Download count](https://pepy.tech/badge/pywhy-graphs)](https://pepy.tech/project/pywhy-graphs)\n[![Latest PyPI release](https://img.shields.io/pypi/v/pywhy-graphs.svg)](https://pypi.org/project/pywhy-graphs/)\n\n# PyWhy-Graphs\n\npywhy-graphs is a Python graph library that extends [networkx](https://github.com/networkx/networkx) with the notion of a `MixedEdgeGraph` to implement a light-weight API for causal graphical structures that contain mixed-edges and contain causal graph traversal algorithms.\n\n## Why?\n\nRepresentation of causal graphical models in Python are severely lacking.\n\nPyWhy-Graphs implements a graphical API layer for representing commmon graphs in causal inference: ADMG, CPDAG and PAG. For causal DAGs, we recommend using the `networkx.DiGraph` class and\nensuring acylicity via `networkx.is_directed_acyclic_graph` function.\n\nExisting packages that aim to represent causal graphs either break from the networkX API, or only implement a subset of the relevant causal graphs. By keeping in-line with the robust NetworkX API, we aim to ensure a consistent user experience and a gentle introduction to causal graphical models. A `MixedEdgeGraph` instance is a composition of networkx graphs and has a similar API, with the additional notion of an \"edge type\", which specifies what edge type subgraph any function should operate over. For example:\n\n```Python\n# adds a directed edge from x to y\nG.add_edge('x', 'y', edge_type='directed')\n\n# adds a bidirected edge from x to y\nG.add_edge('x', 'y', edge_type='bidirected')\n```\n\nMoreover, sampling from causal models is non-trivial, but a requirement for benchmarking many causal algorithms in discovery, ID, estimation and more. We aim to provide simulation modules that are easily connected with causal graphs to provide a simple robust API for modeling causal graphs and then simulating data.\n\n# Documentation\n\nSee the [development version documentation](https://py-why.github.io/pywhy-graphs/dev/index.html).\n\nOr see [stable version documentation](https://py-why.github.io/pywhy-graphs/stable/index.html)\n\n# Installation\n\nInstallation is best done via `pip` or `conda`. For developers, they can also install from source using `pip`. See [installation page](https://py-why.github.io/pywhy-graphs/dev/installation.html) for full details.\n\n## Dependencies\n\nWe aim to provide a very light-weight dependency structure. Minimally, pywhy-graphs requires:\n\n    * Python (\u003e=3.8)\n    * numpy\n    * scipy\n    * networkx\n\nAdditional functionality may be required when running unit-tests and documentation.\n\n## User Installation\n\nIf you already have a working installation of numpy, scipy and networkx, the easiest way to install pywhy-graphs is using `pip`:\n\n    pip install pywhy-graphs\n\nor you can add it via poetry\n\n    poetry add pywhy-graphs\n\nTo install the package from github, clone the repository and then `cd` into the directory. You can then use `poetry` to install:\n\n    poetry install\n\n    # for vizualizing graph functionality\n    poetry install --extras viz\n\n    # if you would like an editable install of dodiscover for dev purposes\n    pip install -e .\n\n    pip install https://api.github.com/repos/py-why/pywhy-graphs/zipball/main\n\n# Contributing\n\nPywhy-Graphs is always looking for new contributors to help make the package better, whether it is algorithms, documentation, examples of graph usage, and more! Contributing to Pywhy-Graphs will be rewarding because you will contribute to a much needed package for causal inference.\n\nSee our [contributing guide](https://github.com/py-why/pywhy-graphs/blob/main/CONTRIBUTING.md) for more details.\n\n# Citing\n\nPlease refer to the Github Citation to cite the repository.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpy-why%2Fpywhy-graphs","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fpy-why%2Fpywhy-graphs","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpy-why%2Fpywhy-graphs/lists"}