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.

Getting Started: Develop to Deploy LitePolis App in 7 Steps!

This tutorial guides you through building and deploying a minimal LitePolis application, consisting of a simple API backend (a Router package).

Prerequisites:

  • Python (3.8+ recommended) and pip installed.
  • Git installed.
  • Access to a running Ray Cluster. For local development, you can start one easily:
    pip install ray[serve] # Install Ray with the Serve component
    ray start --head --dashboard-host 0.0.0.0 # Start a local single-node cluster
    # Access the Ray Dashboard at http://127.0.0.1:8265
    
    (Refer to Ray Cluster Setup Docs for more advanced setups like multi-node or Kubernetes)

1. Install the LitePolis CLI

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

pip install litepolis
# Verify installation
litepolis --version

2. Create Your First API Router Package

API Routers handle backend logic and data requests. Let's create a simple "hello world" router.

# Use the CLI to bootstrap a new router package
litepolis create router litepolis-router-simple-api

# Navigate into the new directory
cd litepolis-router-simple-api

This command creates a standard Python package structure. Look inside litepolis_router_simple_api/main.py (or similar). It will contain boilerplate code using FastAPI. Let's make sure it has a basic endpoint:

# litepolis_router_simple_api/main.py (ensure/modify it looks like this)
from fastapi import APIRouter

router = APIRouter()

@router.get("/hello")
async def read_root():
    return {"message": "Hello from my-simple-api!"}

# LitePolis package manager will discover this 'router' object

3. Prepare Your Packages for Deployment

For the LitePolis CLI to find your local packages during deployment, you often need to install them in "editable" mode.

# In the litepolis-router-simple-api directory:
pip install -e .

This makes your local package code importable by the LitePolis deployment process.

4. Deploy to Ray!

Make sure your local Ray cluster is running (see Prerequisites). Now, use the LitePolis CLI to deploy your application based on the configuration file.

litepolis-cli deploy add-deps litepolis-router-simple-api
litepolis-cli deploy serve

Next Steps:

  • Explore the Example UI and Example Router repositories in more detail.
  • Try adding a Middleware package (litepolis create middleware ...) for things like logging or authentication.
  • Learn more about configuring auto-scaling, replicas, and other deployment options in your deploy.yaml or via CLI arguments (refer to LitePolis documentation).
  • Integrate a database using a dedicated router package (see the Database Example).

Deployment & Maintenance Strengths

While the tutorial covers the how, remember the key whys for using LitePolis, especially for administrators:

  • Default Auto-Scaling: Ray Serve automatically scales API replicas based on traffic.
  • Modular Feature Addition: Add functionality by adding package dependencies and redeploying.
  • Simplified Orchestration: The litepolis tool manages component discovery and dependency resolution.
  • Resilience: Ray provides fault tolerance for running components.
  • Cloud Native: Runs effectively on Kubernetes and cloud platforms.

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.1.tar.gz (8.7 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.1-py3-none-any.whl (9.0 kB view details)

Uploaded Python 3

File details

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

File metadata

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

File hashes

Hashes for litepolis-1.0.1.tar.gz
Algorithm Hash digest
SHA256 4b417e00241e2319be8b5bd157b3d1f75ba3bb231b091c3755ccece3df86a724
MD5 047c309c12cc3236967766b4fea4a661
BLAKE2b-256 421ccc4a4bbd00bf56ac3cfb9b47650835041e10e4e5ee6c6e0e881126235ea2

See more details on using hashes here.

Provenance

The following attestation bundles were made for litepolis-1.0.1.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.1-py3-none-any.whl.

File metadata

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

File hashes

Hashes for litepolis-1.0.1-py3-none-any.whl
Algorithm Hash digest
SHA256 acda2547a54dde2e9e6a3ef4b3b98b95354ebc658eb83c07aeb45a7570c4d524
MD5 a28318a567b405b4849eff5561cd9b7c
BLAKE2b-256 b8c272e32fcb2ce86af3f04252810d57f53a89d22f6f068bbc8474a430f0482b

See more details on using hashes here.

Provenance

The following attestation bundles were made for litepolis-1.0.1-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