Skip to main content

LitePolis router module implementing ParticiAPI specification

Project description

LitePolis-router-particiapi

ParticiAPI-compatible router module for LitePolis.

Overview

This module implements the ParticiAPI specification, providing a simpler alternative API for the ParticiApp frontend. It works alongside LitePolis-router-default (Polis API) and can be used interchangeably.

Installation

litepolis-cli deploy add-deps litepolis-router-particiapi
litepolis-cli deploy sync-deps

Configuration

This module exports default configuration. To customize, create a config file:

litepolis-cli deploy init-config

Then edit ~/.litepolis/litepolis.config:

[litepolis_router_particiapi]
session_secret = your-secure-secret-key-here
csrf_token_expire_hours = 24

ParticiAPI Endpoints

Endpoint Method Description
/api/session POST Create/refresh session
/api/conversations/{id} GET Get conversation
/api/conversations/{id}/results/ GET Get results (consensus/repness)
/api/conversations/{id}/statements/ GET Get all statements
/api/conversations/{id}/statements/ POST Submit new statement
/api/conversations/{id}/participant GET Get participant info
/api/conversations/{id}/participant/notifications GET Get notification settings
/api/conversations/{id}/participant/notifications PUT Set notification settings
/api/conversations/{id}/votes/{tid} PUT Submit vote

Key Differences from Polis API

  1. Endpoint Structure: /api/ prefix vs /api/v3/
  2. Session Auth: Cookie-based sessions with CSRF tokens
  3. Error Format: RFC 7807 Problem+JSON responses
  4. Vote Values: AGREE=-1, NEUTRAL=0, DISAGREE=1 (inverted from Polis)
  5. Response Format: Direct JSON objects vs PolisResponse wrapper

Quick Start

  1. Install all ParticiAPI modules:
litepolis-cli deploy add-deps litepolis-database-particiapi
litepolis-cli deploy add-deps litepolis-router-particiapi
litepolis-cli deploy add-deps litepolis-ui-particiapp
litepolis-cli deploy sync-deps
  1. Start LitePolis server:
litepolis-cli deploy serve

Development Testing

pip install -e .
pytest tests/

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_router_particiapi-0.1.1.tar.gz (7.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_router_particiapi-0.1.1-py3-none-any.whl (6.9 kB view details)

Uploaded Python 3

File details

Details for the file litepolis_router_particiapi-0.1.1.tar.gz.

File metadata

File hashes

Hashes for litepolis_router_particiapi-0.1.1.tar.gz
Algorithm Hash digest
SHA256 7b7858222cc5f14577fcbdca7641ab9b5cc5896ae88b951b16b491ad464a3579
MD5 eab5f0d3b470163efb574797d5899037
BLAKE2b-256 28b935a2ca7ba29260a01bf76785c7e48cacd36b44f9aa817272624f6566bcc5

See more details on using hashes here.

Provenance

The following attestation bundles were made for litepolis_router_particiapi-0.1.1.tar.gz:

Publisher: python-publish.yml on NewJerseyStyle/LitePolis-router-particiapi

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_router_particiapi-0.1.1-py3-none-any.whl.

File metadata

File hashes

Hashes for litepolis_router_particiapi-0.1.1-py3-none-any.whl
Algorithm Hash digest
SHA256 470fae993464a58c3c9e81c62f3f01c77918518d62fe409e138934ecaa0ce28a
MD5 d5f1b8bb6697ce1c0813cd6a2ce750a8
BLAKE2b-256 8f9c19c62776b27c96b77043accd4ac6642501a0c95fe3de81dc4b8b62c62870

See more details on using hashes here.

Provenance

The following attestation bundles were made for litepolis_router_particiapi-0.1.1-py3-none-any.whl:

Publisher: python-publish.yml on NewJerseyStyle/LitePolis-router-particiapi

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