glpi-python-client 0.1.3__tar.gz → 0.2.0__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (209) hide show
  1. glpi_python_client-0.2.0/.pre-commit-config.yaml +7 -0
  2. {glpi_python_client-0.1.3 → glpi_python_client-0.2.0}/CONTRIBUTING.md +8 -1
  3. {glpi_python_client-0.1.3 → glpi_python_client-0.2.0}/PKG-INFO +61 -34
  4. glpi_python_client-0.2.0/README.md +115 -0
  5. glpi_python_client-0.2.0/docs/api_reference.rst +325 -0
  6. {glpi_python_client-0.1.3 → glpi_python_client-0.2.0}/docs/development.md +6 -0
  7. glpi_python_client-0.2.0/docs/development_rtd.rst +84 -0
  8. glpi_python_client-0.2.0/docs/glpi_api_contract.json +188668 -0
  9. {glpi_python_client-0.1.3 → glpi_python_client-0.2.0}/docs/usage.md +153 -26
  10. glpi_python_client-0.2.0/docs/user_guide.rst +536 -0
  11. glpi_python_client-0.2.0/glpi_python_client/__init__.py +125 -0
  12. glpi_python_client-0.2.0/glpi_python_client/auth/__init__.py +13 -0
  13. glpi_python_client-0.1.3/glpi_python_client/clients/api_v1_session.py → glpi_python_client-0.2.0/glpi_python_client/auth/_v1_session.py +47 -216
  14. glpi_python_client-0.2.0/glpi_python_client/auth/tests/test_v1_session.py +283 -0
  15. glpi_python_client-0.2.0/glpi_python_client/clients/__init__.py +13 -0
  16. glpi_python_client-0.2.0/glpi_python_client/clients/api/__init__.py +40 -0
  17. glpi_python_client-0.2.0/glpi_python_client/clients/api/administration/__init__.py +12 -0
  18. glpi_python_client-0.2.0/glpi_python_client/clients/api/administration/_entity.py +172 -0
  19. glpi_python_client-0.2.0/glpi_python_client/clients/api/administration/_user.py +176 -0
  20. glpi_python_client-0.2.0/glpi_python_client/clients/api/assistance/__init__.py +8 -0
  21. glpi_python_client-0.2.0/glpi_python_client/clients/api/assistance/_team.py +121 -0
  22. glpi_python_client-0.2.0/glpi_python_client/clients/api/assistance/_ticket.py +185 -0
  23. glpi_python_client-0.2.0/glpi_python_client/clients/api/assistance/timeline/__init__.py +23 -0
  24. glpi_python_client-0.2.0/glpi_python_client/clients/api/assistance/timeline/_document.py +221 -0
  25. glpi_python_client-0.2.0/glpi_python_client/clients/api/assistance/timeline/_followup.py +203 -0
  26. glpi_python_client-0.2.0/glpi_python_client/clients/api/assistance/timeline/_solution.py +200 -0
  27. glpi_python_client-0.2.0/glpi_python_client/clients/api/assistance/timeline/_task.py +193 -0
  28. glpi_python_client-0.2.0/glpi_python_client/clients/api/dropdowns/__init__.py +7 -0
  29. glpi_python_client-0.2.0/glpi_python_client/clients/api/dropdowns/_location.py +166 -0
  30. glpi_python_client-0.2.0/glpi_python_client/clients/api/management/__init__.py +7 -0
  31. glpi_python_client-0.2.0/glpi_python_client/clients/api/management/_document.py +286 -0
  32. glpi_python_client-0.2.0/glpi_python_client/clients/commons/__init__.py +9 -0
  33. glpi_python_client-0.1.3/glpi_python_client/clients/v2/common/client_config.py → glpi_python_client-0.2.0/glpi_python_client/clients/commons/_config.py +43 -29
  34. glpi_python_client-0.2.0/glpi_python_client/clients/commons/_constants.py +50 -0
  35. glpi_python_client-0.1.3/glpi_python_client/clients/v2/common/errors.py → glpi_python_client-0.2.0/glpi_python_client/clients/commons/_errors.py +7 -3
  36. glpi_python_client-0.2.0/glpi_python_client/clients/commons/_filters.py +94 -0
  37. glpi_python_client-0.1.3/glpi_python_client/clients/v2/common/request_http.py → glpi_python_client-0.2.0/glpi_python_client/clients/commons/_http.py +88 -43
  38. glpi_python_client-0.2.0/glpi_python_client/clients/commons/_payloads.py +42 -0
  39. glpi_python_client-0.2.0/glpi_python_client/clients/commons/_transport.py +494 -0
  40. glpi_python_client-0.2.0/glpi_python_client/clients/commons/tests/__init__.py +5 -0
  41. glpi_python_client-0.2.0/glpi_python_client/clients/commons/tests/test_errors.py +41 -0
  42. glpi_python_client-0.2.0/glpi_python_client/clients/commons/tests/test_filters.py +49 -0
  43. glpi_python_client-0.2.0/glpi_python_client/clients/commons/tests/test_http.py +131 -0
  44. glpi_python_client-0.2.0/glpi_python_client/clients/commons/tests/test_payloads.py +64 -0
  45. glpi_python_client-0.2.0/glpi_python_client/clients/custom/__init__.py +15 -0
  46. glpi_python_client-0.2.0/glpi_python_client/clients/custom/_statistics.py +264 -0
  47. glpi_python_client-0.2.0/glpi_python_client/clients/custom/_ticket_context.py +66 -0
  48. glpi_python_client-0.2.0/glpi_python_client/clients/custom/tests/test_statistics.py +196 -0
  49. glpi_python_client-0.2.0/glpi_python_client/clients/glpi_client.py +262 -0
  50. glpi_python_client-0.2.0/glpi_python_client/clients/tests/__init__.py +1 -0
  51. glpi_python_client-0.2.0/glpi_python_client/clients/tests/test_api_coverage.py +707 -0
  52. glpi_python_client-0.2.0/glpi_python_client/clients/tests/test_glpi_client.py +266 -0
  53. glpi_python_client-0.2.0/glpi_python_client/clients/tests/test_smoke.py +259 -0
  54. glpi_python_client-0.2.0/glpi_python_client/models/__init__.py +139 -0
  55. glpi_python_client-0.2.0/glpi_python_client/models/_base.py +61 -0
  56. glpi_python_client-0.2.0/glpi_python_client/models/api_schema/__init__.py +16 -0
  57. glpi_python_client-0.2.0/glpi_python_client/models/api_schema/_common.py +67 -0
  58. glpi_python_client-0.2.0/glpi_python_client/models/api_schema/_content.py +74 -0
  59. glpi_python_client-0.2.0/glpi_python_client/models/api_schema/administration/__init__.py +30 -0
  60. glpi_python_client-0.2.0/glpi_python_client/models/api_schema/administration/_entity.py +55 -0
  61. glpi_python_client-0.2.0/glpi_python_client/models/api_schema/administration/_user.py +132 -0
  62. glpi_python_client-0.2.0/glpi_python_client/models/api_schema/administration/tests/__init__.py +1 -0
  63. glpi_python_client-0.2.0/glpi_python_client/models/api_schema/administration/tests/test_administration_schemas.py +114 -0
  64. glpi_python_client-0.2.0/glpi_python_client/models/api_schema/assistance/__init__.py +30 -0
  65. glpi_python_client-0.2.0/glpi_python_client/models/api_schema/assistance/_team.py +59 -0
  66. glpi_python_client-0.2.0/glpi_python_client/models/api_schema/assistance/_ticket.py +156 -0
  67. glpi_python_client-0.2.0/glpi_python_client/models/api_schema/assistance/tests/__init__.py +1 -0
  68. glpi_python_client-0.2.0/glpi_python_client/models/api_schema/assistance/tests/test_assistance_schemas.py +108 -0
  69. glpi_python_client-0.2.0/glpi_python_client/models/api_schema/assistance/tests/test_content_roundtrip.py +102 -0
  70. glpi_python_client-0.2.0/glpi_python_client/models/api_schema/assistance/timeline/__init__.py +49 -0
  71. glpi_python_client-0.2.0/glpi_python_client/models/api_schema/assistance/timeline/_document.py +60 -0
  72. glpi_python_client-0.2.0/glpi_python_client/models/api_schema/assistance/timeline/_followup.py +78 -0
  73. glpi_python_client-0.2.0/glpi_python_client/models/api_schema/assistance/timeline/_solution.py +76 -0
  74. glpi_python_client-0.2.0/glpi_python_client/models/api_schema/assistance/timeline/_task.py +97 -0
  75. glpi_python_client-0.2.0/glpi_python_client/models/api_schema/assistance/timeline/tests/__init__.py +1 -0
  76. glpi_python_client-0.2.0/glpi_python_client/models/api_schema/assistance/timeline/tests/test_timeline_schemas.py +147 -0
  77. glpi_python_client-0.2.0/glpi_python_client/models/api_schema/dropdowns/__init__.py +15 -0
  78. glpi_python_client-0.2.0/glpi_python_client/models/api_schema/dropdowns/_location.py +86 -0
  79. glpi_python_client-0.2.0/glpi_python_client/models/api_schema/dropdowns/tests/__init__.py +1 -0
  80. glpi_python_client-0.2.0/glpi_python_client/models/api_schema/dropdowns/tests/test_dropdowns_schemas.py +61 -0
  81. glpi_python_client-0.2.0/glpi_python_client/models/api_schema/enums.py +156 -0
  82. glpi_python_client-0.2.0/glpi_python_client/models/api_schema/management/__init__.py +15 -0
  83. glpi_python_client-0.2.0/glpi_python_client/models/api_schema/management/_document.py +67 -0
  84. glpi_python_client-0.2.0/glpi_python_client/models/api_schema/management/tests/__init__.py +1 -0
  85. glpi_python_client-0.2.0/glpi_python_client/models/api_schema/management/tests/test_management_schemas.py +50 -0
  86. glpi_python_client-0.2.0/glpi_python_client/models/custom_schema/__init__.py +13 -0
  87. glpi_python_client-0.2.0/glpi_python_client/models/custom_schema/_ticket_context.py +53 -0
  88. glpi_python_client-0.2.0/glpi_python_client/models/custom_schema/tests/__init__.py +1 -0
  89. glpi_python_client-0.2.0/glpi_python_client/models/custom_schema/tests/test_ticket_context.py +40 -0
  90. {glpi_python_client-0.1.3 → glpi_python_client-0.2.0}/glpi_python_client/testing/__init__.py +0 -4
  91. glpi_python_client-0.2.0/glpi_python_client/testing/fixtures.py +26 -0
  92. {glpi_python_client-0.1.3 → glpi_python_client-0.2.0}/glpi_python_client/testing/utils.py +1 -42
  93. {glpi_python_client-0.1.3 → glpi_python_client-0.2.0}/pyproject.toml +26 -1
  94. glpi_python_client-0.2.0/skills/README.md +19 -0
  95. glpi_python_client-0.2.0/skills/glpi-client-setup/SKILL.md +90 -0
  96. glpi_python_client-0.2.0/skills/glpi-document-workflow/SKILL.md +71 -0
  97. glpi_python_client-0.2.0/skills/glpi-reporting-and-context/SKILL.md +71 -0
  98. glpi_python_client-0.2.0/skills/glpi-team-members/SKILL.md +61 -0
  99. glpi_python_client-0.2.0/skills/glpi-ticket-timeline/SKILL.md +71 -0
  100. glpi_python_client-0.2.0/skills/glpi-ticket-workflow/SKILL.md +75 -0
  101. glpi_python_client-0.2.0/skills/glpi-user-location-provisioning/SKILL.md +76 -0
  102. glpi_python_client-0.1.3/README.md +0 -92
  103. glpi_python_client-0.1.3/docs/api_reference.rst +0 -76
  104. glpi_python_client-0.1.3/docs/development_rtd.rst +0 -61
  105. glpi_python_client-0.1.3/docs/user_guide.rst +0 -438
  106. glpi_python_client-0.1.3/glpi_python_client/__init__.py +0 -36
  107. glpi_python_client-0.1.3/glpi_python_client/auth/__init__.py +0 -11
  108. glpi_python_client-0.1.3/glpi_python_client/clients/__init__.py +0 -18
  109. glpi_python_client-0.1.3/glpi_python_client/clients/api_v2_client.py +0 -317
  110. glpi_python_client-0.1.3/glpi_python_client/clients/async_api_v2_client.py +0 -236
  111. glpi_python_client-0.1.3/glpi_python_client/clients/tests/__init__.py +0 -5
  112. glpi_python_client-0.1.3/glpi_python_client/clients/tests/test_api_v1_session.py +0 -85
  113. glpi_python_client-0.1.3/glpi_python_client/clients/tests/test_api_v2_client.py +0 -349
  114. glpi_python_client-0.1.3/glpi_python_client/clients/tests/test_async_api_v2_client.py +0 -257
  115. glpi_python_client-0.1.3/glpi_python_client/clients/v2/__init__.py +0 -8
  116. glpi_python_client-0.1.3/glpi_python_client/clients/v2/async_/__init__.py +0 -12
  117. glpi_python_client-0.1.3/glpi_python_client/clients/v2/async_/api.py +0 -29
  118. glpi_python_client-0.1.3/glpi_python_client/clients/v2/async_/directory.py +0 -88
  119. glpi_python_client-0.1.3/glpi_python_client/clients/v2/async_/documents.py +0 -144
  120. glpi_python_client-0.1.3/glpi_python_client/clients/v2/async_/team.py +0 -125
  121. glpi_python_client-0.1.3/glpi_python_client/clients/v2/async_/tests/__init__.py +0 -5
  122. glpi_python_client-0.1.3/glpi_python_client/clients/v2/async_/tests/test_directory.py +0 -43
  123. glpi_python_client-0.1.3/glpi_python_client/clients/v2/async_/tests/test_documents.py +0 -41
  124. glpi_python_client-0.1.3/glpi_python_client/clients/v2/async_/tests/test_team.py +0 -44
  125. glpi_python_client-0.1.3/glpi_python_client/clients/v2/async_/tests/test_tickets.py +0 -174
  126. glpi_python_client-0.1.3/glpi_python_client/clients/v2/async_/tests/test_timeline.py +0 -126
  127. glpi_python_client-0.1.3/glpi_python_client/clients/v2/async_/tickets.py +0 -312
  128. glpi_python_client-0.1.3/glpi_python_client/clients/v2/async_/timeline.py +0 -312
  129. glpi_python_client-0.1.3/glpi_python_client/clients/v2/async_/transport.py +0 -251
  130. glpi_python_client-0.1.3/glpi_python_client/clients/v2/common/__init__.py +0 -6
  131. glpi_python_client-0.1.3/glpi_python_client/clients/v2/common/constants.py +0 -45
  132. glpi_python_client-0.1.3/glpi_python_client/clients/v2/common/filters.py +0 -30
  133. glpi_python_client-0.1.3/glpi_python_client/clients/v2/common/payloads.py +0 -57
  134. glpi_python_client-0.1.3/glpi_python_client/clients/v2/common/response_payloads.py +0 -76
  135. glpi_python_client-0.1.3/glpi_python_client/clients/v2/common/ticket_search.py +0 -113
  136. glpi_python_client-0.1.3/glpi_python_client/clients/v2/sync/__init__.py +0 -12
  137. glpi_python_client-0.1.3/glpi_python_client/clients/v2/sync/api.py +0 -29
  138. glpi_python_client-0.1.3/glpi_python_client/clients/v2/sync/directory.py +0 -90
  139. glpi_python_client-0.1.3/glpi_python_client/clients/v2/sync/documents.py +0 -144
  140. glpi_python_client-0.1.3/glpi_python_client/clients/v2/sync/team.py +0 -125
  141. glpi_python_client-0.1.3/glpi_python_client/clients/v2/sync/tests/__init__.py +0 -5
  142. glpi_python_client-0.1.3/glpi_python_client/clients/v2/sync/tests/test_directory.py +0 -57
  143. glpi_python_client-0.1.3/glpi_python_client/clients/v2/sync/tests/test_documents.py +0 -99
  144. glpi_python_client-0.1.3/glpi_python_client/clients/v2/sync/tests/test_team.py +0 -64
  145. glpi_python_client-0.1.3/glpi_python_client/clients/v2/sync/tests/test_tickets.py +0 -430
  146. glpi_python_client-0.1.3/glpi_python_client/clients/v2/sync/tests/test_timeline.py +0 -77
  147. glpi_python_client-0.1.3/glpi_python_client/clients/v2/sync/tests/test_transport.py +0 -89
  148. glpi_python_client-0.1.3/glpi_python_client/clients/v2/sync/tickets.py +0 -312
  149. glpi_python_client-0.1.3/glpi_python_client/clients/v2/sync/timeline.py +0 -308
  150. glpi_python_client-0.1.3/glpi_python_client/clients/v2/sync/transport.py +0 -246
  151. glpi_python_client-0.1.3/glpi_python_client/content/records/__init__.py +0 -84
  152. glpi_python_client-0.1.3/glpi_python_client/content/records/core/__init__.py +0 -6
  153. glpi_python_client-0.1.3/glpi_python_client/content/records/core/document_links.py +0 -100
  154. glpi_python_client-0.1.3/glpi_python_client/content/records/core/normalization.py +0 -53
  155. glpi_python_client-0.1.3/glpi_python_client/content/records/core/references.py +0 -98
  156. glpi_python_client-0.1.3/glpi_python_client/content/records/core/scalars.py +0 -83
  157. glpi_python_client-0.1.3/glpi_python_client/content/records/parsers/__init__.py +0 -6
  158. glpi_python_client-0.1.3/glpi_python_client/content/records/parsers/directory.py +0 -62
  159. glpi_python_client-0.1.3/glpi_python_client/content/records/parsers/documents.py +0 -49
  160. glpi_python_client-0.1.3/glpi_python_client/content/records/parsers/team.py +0 -58
  161. glpi_python_client-0.1.3/glpi_python_client/content/records/parsers/tests/__init__.py +0 -5
  162. glpi_python_client-0.1.3/glpi_python_client/content/records/parsers/tests/test_tickets.py +0 -35
  163. glpi_python_client-0.1.3/glpi_python_client/content/records/parsers/tests/test_timeline.py +0 -20
  164. glpi_python_client-0.1.3/glpi_python_client/content/records/parsers/tickets.py +0 -96
  165. glpi_python_client-0.1.3/glpi_python_client/content/records/parsers/timeline.py +0 -119
  166. glpi_python_client-0.1.3/glpi_python_client/models/__init__.py +0 -30
  167. glpi_python_client-0.1.3/glpi_python_client/models/_base.py +0 -22
  168. glpi_python_client-0.1.3/glpi_python_client/models/_payload.py +0 -79
  169. glpi_python_client-0.1.3/glpi_python_client/models/_shared.py +0 -37
  170. glpi_python_client-0.1.3/glpi_python_client/models/glpi/__init__.py +0 -27
  171. glpi_python_client-0.1.3/glpi_python_client/models/glpi/_document.py +0 -59
  172. glpi_python_client-0.1.3/glpi_python_client/models/glpi/_followup.py +0 -77
  173. glpi_python_client-0.1.3/glpi_python_client/models/glpi/_location.py +0 -53
  174. glpi_python_client-0.1.3/glpi_python_client/models/glpi/_solution.py +0 -57
  175. glpi_python_client-0.1.3/glpi_python_client/models/glpi/_task.py +0 -41
  176. glpi_python_client-0.1.3/glpi_python_client/models/glpi/_team_member.py +0 -33
  177. glpi_python_client-0.1.3/glpi_python_client/models/glpi/_ticket.py +0 -303
  178. glpi_python_client-0.1.3/glpi_python_client/models/glpi/_user.py +0 -92
  179. glpi_python_client-0.1.3/glpi_python_client/models/glpi/tests/__init__.py +0 -5
  180. glpi_python_client-0.1.3/glpi_python_client/models/glpi/tests/test__document.py +0 -12
  181. glpi_python_client-0.1.3/glpi_python_client/models/glpi/tests/test__followup.py +0 -31
  182. glpi_python_client-0.1.3/glpi_python_client/models/glpi/tests/test__location.py +0 -12
  183. glpi_python_client-0.1.3/glpi_python_client/models/glpi/tests/test__solution.py +0 -11
  184. glpi_python_client-0.1.3/glpi_python_client/models/glpi/tests/test__ticket.py +0 -59
  185. glpi_python_client-0.1.3/glpi_python_client/models/glpi/tests/test__user.py +0 -29
  186. glpi_python_client-0.1.3/glpi_python_client/testing/fixtures.py +0 -52
  187. glpi_python_client-0.1.3/skills/README.md +0 -25
  188. glpi_python_client-0.1.3/skills/glpi-client-setup/SKILL.md +0 -96
  189. glpi_python_client-0.1.3/skills/glpi-document-workflow/SKILL.md +0 -90
  190. glpi_python_client-0.1.3/skills/glpi-team-members/SKILL.md +0 -63
  191. glpi_python_client-0.1.3/skills/glpi-ticket-timeline/SKILL.md +0 -88
  192. glpi_python_client-0.1.3/skills/glpi-ticket-workflow/SKILL.md +0 -92
  193. glpi_python_client-0.1.3/skills/glpi-user-location-provisioning/SKILL.md +0 -75
  194. {glpi_python_client-0.1.3 → glpi_python_client-0.2.0}/.gitignore +0 -0
  195. {glpi_python_client-0.1.3 → glpi_python_client-0.2.0}/.readthedocs.yaml +0 -0
  196. {glpi_python_client-0.1.3 → glpi_python_client-0.2.0}/LICENSE +0 -0
  197. {glpi_python_client-0.1.3 → glpi_python_client-0.2.0}/docs/_static/.gitkeep +0 -0
  198. {glpi_python_client-0.1.3 → glpi_python_client-0.2.0}/docs/conf.py +0 -0
  199. {glpi_python_client-0.1.3 → glpi_python_client-0.2.0}/docs/index.rst +0 -0
  200. {glpi_python_client-0.1.3 → glpi_python_client-0.2.0}/docs/installation.rst +0 -0
  201. {glpi_python_client-0.1.3 → glpi_python_client-0.2.0}/docs/publishing.md +0 -0
  202. {glpi_python_client-0.1.3 → glpi_python_client-0.2.0}/docs/publishing_rtd.rst +0 -0
  203. {glpi_python_client-0.1.3 → glpi_python_client-0.2.0}/glpi_python_client/auth/auth.py +0 -0
  204. {glpi_python_client-0.1.3 → glpi_python_client-0.2.0}/glpi_python_client/auth/tests/test_auth.py +0 -0
  205. {glpi_python_client-0.1.3 → glpi_python_client-0.2.0}/glpi_python_client/content/__init__.py +0 -0
  206. {glpi_python_client-0.1.3 → glpi_python_client-0.2.0}/glpi_python_client/content/conversion.py +0 -0
  207. {glpi_python_client-0.1.3 → glpi_python_client-0.2.0}/glpi_python_client/content/tests/__init__.py +0 -0
  208. {glpi_python_client-0.1.3 → glpi_python_client-0.2.0}/glpi_python_client/content/tests/test_conversion.py +0 -0
  209. {glpi_python_client-0.1.3 → glpi_python_client-0.2.0}/glpi_python_client/py.typed +0 -0
