Skip to main content

The package manager of a Customizable e-democracy opinion collection and insight mining system.

Project description

LitePolis

Infrastructure for E-democracy
PyPI - Version

Overview

LitePolis is an advanced, Python-based infrastructure designed for building customizable opinion collection systems, extending beyond the capabilities of the original Polis. It offers a developer-friendly environment focused on flexibility and power.

Built with a modular, microservice-like architecture, LitePolis is distributed by default, leveraging the Ray framework for inherent auto-scaling capabilities right out of the box. This ensures your applications can handle large groups and high traffic volumes efficiently.

The core of LitePolis is a central package manager that discovers and orchestrates various components – API Routers, Middleware, and UI Packages. This modularity allows developers and data scientists to easily build, deploy, and iterate on sophisticated data-driven e-democracy tools and other opinion-gathering applications.

Video about LitePolis

Quick start

1. Install the LitePolis CLI

The litepolis-cli is your main tool for creating, managing, and deploying LitePolis packages.

  • Needs Python (3.12 recommended) and pip installed.
pip install litepolis

2. Explore Packages for Deployment

Awesome-LitePolis scans GitHub everyday for available LitePolis packges (including work in progress repositories)

3. Deploy

Add features you want in LitePolis

litepolis-cli deploy list-deps

# remove packages if you don't need default packages that provides Polis functionality
litepolis-cli deploy remove-deps litepolis-router-default

# add packages that you need
litepolis-cli deploy add-deps litepolis-router-example

# setup default config for packages in `~/.litepolis/config.conf`
litepolis-cli deploy init-config

# setup password etc.
nano ~/.litepolis/config.conf

# start serving
litepolis-cli deploy serve
# Or: start a local head node and serve in one go
litepolis-cli deploy local

# Or deploy to remote cluster
litepolis-cli deploy --cluster ray://<head-node-ip>:10001 serve

For Developers

To build new package for the LitePolis ecosystem

# Create a new router package
litepolis-cli create router litepolis-router-myrouter

# Create a new database adapter
litepolis-cli create database litepolis-database-mydb

# Create a new middleware package
litepolis-cli create middleware litepolis-middleware-mymiddleware

# Create a new UI component
litepolis-cli create ui litepolis-ui-mypanel

Each command clones the appropriate template repo, renames everything to match your package name, and re-initializes git so you can push to your own repo.

After scaffolding:

cd litepolis-router-myrouter
git remote add origin YOUR_REPO_URL
git push -u origin main

Package requirements

Each package must expose at module level:

  • router — a FastAPI APIRouter instance
  • prefix — the API path prefix string (e.g. "v3")
  • dependencies — list of FastAPI dependencies (can be [])
  • DEFAULT_CONFIG — a dict[str, str] of default config values (used by init-config)

For database, middleware, and UI packages, the scaffolded template will show the expected interface.


CLI Reference

litepolis-cli deploy [OPTIONS] COMMAND

Options:
  --packages-file PATH   Path to packages.txt  [default: ~/.litepolis/packages.txt]
  --cluster TEXT         Ray cluster address   [default: auto]

Commands:
  add-deps      Add or update a package in packages.txt and install it
  remove-deps   Remove a package from packages.txt
  list-deps     Compare packages.txt with currently installed versions
  sync-deps     Install all packages in packages.txt to their pinned versions
  init-config   Generate ~/.litepolis/config.conf from installed packages
  serve         Start the LitePolis API server
  local         Start a local Ray head node and serve

litepolis-cli create COMMAND

Commands:
  router        Scaffold a new router package
  database      Scaffold a new database package
  middleware    Scaffold a new middleware package
  ui            Scaffold a new UI package

Next Steps:

  • Use StarRocks as database [WIP#todo]
  • Deploy to Google cloud with autoscale [WIP#todo]

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

litepolis-1.0.8.tar.gz (13.1 kB view details)

Uploaded Source

Built Distribution

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

litepolis-1.0.8-py3-none-any.whl (11.6 kB view details)

Uploaded Python 3

File details

Details for the file litepolis-1.0.8.tar.gz.

File metadata

  • Download URL: litepolis-1.0.8.tar.gz
  • Upload date:
  • Size: 13.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for litepolis-1.0.8.tar.gz
Algorithm Hash digest
SHA256 7f5218f4c3eb0849963f5265d4dd88bbad1979dd2b2048a26205d309525cc393
MD5 154e0de3475a02ba60b9dd87381448b5
BLAKE2b-256 d057f45a98324f780f8e38c52df5045cda849bad29344dfd3127405651b81f7e

See more details on using hashes here.

Provenance

The following attestation bundles were made for litepolis-1.0.8.tar.gz:

Publisher: python-publish.yml on NewJerseyStyle/LitePolis

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file litepolis-1.0.8-py3-none-any.whl.

File metadata

  • Download URL: litepolis-1.0.8-py3-none-any.whl
  • Upload date:
  • Size: 11.6 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for litepolis-1.0.8-py3-none-any.whl
Algorithm Hash digest
SHA256 c1b932bb10ec060c154bdd315b6d4a9b248d5df8fa379bf86f5e90dcb65b1dd5
MD5 081fd5aa1dcda356743e5278d7068afd
BLAKE2b-256 c87c9c97516ab28fc90c47118bd70d8365c67b14e1a9410cb2a20a52d950193e

See more details on using hashes here.

Provenance

The following attestation bundles were made for litepolis-1.0.8-py3-none-any.whl:

Publisher: python-publish.yml on NewJerseyStyle/LitePolis

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

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