Skip to main content

Um cliente Python para a API do GLPI

Project description

glpipci - GLPI Python Comunicator Interface - [unofficial]

PyPI Python Version License Beta

Um cliente Python para a API do GLPI.

Instalação

Para instalar o pacote, use o seguinte comando:

pip install glpipci

Uso

Básico

Exemplo de como usar o pacote

from glpipci.comunicator.v10_0.api import GLPIApiClient

client = GLPIApiClient(username="admin", password="password")
response = client.make_get("http://localhost:8090/apirest.php/some_endpoint")
print(response.json())

Variáveis de ambiente

Variáveis de ambiente (export ou arquivo .env)

GLPI_URL=https://localhost/apirest.php
USER_TOKEN=FooUserTokenFOOuserTokenFoOuSeRtOkEn
APP_TOKEN=fOOTokenFooTokenFooTokenFooToken
DISCORD_WEBHOOK_URL=https://discord.com/api/webhooks/123123123123/fknsoaoknasfoknfasokafsnonkfsoknsfakonfs
ATTACHMENTS_DIR=Attachments
PERSONS_PATH=adicionais/Person.json
LOG_DIR=logs

Código:

from glpipci.comunicator.v10_0.api import GLPIApiClient
client = GLPIApiClient(username="admin", password="password")

from glpipci.comunicator.v10_0.endpoints.tickets.core import  GlpiTickets
tickets = GlpiTickets(
    api_client=client
)

response = tickets.get_tickets()

print(response.json())

Contribuição

Se você deseja contribuir para este projeto, siga estas etapas:

  1. Faça um fork do repositório.
  2. Crie uma nova branch (git checkout -b feature-branch).
  3. Faça suas alterações e commit (git commit -m 'Add some feature').
  4. Envie para o repositório remoto (git push origin feature-branch).
  5. Crie um novo Pull Request.
  6. Aguarde a revisão e feedback.

Licença

Este projeto está licenciado sob a Licença MIT. Veja o arquivo LICENSE para mais detalhes.

Extras

export PYTHONPATH=$PYTHONPATH:/home/tlsabara/repos/tlsabara/pyglpi/glpipci

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

glpipci-0.1.4rc2.tar.gz (16.4 kB view details)

Uploaded Source

Built Distribution

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

glpipci-0.1.4rc2-py3-none-any.whl (19.2 kB view details)

Uploaded Python 3

File details

Details for the file glpipci-0.1.4rc2.tar.gz.

File metadata

  • Download URL: glpipci-0.1.4rc2.tar.gz
  • Upload date:
  • Size: 16.4 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.10.12

File hashes

Hashes for glpipci-0.1.4rc2.tar.gz
Algorithm Hash digest
SHA256 3e2e9d5ec8441ed13c25d01fdcc4068e99c6471e692a64578014ec58e900f75a
MD5 b56a21d02f64163ede7f65c77662ea78
BLAKE2b-256 b5840eff3ce2a2e95b9d16646c5f2e8792ef3b08abe99ed62e280a9c9f1d9301

See more details on using hashes here.

File details

Details for the file glpipci-0.1.4rc2-py3-none-any.whl.

File metadata

  • Download URL: glpipci-0.1.4rc2-py3-none-any.whl
  • Upload date:
  • Size: 19.2 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.10.12

File hashes

Hashes for glpipci-0.1.4rc2-py3-none-any.whl
Algorithm Hash digest
SHA256 588b9bba4c0c4f3c6dc7c5bd838fd456d3e92d1a7ec0dae29d167423122d6bd2
MD5 49d493c5395e5e2b4e5c654d6774ed17
BLAKE2b-256 4ad4d4279d1446042b7270a017af4b8153a91abbf45c47d13810722a3293b1dd

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