@@ -0,0 +1,7 @@
1
+ repos:
2
+ - repo: https://github.com/astral-sh/ruff-pre-commit
3
+ rev: v0.15.13
4
+ hooks:
5
+ - id: ruff-check
6
+ args: [--fix]
7
+ - id: ruff-format
@@ -8,14 +8,21 @@ Thank you for improving `glpi-python-client`.
8
8
  python -m venv .venv
9
9
  .venv\Scripts\activate
10
10
  python -m pip install -e .[dev]
11
+ python -m pre_commit install
12
+ python -m pre_commit run --all-files
11
13
  python -m pytest
12
14
  ```
13
15
 
16
+ The repository ships a root `.pre-commit-config.yaml` that runs Ruff on each
17
+ commit. The lint hook applies safe fixes first, then Ruff formats the touched
18
+ files.
19
+
14
20
  ## Quality Checks
15
21
 
16
22
  Run the focused checks before opening a pull request:
17
23
 
18
24
  ```bash
25
+ python -m pre_commit run --all-files
19
26
  python -m pytest
20
27
  python -m ruff check .
21
28
  python -m mypy glpi_python_client
@@ -26,7 +33,7 @@ python -m mypy glpi_python_client
26
33
  To build the documentation locally:
27
34
 
28
35
  ```bash
29
- python -m sphinx -W --keep-going -b html docs docs/_build/html pa
36
+ python -m sphinx -W --keep-going -b html docs docs/_build/html
30
37
  ```
