Skip to main content

Red Dwarf

Run Tests

A DIMensional REDuction library for stellarpunk democracy into the long haul.

Stars are fires that burn for thousands of years. Some of them burn slow and long, like red dwarfs. Others-blue giants-burn their fuel so fast they shine across great distances, and are easy to see. As they start to run out of fuel, they burn helium, grow even hotter, and explode in a supernova. Supernovas, they're brighter than the brightest galaxies. They die, and everyone watches them go. -- Jodi Picoult, My Sister's Keeper

If advanced alien civilizations really are out there, the planets of red dwarf stars could be ideal places to find them. -- How the Universe Works (S5E8), Discovery

Inspiration: https://chatgpt.com/share/677f7690-7188-800b-85e5-816aaa7cc8f9

Roadmap

For now, see this related issue

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.

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

See docs/example-usage.ipynb

screen of the sample jupyter notebook

Loading Data

Let's say that you have a conversation for which you know the conversation url, and you may or may not know the report url. This conversation may also have an archived CSV export saved somewhere online.

from reddwarf.polis import PolisClient

# If you only know the conversation ID, you can fetch the live data from the Polis APIs.
# Note that this may be fresher than a static export hosted elsewhere.
client = PolisClient()
client.load_data(conversation_id="4yy3sh84js")
# If you happen to know the report ID, that can be used instead.

# All of these are equivalent:
client.load_data(conversation_id="4yy3sh84js")
client.load_data(conversation_id="4yy3sh84js", data_source="api")
client.load_data(report_id="r5jsvucnwuuhw7dzjvaim")
client.load_data(report_id="r5jsvucnwuuhw7dzjvaim", data_source="api")

# If you know the report ID, you can also download from the newer and more official CSV export API endpoint:
# Example: https://pol.is/api/v3/reportExport/r5jsvucnwuuhw7dzjvaim/participant-votes.csv
client = PolisClient()
client.load_data(report_id="r5jsvucnwuuhw7dzjvaim", data_source="csv_export")

# All of these are equivalent:
client.load_data(report_id="r5jsvucnwuuhw7dzjvaim", data_source="csv_export")
client.load_data(directory_url="https://pol.is/api/v3/reportExport/r5jsvucnwuuhw7dzjvaim/")


# If you know a remote directory-like path that contains all the raw export files, you can use that.
# EXAMPLE
# Web: https://github.com/compdemocracy/openData/tree/master/scoop-hivemind.ubi
# Raw: https://raw.githubusercontent.com/compdemocracy/openData/refs/heads/master/scoop-hivemind.ubi/
#
# Note: you must tell the loader whether "strict moderation" is being used,
# as this can't be detected from the export data.
# The loader will look for files with these names:
#     - comments.csv
#     - votes.csv
client = PolisClient(is_strict_moderation=True)
client.load_data(directory_url="https://raw.githubusercontent.com/compdemocracy/openData/refs/heads/master/scoop-hivemind.ubi/")

# If you have local CSV files, you can also load them individually.
# Again, you must hint the moderation type.
# Filenames must match `*comments.csv` or `*votes.csv`
client = PolisClient(is_strict_moderation=True)
client.load_data(filepaths=[
   "your-data/comments.csv",
   "your-data/votes.csv",
])

Get Involved

  • 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)

Metadata

Release files for red-dwarf-democracy 0.1.1

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

Source distribution (sdist)

Source distribution for red-dwarf-democracy 0.1.1
File Size Uploaded
red_dwarf_democracy-0.1.1.tar.gz 22.7 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for red-dwarf-democracy 0.1.1
File Interpreter ABI Platform
red_dwarf_democracy-0.1.1-py3-none-any.whl Python 3 none any Details

Total release size: 43.0 kB

Release files / red_dwarf_democracy-0.1.1.tar.gz

Download URL red_dwarf_democracy-0.1.1.tar.gz
Size 22.7 kB
Tags Source
SHA-256 checksum
How to use checksums
1d0858ce692ee0e4aedf8119512c43c6b2a0d9834d881ec4af7e5be087042462
BLAKE2b-256 checksum
How to use checksums
96071c665570564f7c40d0163b73590d589b73788209e2fd2c1ca917c4a55daf
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via uv/0.5.5

Release files / red_dwarf_democracy-0.1.1-py3-none-any.whl

Download URL red_dwarf_democracy-0.1.1-py3-none-any.whl
Size 20.4 kB
Tags Python 3
SHA-256 checksum
How to use checksums
a9a0c66e5b2bb150f5a64636fc2885cd59aa9b3178a485b4ec1ede6bfb8ed01c
BLAKE2b-256 checksum
How to use checksums
f0f6f8d1a0a87f62e834f5af8dcd023b3a610ce158109eff8b04630b11432abf
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via uv/0.5.5

Release history Release notifications | RSS feed

This release

0.1.1 This release

2 release files

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