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.0.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.0-py3-none-any.whl (108.5 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: glpi_python_client-0.1.0.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.0.tar.gz
Algorithm Hash digest
SHA256 81079a76e8f753925729dd22e93a91597086519c8cdca6a7dbc46343226d08f4
MD5 e066ad4410573a6e338f9761206ff204
BLAKE2b-256 3bc5289ec0ea46049f80650f11dc10ca3bf60be02e32bc725de354f3e2c5b357

See more details on using hashes here.

Provenance

The following attestation bundles were made for glpi_python_client-0.1.0.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.0-py3-none-any.whl.

File metadata

File hashes

Hashes for glpi_python_client-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 2d1d6f1f6b60c7ec7a2a8c65e70af412677c55d40144e1a91d1603d184cf12a4
MD5 24088667795a8b192ff2e336e8f6979a
BLAKE2b-256 ee66a13f6c97c4fac435ce1b433205296ca7bd782a939869e695d248265c36ee

See more details on using hashes here.

Provenance

The following attestation bundles were made for glpi_python_client-0.1.0-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