Skip to main content

A DIMensional REDuction library for reproducing and experimenting with Polis-like data pipelines.

Project description

Red Dwarf: A Pol.is-like library

   ⚫⋆✦⋆⭑⋆⋆⋆⋆⋆          PyPI - Version Run Tests Deploy Docs

A DIMensional REDuction library for reproducing and experimenting with Polis-like data pipelines.

Red dwarf stars are dim red stars. They are hard to see, but are the most common type -- the quiet 70% majority. They burn slow, using fuel efficiently, making them the longest-living stars in the universe. They'll be around until the last light, even supporting habitable planets for billions of years. If there's persistant life out there, it's likely in a long slow dance with a red dwarf.

Features

  • Loads data from any Polis conversation on any Polis server, using only the conversation URL.
  • Reproduces Polis calculation pipeline from only raw vote data.
    • "Classic" Polis pipeline = PCA dimensional reduction, KMeans clustering, and comment statistics.
  • Alternative algorithms, aspiring for sensible defaults:
  • Helpful visualizations via matplotlib

Goals

Code that aspires to embody and support democratic values should be...

  • Legible. It should be explorable and auditable not just to researchers, but to as many curious citizens as possible.
  • Re-usable. It should be easily used in contexts in which its original creators did not anticipate, nor perhaps even desire.
  • Collectively stewarded. It should grow and govern itself democratically and in a plural fashion.

Roadmap

For now, see this related issue

Sponsors

Agora Citizen Network

Red Dwarf is generously sponsored by ZKorum SAS, creators of the Agora Citizen Network.

Are 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 and supporting our continued work! (ping @patcon)

Usage

# OFFICIAL RELEASES

# For core, the classic polis pipeline: PCA + K-means
# (~60MB beyond scikit-learn disk space)
pip install red-dwarf

# For additional algorithms beyond classic polis: PaCMAP, LocalMAP, HDBSCAN, etc.
pip install red-dwarf[alt-algos]

# For additional packages for visualizing plots
pip install red-dwarf[plots]

# For everything (~60MB beyond core packages)
pip install red-dwarf[all]
# pip install red-dwarf[alt-algos,plots]

See docs/notebooks/polis-implementation-demo.ipynb or docs/notebooks/ for other examples.

screenshot of library-generated notebook screenshot of Polis-generated report
screen of the sample jupyter notebook screenshot of the polis report

Architecture

This is the generalized pipeline of Polis-like processes that we're aiming to accomodate. (See issue #53 for details.)

Get Involved

Running it for local development

  • Install python (preferrably virtual environment)
  • Install uv (python package manager) (e.g. pip install uv)
  • Install dependencies with make install-dev
  • Run make command alone to see other helpful make subcommands
  • 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.

Contributing

  • Join the Polis User Group (PUG) Discord server.
  • Open a GitHub issue.
  • Submit a GitHub pull request.
  • Review the Awesome Polis directory to learn about related projects, academic papers, and other resources.
    • Use the "People" section to find other individuals and groups working in the field.

Changelog

See CHANGELOG.md.

License

MPL 2.0: Mozilla Public License 2.0 (See LICENSE)

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

red_dwarf-0.4.0.tar.gz (49.6 kB view details)

Uploaded Source

Built Distribution

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

red_dwarf-0.4.0-py3-none-any.whl (52.0 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: red_dwarf-0.4.0.tar.gz
  • Upload date:
  • Size: 49.6 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.7.2

File hashes

Hashes for red_dwarf-0.4.0.tar.gz
Algorithm Hash digest
SHA256 92f5d0120cb8dd758890246fbb8497bc559663333f1aaf9e871bff0cc9ea163e
MD5 a868765f66b7786e2b3f1ce817227e3b
BLAKE2b-256 3fb7cd6609d8cc712809c5d9dbef3f7bcd797cd9b479ce84a71c11654cbf9634

See more details on using hashes here.

File details

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

File metadata

  • Download URL: red_dwarf-0.4.0-py3-none-any.whl
  • Upload date:
  • Size: 52.0 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.7.2

File hashes

Hashes for red_dwarf-0.4.0-py3-none-any.whl
Algorithm Hash digest
SHA256 2b002bbb8b3f9b5864532a62860b1d76b307b6b8905cea1ab11f0a9c25154bb3
MD5 8d9fb484f0ffe2b9a5074d29a699a2d2
BLAKE2b-256 d1ca1611e38e619cc8f4fffa7a0e90c84971810e9066d94d3c7019e96657eef2

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