31
38
 
32
39
  ## GitHub Actions
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: glpi-python-client
3
- Version: 0.1.3
3
+ Version: 0.2.0
4
4
  Summary: A typed Python client for GLPI ITSM APIs.
5
5
  Project-URL: Homepage, https://github.com/baraline/glpi_python_client
6
6
  Project-URL: Documentation, https://glpi-python-client.readthedocs.io/en/latest/
@@ -30,11 +30,15 @@ Requires-Dist: markdownify>=0.13
30
30
  Requires-Dist: pydantic>=2.8
31
31
  Requires-Dist: requests>=2.31
32
32
  Requires-Dist: tenacity>=8.2
33
+ Requires-Dist: typing-extensions>=4.7; python_version < '3.11'
33
34
  Requires-Dist: urllib3>=2.0
34
35
  Provides-Extra: dev
35
36
  Requires-Dist: build>=1.2; extra == 'dev'
36
37
  Requires-Dist: mypy>=1.11; extra == 'dev'
37
38
  Requires-Dist: numpydoc>=1.8; extra == 'dev'
39
+ Requires-Dist: pre-commit>=4.0; extra == 'dev'
40
+ Requires-Dist: pytest-asyncio>=0.23; extra == 'dev'
41
+ Requires-Dist: pytest-cov>=5.0; extra == 'dev'
38
42
  Requires-Dist: pytest>=8.0; extra == 'dev'
