{"id":26406573,"url":"https://github.com/polis-community/red-dwarf","last_synced_at":"2025-10-06T23:49:29.919Z","repository":{"id":273007422,"uuid":"918450653","full_name":"polis-community/red-dwarf","owner":"polis-community","description":"A DIMensional REDuction library for stellarpunk democracy into the long haul. (Inspired by Pol.is)","archived":false,"fork":false,"pushed_at":"2025-03-14T06:02:42.000Z","size":1069,"stargazers_count":6,"open_issues_count":15,"forks_count":1,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-03-14T07:22:04.878Z","etag":null,"topics":["civic-tech","collective-intelligence","data-science","deliberative-democracy","democracy","dimensionality-reduction","participatory-democracy","polis"],"latest_commit_sha":null,"homepage":"https://polis-community.github.io/red-dwarf-democracy/","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mpl-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/polis-community.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null},"funding":{"patreon":"patcon"}},"created_at":"2025-01-18T00:59:30.000Z","updated_at":"2025-03-10T21:27:37.000Z","dependencies_parsed_at":"2025-01-18T02:18:11.218Z","dependency_job_id":"06ae2c73-9a8d-49ba-b9c7-a24044e654cc","html_url":"https://github.com/polis-community/red-dwarf","commit_stats":null,"previous_names":["patcon/red-dwarf","polis-community/red-dwarf","polis-community/red-dwarf-democracy"],"tags_count":2,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/polis-community%2Fred-dwarf","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/polis-community%2Fred-dwarf/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/polis-community%2Fred-dwarf/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/polis-community%2Fred-dwarf/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/polis-community","download_url":"https://codeload.github.com/polis-community/red-dwarf/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":244076258,"owners_count":20394093,"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":["civic-tech","collective-intelligence","data-science","deliberative-democracy","democracy","dimensionality-reduction","participatory-democracy","polis"],"created_at":"2025-03-17T17:25:47.587Z","updated_at":"2025-10-06T23:49:29.914Z","avatar_url":"https://github.com/polis-community.png","language":"Python","funding_links":["https://patreon.com/patcon"],"categories":[],"sub_categories":[],"readme":"# Red Dwarf: A Pol.is-like library\n\n\u0026nbsp;\u0026nbsp;\n⚫⋆✦⋆⭑⋆⋆⋆⋆⋆\n\u0026nbsp;\u0026nbsp;\u0026nbsp;\u0026nbsp;\u0026nbsp;\u0026nbsp;\u0026nbsp;\u0026nbsp;\n[![PyPI - Version](https://img.shields.io/pypi/v/red-dwarf)][pypi]\n[![Run Tests](https://github.com/polis-community/red-dwarf-democracy/actions/workflows/test.yml/badge.svg)](https://github.com/polis-community/red-dwarf-democracy/actions/workflows/test.yml)\n[![Deploy Docs](https://github.com/polis-community/red-dwarf/actions/workflows/deploy-docs.yml/badge.svg)](https://github.com/polis-community/red-dwarf/actions/workflows/deploy-docs.yml)\n--------\n\nA \u003cem\u003eDIM\u003c/em\u003eensional \u003cem\u003eRED\u003c/em\u003euction library for reproducing and experimenting with Polis-like data pipelines.\n\n\u003e Red dwarf stars are dim red stars. They are hard to see, but are the most common\n\u003e type -- the quiet 70% majority. They burn slow, using fuel efficiently,\n\u003e making them the longest-living stars in the universe. They'll be around until\n\u003e the last light, even supporting habitable planets for billions of years.\n\u003e If there's persistant life out there, it's likely in a long slow dance with a red dwarf.\n\n## Features\n\n- Loads data from any Polis conversation on any Polis server, using only the conversation URL.\n- Reproduces Polis calculation pipeline from only raw vote data.\n  - \"Classic\" Polis pipeline = PCA dimensional reduction, KMeans clustering, and comment statistics.\n- Alternative algorithms, aspiring for sensible defaults:\n  - dimensional reduction: [PaCMAP \u0026 LocalMAP][pacmap]\n    - Planned: [UMAP][umap], [TriMap][trimap], [PHATE][], [ivis][ivis], [LargeVis][largevis]\n  - clustering: [HDBSCAN*][hdbscan]\n    - Planned: [EVOC][evoc]\n- Helpful visualizations via `matplotlib`\n  - Planned: [Plotly][plotly]\n\n## Goals\n\nCode that aspires to embody and support democratic values should be...\n\n- **Legible.** It should be explorable and auditable not just to researchers, but to as many curious citizens as possible.\n- **Re-usable.** It should be easily used in contexts in which its original creators did not anticipate, nor perhaps even desire.\n- **Collectively stewarded.** It should grow and govern itself democratically and in a plural fashion.\n\n## Roadmap\n\nFor now, see [this related issue](https://github.com/patcon/red-dwarf/issues/4)\n\n## Sponsors\n\n\u003cp\u003e\n  \u003ca href=\"https://agoracitizen.network\" rel=\"noopener sponsored\" target=\"_blank\"\u003e\u003cimg width=\"167\" src=\"https://agoracitizen.network/images/big_logo_agora.png\" alt=\"Agora Citizen Network\" title=\"Where citizens converge to exchange and debate ideas\" loading=\"lazy\" /\u003e\u003c/a\u003e\n\u003c/p\u003e\n\nRed Dwarf is generously sponsored by [ZKorum SAS](https://zkorum.com), creators of the [Agora Citizen Network](https://agoracitizen.network).\n\nAre you or your organization eager to see more platforms and community built around democracy-supporting algorithms like these? **Please consider [getting in touch on Discord](#get-involved) and supporting our continued work!** (ping @patcon)\n\n## Usage\n\n```\n# OFFICIAL RELEASES\n\n# For core, the classic polis pipeline: PCA + K-means\n# (~60MB beyond scikit-learn disk space)\npip install red-dwarf\n\n# For additional algorithms beyond classic polis: PaCMAP, LocalMAP, HDBSCAN, etc.\npip install red-dwarf[alt-algos]\n\n# For additional packages for visualizing plots\npip install red-dwarf[plots]\n\n# For everything (~60MB beyond core packages)\npip install red-dwarf[all]\n# pip install red-dwarf[alt-algos,plots]\n```\n\nSee [`docs/notebooks/polis-implementation-demo.ipynb`][notebook] or [`docs/notebooks/`][notebooks] for other examples.\n\n\n| screenshot of library-generated notebook | screenshot of Polis-generated report |\n|---|---|\n| [![screen of the sample jupyter notebook](docs/notebook-screenshot.png)][notebook] | ![screenshot of the polis report](https://imgur.com/blkIEtW.png) |\n\n- [`docs/notebooks/loading-data.ipynb`](https://github.com/polis-community/red-dwarf/blob/main/docs/notebooks/loading-data.ipynb)\n- [`docs/notebooks/heatmap.ipynb`](https://github.com/polis-community/red-dwarf/blob/main/docs/notebooks/heatmap.ipynb)\n- [`docs/notebooks/polis-implementation-demo.ipynb`](https://github.com/polis-community/red-dwarf/blob/main/docs/notebooks/polis-implementation-demo.ipynb)\n- [`docs/notebooks/dump-downloaded-polis-data.ipynb`](https://github.com/polis-community/red-dwarf/blob/main/docs/notebooks/dump-downloaded-polis-data.ipynb)\n- Advanced\n   - [`docs/notebooks/map-xids.ipynb`](https://github.com/polis-community/red-dwarf/blob/main/docs/notebooks/map-xids.ipynb)\n   - [`docs/notebooks/alternative-algorithms.ipynb`](https://github.com/polis-community/red-dwarf/blob/main/docs/notebooks/alternative-algorithms.ipynb)\n   - [`docs/notebooks/strip-pass-votes.ipynb`](https://github.com/polis-community/red-dwarf/blob/main/docs/notebooks/strip-pass-votes.ipynb)\n   - [`docs/notebooks/untested/tabpfn-experiment.ipynb`](https://github.com/polis-community/red-dwarf/blob/main/docs/notebooks/untested/tabpfn-experiment.ipynb)\n\n## Architecture\n\nThis is the generalized pipeline of Polis-like processes that we're aiming to accomodate. (See [issue #53](https://github.com/polis-community/red-dwarf/issues/53#issuecomment-2942923628) for details.)\n\n![](https://github.com/user-attachments/assets/8b7b5bfc-7127-4a27-8316-7528209d7c8e)\n\n## Get Involved\n\n### Running it for local development\n\n- Install python (preferrably virtual environment)\n- Install uv (python package manager) (e.g. `pip install uv`)\n- Install dependencies with `make install-dev`\n- Run `make` command alone to see other helpful make subcommands\n- Alternatively, run one of the ipynb notebooks; possibly replacing the install command at the top with `%pip install -e ../../` to use the local source instead.\n\n### Contributing\n\n- [Join][pug-discord] the _Polis User Group (PUG)_ **Discord** server.\n- Open a **GitHub issue**.\n- Submit a **GitHub pull request**.\n- Review the [**_Awesome Polis_ directory**][awesome-polis] to learn about related projects, academic papers, and other resources.\n   - Use the _\"People\"_ section to find other individuals and groups working in the field.\n\n\n## Changelog\n\nSee [`CHANGELOG.md`][changelog].\n\n## License\n\n[MPL 2.0: Mozilla Public License 2.0][mplv2] (See [`LICENSE`][license])\n\n\u003c!-- Links --\u003e\n   [pypi]: https://pypi.org/project/red-dwarf/\n   [stellarpunk]: https://www.youtube.com/watch?v=opnkQVZrhAw\n\n   [pacmap]: https://github.com/YingfanWang/PaCMAP\n   [umap]: https://github.com/lmcinnes/umap\n   [trimap]: https://github.com/eamid/trimap\n   [phate]: https://github.com/KrishnaswamyLab/PHATE\n   [ivis]: https://github.com/beringresearch/ivis\n   [largevis]: https://github.com/lferry007/LargeVis\n\n   [hdbscan]: https://github.com/scikit-learn-contrib/hdbscan\n   [evoc]: https://github.com/TutteInstitute/evoc\n\n   [plotly]: https://plotly.com/python/\n\n   [notebook]: https://github.com/polis-community/red-dwarf/blob/main/docs/notebooks/polis-implementation-demo.ipynb\n   [notebooks]: https://github.com/polis-community/red-dwarf/tree/main/docs/notebooks/\n   [ZKorum]: https://github.com/zkorum\n   [agora]: https://agoracitizen.network/\n   [ngi-funding]: https://trustchain.ngi.eu/zkorum/\n   [MPLv2]: https://choosealicense.com/licenses/mpl-2.0/\n   [license]: https://github.com/polis-community/red-dwarf/blob/main/LICENSE\n   [pug-discord]: https://discord.com/invite/wFWB8kzQpP\n   [awesome-polis]: http://patcon.github.io/awesome-polis/\n   [changelog]: CHANGELOG.md\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpolis-community%2Fred-dwarf","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fpolis-community%2Fred-dwarf","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpolis-community%2Fred-dwarf/lists"}