Skip to main content

Client library for interacting with API of any Pol.is server

Project description

polis-client-py

An unofficial Python API client for communicating with any Polis servers.

It will start off as read-only, but I intend to add helpers for handling POST requests via xid, and maybe jwt.

This will eventually be used in the red-dwarf algorithm library, doing much of the work of that library's current "data loader".

Installation

pip install polis-client

Usage

See: examples.ipynb

File Structure

./polis-client/
├── Makefile                    # Shared: Build scripts
├── README.md                   # Shared: Main project README
├── openapi
│   └── polis.yml               # Shared: OpenAPI spec
├── pyproject.toml              # Python dependencies
└── python
    ├── README.md               # Python client README
    ├── debug.py                # Messy testing file
    ├── examples.ipynb          # Primary documentation
    └── src
        └── polis_client
            ├── client.py       # Custom Python thin client
            └── generated/      # Auto-generated client code

Development

(We use uv, but you can use any Python environment.)

This project is structured around an OpenAPI definition at ../openapi/polis.yml, from which most of the code in this repository is auto-generated.

We have written a thin custom client around the auto-generated client code that is built (from the repository root) with:

$ uv run make regenerate-py

This command must be run whenever you update the YAML spec file. For legibility of commit history, any updates to auto-generated should be committed in a batch separate from your own changes. (e.g. "Adding auto-generated code.")

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

polis_client-0.1.2.tar.gz (216.0 kB view details)

Uploaded Source

Built Distribution

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

polis_client-0.1.2-py3-none-any.whl (64.3 kB view details)

Uploaded Python 3

File details

Details for the file polis_client-0.1.2.tar.gz.

File metadata

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

File hashes

Hashes for polis_client-0.1.2.tar.gz
Algorithm Hash digest
SHA256 0cd2f7332b084ef283a6bd5dde8de54eb87903dc05bdc2ebe3cf8cc8ef2b81bf
MD5 429fd8a865060b24493ea7479285fb69
BLAKE2b-256 802e2f5143ce3078cc9dfbde14f53743445bee1717a3043e654d8246f63be80c

See more details on using hashes here.

File details

Details for the file polis_client-0.1.2-py3-none-any.whl.

File metadata

File hashes

Hashes for polis_client-0.1.2-py3-none-any.whl
Algorithm Hash digest
SHA256 959c34918dff1260c9813254d7f8e130e2c83674f2d3d7904e228ecb647432a0
MD5 c6476de3cf014541c2cdf2e5285f982a
BLAKE2b-256 38b41c0e5056d94cdd3f853074c068bf937c2e94d628a7c4a39f2fb9118a4d74

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