Skip to main content

A typed Python client for GLPI ITSM APIs.

Project description

glpi-python-client

CI License Python Docs

glpi-python-client is a typed Python client for GLPI ITSM APIs.

The goal is to let GLPI integrations work with domain objects instead of raw JSON payloads. The package exposes Pydantic models for tickets, users, followups, documents, locations, and related records, while converting GLPI HTML content into Markdown for Python-side workflows and rendering Markdown back to HTML for outgoing payloads.

It currently focuses on ticket-centric workflows and exposes matching sync and async high-level clients.

Installation

pip install glpi-python-client

For local development:

python -m pip install -e .[dev]
python -m pytest

Quick Start

Create a client with your GLPI API URL and at least one complete auth pair:

  • client_id and client_secret
  • username and password
  • both pairs together
from glpi_python_client import GlpiClient, GlpiTicket

with GlpiClient(
    glpi_api_url="https://glpi.example.com/api.php",
    client_id="oauth-client-id",
    client_secret="oauth-client-secret",
    username="api-user",
    password="api-password",
) as glpi:
    ticket_id = glpi.create_ticket(
        GlpiTicket(
            name="Printer issue",
            content="The printer is not reachable from the office network.",
            urgency=3,
            impact=3,
        )
    )
    ticket = glpi.get_ticket_record(ticket_id)

    print(ticket.id)
    print(ticket.content)

Async code uses the same model layer and nearly the same API surface:

from glpi_python_client import AsyncGlpiClient

async with AsyncGlpiClient(
    glpi_api_url="https://glpi.example.com/api.php",
    client_id="oauth-client-id",
    client_secret="oauth-client-secret",
) as glpi:
    tickets = await glpi.search_ticket_records(query='status.id=in=(1,2)')

If your application already provides GLPI_ environment variables, GlpiClient.from_env() and AsyncGlpiClient.from_env() are also available.

Documentation

To build the Sphinx documentation locally:

python -m pip install -e .[docs]
python -m sphinx -b html docs docs/_build/html

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

glpi_python_client-0.1.3.tar.gz (78.2 kB view details)

Uploaded Source

Built Distribution

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

glpi_python_client-0.1.3-py3-none-any.whl (108.5 kB view details)

Uploaded Python 3

File details

Details for the file glpi_python_client-0.1.3.tar.gz.

File metadata

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

File hashes

Hashes for glpi_python_client-0.1.3.tar.gz
Algorithm Hash digest
SHA256 5ca57314d701ebc7dad09b07ef0b2a3788ca852c4ddc9b4c46e4cbd55467f69c
MD5 f5aab4d50eb6253f4326a797f11031c5
BLAKE2b-256 8ea26434131451a2a7daf11eb38cccc86f52ccd831097bbe6fff229400c521cb

See more details on using hashes here.

Provenance

The following attestation bundles were made for glpi_python_client-0.1.3.tar.gz:

Publisher: release.yml on baraline/glpi_python_client

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

File details

Details for the file glpi_python_client-0.1.3-py3-none-any.whl.

File metadata

File hashes

Hashes for glpi_python_client-0.1.3-py3-none-any.whl
Algorithm Hash digest
SHA256 02c316b52932152b498d51f299b719e42c0640690ad77064ea88e41f7ec175b5
MD5 a523b646e5123056680972dcb8542c5f
BLAKE2b-256 811d6ba1349ecf0f108b531fed7d6ae67ed2018a06045305d99b79f09aa3ecd8

See more details on using hashes here.

Provenance

The following attestation bundles were made for glpi_python_client-0.1.3-py3-none-any.whl:

Publisher: release.yml on baraline/glpi_python_client

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