39
43
  Requires-Dist: ruff>=0.6; extra == 'dev'
40
44
  Requires-Dist: sphinx-rtd-theme>=2.0; extra == 'dev'
@@ -53,6 +57,7 @@ Description-Content-Type: text/markdown
53
57
  # glpi-python-client
54
58
 
55
59
  [![CI](https://github.com/baraline/glpi_python_client/actions/workflows/ci.yml/badge.svg?branch=main)](https://github.com/baraline/glpi_python_client/actions/workflows/ci.yml)
60
+ [![Coverage](https://codecov.io/gh/baraline/glpi_python_client/branch/main/graph/badge.svg)](https://codecov.io/gh/baraline/glpi_python_client)
56
61
  [![License](https://img.shields.io/github/license/baraline/glpi_python_client)](LICENSE)
57
62
  [![Python](https://img.shields.io/badge/python-3.10%2B-blue)](https://github.com/baraline/glpi_python_client)
58
63
  [![Docs](https://readthedocs.org/projects/glpi-python-client/badge/?version=latest)](https://glpi-python-client.readthedocs.io/en/latest/)
@@ -65,8 +70,10 @@ followups, documents, locations, and related records, while converting GLPI
65
70
  HTML content into Markdown for Python-side workflows and rendering Markdown
66
71
  back to HTML for outgoing payloads.
67
72
 
68
- It currently focuses on ticket-centric workflows and exposes matching sync and
69
- async high-level clients.
73
+ It currently focuses on ticket-centric workflows and exposes a single
74
+ asynchronous high-level client built on top of the GLPI v2 REST API.
75
+
76
+ While the package is preparing for 1.0, alot of potential breaking change might happen between versions. A deprecation policy will be put in place once 1.0 is out and the package have been stabilized.
70
77
 
71
78
  ## Installation
72
79
 
@@ -83,51 +90,71 @@ python -m pytest
83
90
 
84
91
  ## Quick Start
85
92
 
86
- Create a client with your GLPI API URL and at least one complete auth pair:
93
+ Create a client with your GLPI v2 API URL and at least one complete auth pair:
87
94
 
88
95
  - `client_id` and `client_secret`
89
96
  - `username` and `password`
90
97
  - both pairs together
91
98
 
92
99
  ```python
93
- from glpi_python_client import GlpiClient, GlpiTicket
94
-
95
- with GlpiClient(
96
- glpi_api_url="https://glpi.example.com/api.php",
97
- client_id="oauth-client-id",
98
- client_secret="oauth-client-secret",
99
- username="api-user",
100
- password="api-password",
101
- ) as glpi:
102
- ticket_id = glpi.create_ticket(
103
- GlpiTicket(
104
- name="Printer issue",
105
- content="The printer is not reachable from the office network.",
106
- urgency=3,
107
- impact=3,
100
+ import asyncio
101
+
102
+ from glpi_python_client import GlpiClient, PostTicket
103
+
104
+
105
+ async def main() -> None:
106
+ async with GlpiClient(
107
+ glpi_api_url="https://glpi.example.com/api.php/v2",
108
+ client_id="oauth-client-id",
109
+ client_secret="oauth-client-secret",
110
+ username="api-user",
111
+ password="api-password",
112
+ ) as glpi:
113
+ ticket_id = await glpi.create_ticket(
114
+ PostTicket(
115
+ name="Printer issue",
116
+ content="The printer is not reachable from the office network.",
117
+ )
108
118
  )
109
- )
110
- ticket = glpi.get_ticket_record(ticket_id)
119
+ ticket = await glpi.get_ticket(ticket_id)
120
+ print(ticket.id, ticket.name)
121
+
111
122
 
112
- print(ticket.id)
113
- print(ticket.content)
123
+ asyncio.run(main())
114
124
  ```
115
125
 
116
- Async code uses the same model layer and nearly the same API surface:
126
+ If your application already provides `GLPI_` environment variables,
127
+ `GlpiClient.from_env()` is also available.
128
+
129
+ ### Calling from synchronous code
130
+
131
+ The client is async-only, but it works from sync programs through
132
+ `asyncio.run`. Wrap the calls in a coroutine and execute it once:
117
133
 
118
134
  ```python
119
- from glpi_python_client import AsyncGlpiClient
120
-
121
- async with AsyncGlpiClient(
122
- glpi_api_url="https://glpi.example.com/api.php",
123
- client_id="oauth-client-id",
124
- client_secret="oauth-client-secret",
125
- ) as glpi:
126
- tickets = await glpi.search_ticket_records(query='status.id=in=(1,2)')
135
+ import asyncio
136
+
137
+ from glpi_python_client import GlpiClient
138
+
139
+
140
+ def fetch_open_tickets() -> list[int]:
141
+ async def _run() -> list[int]:
142
+ async with GlpiClient.from_env() as glpi:
143
+ tickets = await glpi.search_tickets("status==1", limit=10)
144
+ return [ticket.id for ticket in tickets]
145
+
146
+ return asyncio.run(_run())
147
+
148
+
149
+ if __name__ == "__main__":
150
+ print(fetch_open_tickets())
127
151
  ```
128
152
 
129
- If your application already provides `GLPI_` environment variables,
130
- `GlpiClient.from_env()` and `AsyncGlpiClient.from_env()` are also available.
153
+ For long-lived sync services that need many calls, run a dedicated
154
+ event loop on a background thread and dispatch with
155
+ `asyncio.run_coroutine_threadsafe`. See the
156
+ [user guide](https://glpi-python-client.readthedocs.io/en/latest/user_guide.html#calling-the-client-from-synchronous-code)
157
+ for the full pattern.
131
158
 
132
159
  ## Documentation
133
160
 
@@ -0,0 +1,115 @@
1
+ # glpi-python-client
2
+
3
+ [![CI](https://github.com/baraline/glpi_python_client/actions/workflows/ci.yml/badge.svg?branch=main)](https://github.com/baraline/glpi_python_client/actions/workflows/ci.yml)
4
+ [![Coverage](https://codecov.io/gh/baraline/glpi_python_client/branch/main/graph/badge.svg)](https://codecov.io/gh/baraline/glpi_python_client)
5
+ [![License](https://img.shields.io/github/license/baraline/glpi_python_client)](LICENSE)
6
+ [![Python](https://img.shields.io/badge/python-3.10%2B-blue)](https://github.com/baraline/glpi_python_client)
7
+ [![Docs](https://readthedocs.org/projects/glpi-python-client/badge/?version=latest)](https://glpi-python-client.readthedocs.io/en/latest/)
8
+
9
+ `glpi-python-client` is a typed Python client for GLPI ITSM APIs.
10
+
11
+ The goal is to let GLPI integrations work with domain objects instead of raw
12
+ JSON payloads. The package exposes Pydantic models for tickets, users,
13
+ followups, documents, locations, and related records, while converting GLPI
14
+ HTML content into Markdown for Python-side workflows and rendering Markdown
15
+ back to HTML for outgoing payloads.
16
+
17
+ It currently focuses on ticket-centric workflows and exposes a single
18
+ asynchronous high-level client built on top of the GLPI v2 REST API.
19
+
20
+ While the package is preparing for 1.0, alot of potential breaking change might happen between versions. A deprecation policy will be put in place once 1.0 is out and the package have been stabilized.
21
+
22
+ ## Installation
23
+
24
+ ```bash
25
+ pip install glpi-python-client
26
+ ```
27
+
28
+ For local development:
29
+
30
+ ```bash
31
+ python -m pip install -e .[dev]
32
+ python -m pytest
33
+ ```
34
+
35
+ ## Quick Start
36
+
37
+ Create a client with your GLPI v2 API URL and at least one complete auth pair:
38
+
39
+ - `client_id` and `client_secret`
40
+ - `username` and `password`
41
+ - both pairs together
42
+
43
+ ```python
44
+ import asyncio
45
+
46
+ from glpi_python_client import GlpiClient, PostTicket
47
+
48
+
49
+ async def main() -> None:
50
+ async with GlpiClient(
51
+ glpi_api_url="https://glpi.example.com/api.php/v2",
52
+ client_id="oauth-client-id",
53
+ client_secret="oauth-client-secret",
54
+ username="api-user",
55
+ password="api-password",
56
+ ) as glpi:
57
+ ticket_id = await glpi.create_ticket(
58
+ PostTicket(
59
+ name="Printer issue",
60
+ content="The printer is not reachable from the office network.",
61
+ )
62
+ )
63
+ ticket = await glpi.get_ticket(ticket_id)
64
+ print(ticket.id, ticket.name)
65
+
66
+
67
+ asyncio.run(main())
68
+ ```
69
+
70
+ If your application already provides `GLPI_` environment variables,
71
+ `GlpiClient.from_env()` is also available.
72
+
73
+ ### Calling from synchronous code
74
+
75
+ The client is async-only, but it works from sync programs through
76
+ `asyncio.run`. Wrap the calls in a coroutine and execute it once:
77
+
78
+ ```python
79
+ import asyncio
80
+
81
+ from glpi_python_client import GlpiClient
82
+
83
+
84
+ def fetch_open_tickets() -> list[int]:
85
+ async def _run() -> list[int]:
86
+ async with GlpiClient.from_env() as glpi:
87
+ tickets = await glpi.search_tickets("status==1", limit=10)
88
+ return [ticket.id for ticket in tickets]
89
+
90
+ return asyncio.run(_run())
91
+
92
+
93
+ if __name__ == "__main__":
94
+ print(fetch_open_tickets())
95
+ ```
96
+
97
+ For long-lived sync services that need many calls, run a dedicated
98
+ event loop on a background thread and dispatch with
99
+ `asyncio.run_coroutine_threadsafe`. See the
100
+ [user guide](https://glpi-python-client.readthedocs.io/en/latest/user_guide.html#calling-the-client-from-synchronous-code)
101
+ for the full pattern.
102
+
103
+ ## Documentation
104
+
105
+ - [Hosted documentation](https://glpi-python-client.readthedocs.io/en/latest/)
106
+ - [API reference](https://glpi-python-client.readthedocs.io/en/latest/api_reference.html)
107
+ - [Installation guide](https://glpi-python-client.readthedocs.io/en/latest/installation.html)
108
+ - [Development guide](https://glpi-python-client.readthedocs.io/en/latest/development_rtd.html)
109
+
110
+ To build the Sphinx documentation locally:
111
+
112
+ ```bash
113
+ python -m pip install -e .[docs]
114
+ python -m sphinx -b html docs docs/_build/html
115
+ ```
@@ -0,0 +1,325 @@
1
+ API Reference
2
+ =============
3
+
4
+ This reference documents the public package surface exported by
5
+ ``glpi_python_client``. Internal implementation modules and
6
+ underscore-prefixed helpers are intentionally omitted.
7
+
8
+ .. currentmodule:: glpi_python_client
9
+
10
+ Client
11
+ ------
12
+
13
+ .. autoclass:: GlpiClient
14
+ :members:
15
+ :inherited-members:
16
+ :show-inheritance:
17
+
18
+ Aggregated Models
19
+ -----------------
20
+
21
+ .. autoclass:: GlpiTicketContext
22
+ :members:
23
+ :undoc-members:
24
+ :show-inheritance:
25
+
26
+ Common Reference Models
27
+ -----------------------
28
+
29
+ .. autoclass:: IdRef
30
+ :members:
31
+ :undoc-members:
32
+ :show-inheritance:
33
+
34
+ .. autoclass:: IdNameRef
35
+ :members:
36
+ :undoc-members:
37
+ :show-inheritance:
38
+
39
+ .. autoclass:: IdNameCompletenameRef
40
+ :members:
41
+ :undoc-members:
42
+ :show-inheritance:
43
+
44
+ Tickets
45
+ -------
46
+
47
+ .. autoclass:: GetTicket
48
+ :members:
49
+ :undoc-members:
50
+ :show-inheritance:
51
+
52
+ .. autoclass:: PostTicket
53
+ :members:
54
+ :undoc-members:
55
+ :show-inheritance:
56
+
57
+ .. autoclass:: PatchTicket
58
+ :members:
59
+ :undoc-members:
60
+ :show-inheritance:
61
+
62
+ .. autoclass:: DeleteTicket
63
+ :members:
64
+ :undoc-members:
65
+ :show-inheritance:
66
+
67
+ Ticket Timeline — Followups
68
+ ---------------------------
69
+
70
+ .. autoclass:: GetFollowup
71
+ :members:
72
+ :undoc-members:
73
+ :show-inheritance:
74
+
75
+ .. autoclass:: PostFollowup
76
+ :members:
77
+ :undoc-members:
78
+ :show-inheritance:
79
+
80
+ .. autoclass:: PatchFollowup
81
+ :members:
82
+ :undoc-members:
83
+ :show-inheritance:
84
+
85
+ .. autoclass:: DeleteFollowup
86
+ :members:
87
+ :undoc-members:
88
+ :show-inheritance:
89
+
90
+ Ticket Timeline — Tasks
91
+ -----------------------
92
+
93
+ .. autoclass:: GetTicketTask
94
+ :members:
95
+ :undoc-members:
96
+ :show-inheritance:
97
+
98
+ .. autoclass:: PostTicketTask
99
+ :members:
100
+ :undoc-members:
101
+ :show-inheritance:
102
+
103
+ .. autoclass:: PatchTicketTask
104
+ :members:
105
+ :undoc-members:
106
+ :show-inheritance:
107
+
108
+ .. autoclass:: DeleteTicketTask
109
+ :members:
110
+ :undoc-members:
111
+ :show-inheritance:
112
+
113
+ Ticket Timeline — Solutions
114
+ ---------------------------
115
+
116
+ .. autoclass:: GetSolution
117
+ :members:
118
+ :undoc-members:
119
+ :show-inheritance:
120
+
121
+ .. autoclass:: PostSolution
122
+ :members:
123
+ :undoc-members:
124
+ :show-inheritance:
125
+
126
+ .. autoclass:: PatchSolution
127
+ :members:
128
+ :undoc-members:
129
+ :show-inheritance:
130
+
131
+ .. autoclass:: DeleteSolution
132
+ :members:
133
+ :undoc-members:
134
+ :show-inheritance:
135
+
136
+ Ticket Timeline — Documents
137
+ ---------------------------
138
+
139
+ .. autoclass:: GetTimelineDocument
140
+ :members:
141
+ :undoc-members:
142
+ :show-inheritance:
143
+
144
+ .. autoclass:: PostTimelineDocument
145
+ :members:
146
+ :undoc-members:
147
+ :show-inheritance:
148
+
149
+ .. autoclass:: PatchTimelineDocument
150
+ :members:
151
+ :undoc-members:
152
+ :show-inheritance:
153
+
154
+ .. autoclass:: DeleteTimelineDocument
155
+ :members:
156
+ :undoc-members:
157
+ :show-inheritance:
158
+
159
+ Ticket Team Members
160
+ -------------------
161
+
162
+ .. autoclass:: GetTeamMember
163
+ :members:
164
+ :undoc-members:
165
+ :show-inheritance:
166
+
167
+ .. autoclass:: PostTeamMember
168
+ :members:
169
+ :undoc-members:
170
+ :show-inheritance:
171
+
172
+ .. autoclass:: PatchTeamMember
173
+ :members:
174
+ :undoc-members:
175
+ :show-inheritance:
176
+
177
+ .. autoclass:: DeleteTeamMember
178
+ :members:
179
+ :undoc-members:
180
+ :show-inheritance:
181
+
182
+ Documents
183
+ ---------
184
+
185
+ .. autoclass:: GetDocument
186
+ :members:
187
+ :undoc-members:
188
+ :show-inheritance:
189
+
190
+ .. autoclass:: PostDocument
191
+ :members:
192
+ :undoc-members:
193
+ :show-inheritance:
194
+
195
+ .. autoclass:: PatchDocument
196
+ :members:
197
+ :undoc-members:
198
+ :show-inheritance:
199
+
200
+ .. autoclass:: DeleteDocument
201
+ :members:
202
+ :undoc-members:
203
+ :show-inheritance:
204
+
205
+ Users
206
+ -----
207
+
208
+ .. autoclass:: GetUser
209
+ :members:
210
+ :undoc-members:
211
+ :show-inheritance:
212
+
213
+ .. autoclass:: PostUser
214
+ :members:
215
+ :undoc-members:
216
+ :show-inheritance:
217
+
218
+ .. autoclass:: PatchUser
219
+ :members:
220
+ :undoc-members:
221
+ :show-inheritance:
222
+
223
+ .. autoclass:: DeleteUser
224
+ :members:
225
+ :undoc-members:
226
+ :show-inheritance:
227
+
228
+ Locations
229
+ ---------
230
+
231
+ .. autoclass:: GetLocation
232
+ :members:
233
+ :undoc-members:
234
+ :show-inheritance:
235
+
236
+ .. autoclass:: PostLocation
237
+ :members:
238
+ :undoc-members:
239
+ :show-inheritance:
240
+
241
+ .. autoclass:: PatchLocation
242
+ :members:
243
+ :undoc-members:
244
+ :show-inheritance:
245
+
246
+ .. autoclass:: DeleteLocation
247
+ :members:
248
+ :undoc-members:
249
+ :show-inheritance:
250
+
251
+ Entities
252
+ --------
253
+
254
+ .. autoclass:: GetEntity
255
+ :members:
256
+ :undoc-members:
257
+ :show-inheritance:
258
+
259
+ .. autoclass:: PostEntity
260
+ :members:
261
+ :undoc-members:
262
+ :show-inheritance:
263
+
264
+ .. autoclass:: PatchEntity
265
+ :members:
266
+ :undoc-members:
267
+ :show-inheritance:
268
+
269
+ .. autoclass:: DeleteEntity
270
+ :members:
271
+ :undoc-members:
272
+ :show-inheritance:
273
+
274
+ Enums
275
+ -----
276
+
277
+ .. autoclass:: GlpiEnum
278
+ :members:
279
+ :undoc-members:
280
+ :show-inheritance:
281
+
282
+ .. autoclass:: GlpiTicketStatus
283
+ :members:
284
+ :undoc-members:
285
+ :show-inheritance:
286
+
287
+ .. autoclass:: GlpiTicketType
288
+ :members:
289
+ :undoc-members:
290
+ :show-inheritance:
291
+
292
+ .. autoclass:: GlpiPriority
293
+ :members:
294
+ :undoc-members:
295
+ :show-inheritance:
296
+
297
+ .. autoclass:: GlpiTaskState
298
+ :members:
299
+ :undoc-members:
300
+ :show-inheritance:
301
+
302
+ .. autoclass:: GlpiSolutionStatus
303
+ :members:
304
+ :undoc-members:
305
+ :show-inheritance:
306
+
307
+ .. autoclass:: GlpiTimelinePosition
308
+ :members:
309
+ :undoc-members:
310
+ :show-inheritance:
311
+
312
+ .. autoclass:: GlpiUserAuthType
313
+ :members:
314
+ :undoc-members:
315
+ :show-inheritance:
316
+
317
+ .. autoclass:: GlpiGlobalValidation
318
+ :members:
319
+ :undoc-members:
320
+ :show-inheritance:
321
+
322
+ Package Metadata
323
+ ----------------
324
+
325
+ .. autodata:: __version__
@@ -9,13 +9,19 @@ python -m venv .venv
9
9
  .venv\Scripts\activate
10
10
  python -m pip install --upgrade pip
11
11
  python -m pip install -e .[dev]
12
+ python -m pre_commit install
12
13
  ```
13
14
 
15
+ The repository ships a root `.pre-commit-config.yaml` that runs Ruff on each
16
+ commit. The lint hook applies safe fixes first, then Ruff formats the touched
17
+ files.
18
+
14
19
  ## Checks
15
20
 
16
21
  Run these before publishing or opening a pull request:
17
22
 
18
23
  ```bash
24
+ python -m pre_commit run --all-files
19
25
  python -m pytest
20
26
  python -m ruff check .
21
27
  python -m mypy glpi_python_client