pydiagral 1.2.0__tar.gz → 1.2.0b1__tar.gz

Sign up to get free protection for your applications and to get access to all the features.
Files changed (43) hide show
  1. {pydiagral-1.2.0 → pydiagral-1.2.0b1}/.github/workflows/release_and_doc.yaml +5 -6
  2. {pydiagral-1.2.0 → pydiagral-1.2.0b1}/.releaserc +0 -1
  3. pydiagral-1.2.0b1/CHANGELOG.md +22 -0
  4. {pydiagral-1.2.0 → pydiagral-1.2.0b1}/PKG-INFO +1 -1
  5. {pydiagral-1.2.0 → pydiagral-1.2.0b1}/docs/api.md +4 -4
  6. pydiagral-1.2.0b1/docs/exceptions.md +12 -0
  7. {pydiagral-1.2.0 → pydiagral-1.2.0b1}/docs/index.md +3 -1
  8. pydiagral-1.2.0b1/docs/models.md +11 -0
  9. pydiagral-1.2.0b1/release-upgrade +1 -0
  10. {pydiagral-1.2.0 → pydiagral-1.2.0b1}/src/pydiagral/api.py +12 -9
  11. {pydiagral-1.2.0 → pydiagral-1.2.0b1}/src/pydiagral/models.py +2 -2
  12. pydiagral-1.2.0/CHANGELOG.md +0 -55
  13. pydiagral-1.2.0/docs/exceptions.md +0 -18
  14. pydiagral-1.2.0/docs/models.md +0 -16
  15. pydiagral-1.2.0/test.txt +0 -1
  16. {pydiagral-1.2.0 → pydiagral-1.2.0b1}/.devcontainer/Dockerfile.dev +0 -0
  17. {pydiagral-1.2.0 → pydiagral-1.2.0b1}/.devcontainer/devcontainer.json +0 -0
  18. {pydiagral-1.2.0 → pydiagral-1.2.0b1}/.github/FUNDING.yml +0 -0
  19. {pydiagral-1.2.0 → pydiagral-1.2.0b1}/.github/dependabot.yml +0 -0
  20. {pydiagral-1.2.0 → pydiagral-1.2.0b1}/.github/labels.yml +0 -0
  21. {pydiagral-1.2.0 → pydiagral-1.2.0b1}/.github/workflows/labeler.yml +0 -0
  22. {pydiagral-1.2.0 → pydiagral-1.2.0b1}/.github/workflows/lint.yaml +0 -0
  23. {pydiagral-1.2.0 → pydiagral-1.2.0b1}/.github/workflows/lock.yml +0 -0
  24. {pydiagral-1.2.0 → pydiagral-1.2.0b1}/.github/workflows/pytest.yaml +0 -0
  25. {pydiagral-1.2.0 → pydiagral-1.2.0b1}/.github/workflows/semantic-prs.yml +0 -0
  26. {pydiagral-1.2.0 → pydiagral-1.2.0b1}/.gitignore +0 -0
  27. {pydiagral-1.2.0 → pydiagral-1.2.0b1}/.vscode/extensions.json +0 -0
  28. {pydiagral-1.2.0 → pydiagral-1.2.0b1}/.vscode/settings.json +0 -0
  29. {pydiagral-1.2.0 → pydiagral-1.2.0b1}/LICENSE +0 -0
  30. {pydiagral-1.2.0 → pydiagral-1.2.0b1}/README.md +0 -0
  31. {pydiagral-1.2.0 → pydiagral-1.2.0b1}/docs/how-to-find-diagral-serial.png +0 -0
  32. {pydiagral-1.2.0 → pydiagral-1.2.0b1}/docs/pydiagral-Logo.png +0 -0
  33. {pydiagral-1.2.0 → pydiagral-1.2.0b1}/example_code.py +0 -0
  34. {pydiagral-1.2.0 → pydiagral-1.2.0b1}/mkdocs.yml +0 -0
  35. {pydiagral-1.2.0 → pydiagral-1.2.0b1}/pyproject.toml +0 -0
  36. {pydiagral-1.2.0 → pydiagral-1.2.0b1}/src/pydiagral/__init__.py +0 -0
  37. {pydiagral-1.2.0 → pydiagral-1.2.0b1}/src/pydiagral/constants.py +0 -0
  38. {pydiagral-1.2.0 → pydiagral-1.2.0b1}/src/pydiagral/exceptions.py +0 -0
  39. {pydiagral-1.2.0 → pydiagral-1.2.0b1}/src/pydiagral/utils.py +0 -0
  40. {pydiagral-1.2.0 → pydiagral-1.2.0b1}/tests/__init__.py +0 -0
  41. {pydiagral-1.2.0 → pydiagral-1.2.0b1}/tests/data/configuration_sample.json +0 -0
  42. {pydiagral-1.2.0 → pydiagral-1.2.0b1}/tests/data/system_details_sample.json +0 -0
  43. {pydiagral-1.2.0 → pydiagral-1.2.0b1}/tests/test_pydiagral_api.py +0 -0
@@ -20,7 +20,7 @@ jobs:
20
20
  - name: Checkout
21
21
  uses: actions/checkout@v4
22
22
  with:
23
- fetch-depth: 0
23
+ persist-credentials: false
24
24
 
25
25
  - name: Set up Python
26
26
  uses: actions/setup-python@v5
@@ -35,11 +35,10 @@ jobs:
35
35
  - name: Semantic Release
36
36
  id: semantic
37
37
  uses: cycjimmy/semantic-release-action@v4
38
- with:
39
- branch: ${{ github.ref_name }} # Utiliser la branche actuelle
40
38
  env:
41
- GITHUB_TOKEN: ${{ secrets.GH_TOKEN }}
39
+ GH_TOKEN: ${{ secrets.GH_TOKEN }}
42
40
  PYPI_TOKEN: ${{ secrets.PYPI_TOKEN }}
41
+ DEBUG: semantic-release:*
43
42
 
44
43
  - name: Show version
45
44
  if: steps.semantic.outputs.new_release_published == 'true'
@@ -57,7 +56,7 @@ jobs:
57
56
 
58
57
  - name: Publish to PyPI
59
58
  if: steps.semantic.outputs.new_release_published == 'true'
60
- run: twine upload dist/* -u __token__ -p "${{ secrets.PYPI_TOKEN }}"
59
+ run: twine upload dist/* --skip-existing -u __token__ -p "${{ secrets.PYPI_TOKEN }}"
61
60
 
62
61
  deploy-docs:
63
62
  runs-on: ubuntu-latest
@@ -84,7 +83,7 @@ jobs:
84
83
  pip install -e .
85
84
 
86
85
  - name: Build documentation
87
- run: mkdocs build --strict --verbose
86
+ run: mkdocs build --strict #--verbose
88
87
 
89
88
  - name: Deploy to GitHub Pages
90
89
  uses: peaceiris/actions-gh-pages@v4
@@ -3,7 +3,6 @@
3
3
  "main",
4
4
  {
5
5
  "name": "beta",
6
- "channel": "beta",
7
6
  "prerelease": true
8
7
  }
9
8
  ],
@@ -0,0 +1,22 @@
1
+ # [1.2.0-beta.1](https://github.com/mguyard/pydiagral/compare/v1.1.0...v1.2.0-beta.1) (2025-02-23)
2
+
3
+
4
+ ### Features
5
+
6
+ * Upgrade release ([bf300de](https://github.com/mguyard/pydiagral/commit/bf300de439c11b5bb2874043e1d2fe649d8f3073))
7
+
8
+ # [1.1.0](https://github.com/mguyard/pydiagral/compare/v1.0.0...v1.1.0) (2025-02-23)
9
+
10
+
11
+ ### Features
12
+
13
+ * **pencil:** Enable semantic debugs ([3d46b6e](https://github.com/mguyard/pydiagral/commit/3d46b6e220a7a26bea9f67112bfaea87419a9717))
14
+ * Upgrade release ([1e1909b](https://github.com/mguyard/pydiagral/commit/1e1909bbf6b0626d23584f98d0ff02d55f0f264c))
15
+
16
+ # [1.1.0-beta.1](https://github.com/mguyard/pydiagral/compare/v1.0.0...v1.1.0-beta.1) (2025-02-23)
17
+
18
+
19
+ ### Features
20
+
21
+ * **pencil:** Enable semantic debugs ([3d46b6e](https://github.com/mguyard/pydiagral/commit/3d46b6e220a7a26bea9f67112bfaea87419a9717))
22
+ * Upgrade release ([1e1909b](https://github.com/mguyard/pydiagral/commit/1e1909bbf6b0626d23584f98d0ff02d55f0f264c))
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: pydiagral
3
- Version: 1.2.0
3
+ Version: 1.2.0b1
4
4
  Summary: A Python library for interacting with Diagral systems
5
5
  Project-URL: Homepage, https://github.com/mguyard/pydiagral
6
6
  Project-URL: Documentation, https://github.com/mguyard/pydiagral
@@ -4,9 +4,9 @@
4
4
 
5
5
  ::: pydiagral.api
6
6
  handler: python
7
- selection:
8
- members:
9
- - "!^_" # Excludes members starting with an underscore
10
- - DiagralAPI
7
+ options:
8
+ show_root_heading: true
9
+ show_root_toc_entry: false
10
+ members_order: source
11
11
 
12
12
  <!-- prettier-ignore-end -->
@@ -0,0 +1,12 @@
1
+ <!-- prettier-ignore-start -->
2
+
3
+ # Exceptions Reference
4
+
5
+ ::: pydiagral.exceptions
6
+ handler: python
7
+ options:
8
+ show_root_heading: true
9
+ members_order: source
10
+
11
+
12
+ <!-- prettier-ignore-end -->
@@ -1,3 +1,5 @@
1
+ ![Logo](pydiagral-Logo.png)
2
+
1
3
  # Documentation pydiagral
2
4
 
3
5
  Welcome to the documentation for pydiagral, a Python library for interacting with the Diagral API.
@@ -61,7 +63,7 @@ LOG_LEVEL=DEBUG
61
63
 
62
64
  And run the [example_code.py](https://github.com/mguyard/pydiagral/blob/main/example_code.py).
63
65
 
64
- > [!TIP]
66
+ > TIP
65
67
  >
66
68
  > You can customize the actions performed by [example_code.py](https://github.com/mguyard/pydiagral/blob/main/example_code.py) by modifying the parameters in the code, as indicated by the `CUSTOMIZE THE TESTS` section title.
67
69
 
@@ -0,0 +1,11 @@
1
+ <!-- prettier-ignore-start -->
2
+
3
+ # Models Reference
4
+
5
+ ::: pydiagral.models
6
+ handler: python
7
+ options:
8
+ show_root_heading: true
9
+ members_order: source
10
+
11
+ <!-- prettier-ignore-end -->
@@ -0,0 +1 @@
1
+ 1
@@ -642,7 +642,8 @@ class DiagralAPI:
642
642
  SystemStatus: An instance of SystemStatus containing the system status after starting the system.
643
643
 
644
644
  Raises:
645
- All exceptions from __system_action function are propagated.
645
+ ConfigurationError: If the action is not one of the allowed actions.
646
+ AuthenticationError: If the API key, secret key, or PIN code is missing.
646
647
 
647
648
  """
648
649
 
@@ -657,7 +658,8 @@ class DiagralAPI:
657
658
  SystemStatus: An instance of SystemStatus containing the system status after stopping the system.
658
659
 
659
660
  Raises:
660
- All exceptions from __system_action function are propagated.
661
+ ConfigurationError: If the action is not one of the allowed actions.
662
+ AuthenticationError: If the API key, secret key, or PIN code is missing.
661
663
 
662
664
  """
663
665
 
@@ -670,7 +672,8 @@ class DiagralAPI:
670
672
  SystemStatus: An instance of SystemStatus containing the system status after starting the system in presence mode.
671
673
 
672
674
  Raises:
673
- All exceptions from __system_action function are propagated.
675
+ ConfigurationError: If the action is not one of the allowed actions.
676
+ AuthenticationError: If the API key, secret key, or PIN code is missing.
674
677
 
675
678
  """
676
679
 
@@ -687,7 +690,6 @@ class DiagralAPI:
687
690
 
688
691
  Raises:
689
692
  ConfigurationError: If the provided ID is not 1 or 2.
690
- All other exceptions from __system_action function are propagated.
691
693
 
692
694
  """
693
695
 
@@ -781,7 +783,7 @@ class DiagralAPI:
781
783
 
782
784
  Raises:
783
785
  ConfigurationError: If the action is not one of the allowed actions.
784
- All other exceptions from __action_group_system function are propagated.
786
+ AuthenticationError: If the API key, secret key, or PIN code is not provided.
785
787
 
786
788
  """
787
789
 
@@ -803,7 +805,7 @@ class DiagralAPI:
803
805
 
804
806
  Raises:
805
807
  ConfigurationError: If the action is not one of the allowed actions.
806
- All other exceptions from __action_group_system function are propagated.
808
+ AuthenticationError: If the API key, secret key, or PIN code is not provided.
807
809
 
808
810
  """
809
811
 
@@ -885,7 +887,8 @@ class DiagralAPI:
885
887
  SystemStatus: An instance of SystemStatus containing the system status after enabling the product.
886
888
 
887
889
  Raises:
888
- All exceptions from __action_product function are propagated.
890
+ ConfigurationError: If the action is not 'enable'
891
+ AuthenticationError: If the API key, secret key, or PIN code is not provided.
889
892
 
890
893
  """
891
894
  return await self.__action_product(
@@ -905,7 +908,8 @@ class DiagralAPI:
905
908
  SystemStatus: An instance of SystemStatus containing the system status after disabling the product.
906
909
 
907
910
  Raises:
908
- All exceptions from __action_product function are propagated.
911
+ ConfigurationError: If the action is not 'disable'
912
+ AuthenticationError: If the API key, secret key, or PIN code is not provided.
909
913
 
910
914
  """
911
915
  return await self.__action_product(
@@ -977,7 +981,6 @@ class DiagralAPI:
977
981
 
978
982
  Raises:
979
983
  AuthenticationError: If the API key or secret key is not provided.
980
- All other exceptions from _request function are propagated.
981
984
 
982
985
  """
983
986
 
@@ -90,7 +90,7 @@ class CamelCaseModel:
90
90
  return result
91
91
 
92
92
  @classmethod
93
- def _from_dict_recursive(cls, data: dict, target_cls: type[T]) -> T:
93
+ def _from_dict_recursive(cls: type[T], data: dict, target_cls: type[T]) -> T:
94
94
  """Recursively converts a dictionary to an instance of the specified target class.
95
95
 
96
96
  This method handles nested dictionaries and lists, converting them to the appropriate
@@ -98,7 +98,7 @@ class CamelCaseModel:
98
98
  by handling `Union` types and removing `None` from the type hints.
99
99
 
100
100
  Args:
101
- cls: The class that this method is a part of.
101
+ cls (type[T]): The class that this method is a part of.
102
102
  data (dict): The dictionary to convert.
103
103
  target_cls (type[T]): The target class to convert the dictionary to.
104
104
 
@@ -1,55 +0,0 @@
1
- # [1.2.0](https://github.com/mguyard/pydiagral/compare/v1.1.0...v1.2.0) (2025-02-22)
2
-
3
-
4
- ### Features
5
-
6
- * test1 ([e7bf5e6](https://github.com/mguyard/pydiagral/commit/e7bf5e6a4a72121a98e413541a0699d195190612))
7
-
8
- # [1.1.0](https://github.com/mguyard/pydiagral/compare/v1.0.0...v1.1.0) (2025-02-22)
9
-
10
-
11
- ### Features
12
-
13
- * test ([75ec27f](https://github.com/mguyard/pydiagral/commit/75ec27f885ce4e9be08b3b194446d49709d5107d))
14
-
15
- # 1.0.0 (2025-02-22)
16
-
17
-
18
- ### Bug Fixes
19
-
20
- * Add data in debug request log ([8951ce5](https://github.com/mguyard/pydiagral/commit/8951ce5cc4e7c896aa87bf99312253138fa8a247))
21
- * Allow detail and user fields in WebHookNotification model to be optional ([0ca68c3](https://github.com/mguyard/pydiagral/commit/0ca68c348a8dcaa58929c987f97ef57b3c8a5efc))
22
- * Allow detail and user fields in WebHookNotification model to be optional ([5499bbb](https://github.com/mguyard/pydiagral/commit/5499bbbb341f82b19a1513441b861ea720ad0363))
23
- * Bad object name use in test script ([71d740d](https://github.com/mguyard/pydiagral/commit/71d740daa812daf4d704581c0e4a862565b5c441))
24
- * Change aiohttp dependancy from static version 3.10.5 to ^3.8.0 ([d509427](https://github.com/mguyard/pydiagral/commit/d50942725f424d361f725999c803470c8a5636e0))
25
- * Rename test script to don't block pytest ([ec8323f](https://github.com/mguyard/pydiagral/commit/ec8323fdcd6e06ee6aadf5cd2005e7245aa0d219))
26
- * Resolve aiohttp dependancy syntax ([d9fddcf](https://github.com/mguyard/pydiagral/commit/d9fddcf5801d41f54d1f0409ded98ff7e9717f6c))
27
- * Resolve issue with Anomalies model and optional fields ([027289a](https://github.com/mguyard/pydiagral/commit/027289a78356ecceb4cf5b8d3121dbcba258b619))
28
- * Resolve issue with field name containing underscore but without field alias ([1ee94a5](https://github.com/mguyard/pydiagral/commit/1ee94a5de79efa61de668434de830df5abd7ed2d))
29
- * Resolve issue with previous commit where body data was extracted and not passed ([957a49a](https://github.com/mguyard/pydiagral/commit/957a49af6ceff43fbc07662bef2bb6e5da08cb80))
30
- * Resolve issue with WebHookNotification dataclass ([b0a4c46](https://github.com/mguyard/pydiagral/commit/b0a4c46fcf817e509879da8046a7f90a1a2d9afb))
31
- * Return User in WebHookNotification model ([39fc249](https://github.com/mguyard/pydiagral/commit/39fc2493e4abe3aa2e2c2c94ffc483e197efc12d))
32
- * set is_valid_email methode as private with __ ([90795a5](https://github.com/mguyard/pydiagral/commit/90795a5a15c6c110b1eda56309450e2c042e7721))
33
- * Update of models to more match models name purposed in Diagral API and ajust test.py script ([798ddd0](https://github.com/mguyard/pydiagral/commit/798ddd039db6909faf354b7fc463446c260d24eb))
34
- * Update return types in DiagralAPI::get_devices_info methods for improved data handling ([a48ea90](https://github.com/mguyard/pydiagral/commit/a48ea90f97f3c9ac72c5b0ef736feaa301720e54))
35
- * Update WebHookNotification model to require detail and user fields with improved initialization ([b373e3e](https://github.com/mguyard/pydiagral/commit/b373e3e0727334a422c741e64da0947d69c43df5))
36
-
37
-
38
- ### Features
39
-
40
- * Add a class method to create a WebHookNotification instance from a dictionary ([1e17e78](https://github.com/mguyard/pydiagral/commit/1e17e78cbb0275424b4a3c4a1731a23d2b57660a))
41
- * Add a data model for the device list and update the method for retrieving device information ([8b4160a](https://github.com/mguyard/pydiagral/commit/8b4160a8d9426ab3ffe79ce44cdecba82ae90e8b))
42
- * Add alarm_type to WebHookNotification and implement alarm type determination based on alarm_code ([fc87d91](https://github.com/mguyard/pydiagral/commit/fc87d91f868e10cf8594cc916167b2ba0ae68927))
43
- * Add an asynchronous method to retrieve device information from the alarm configuration ([fe1bd8f](https://github.com/mguyard/pydiagral/commit/fe1bd8f46894af25399c27fac07ed6c49c6f644c))
44
- * Add an optional device_label field to WebHookNotificationDetail ([c429777](https://github.com/mguyard/pydiagral/commit/c42977737b9ac83d7c17b0a48667c0c2f9f362d5))
45
- * Add apikey argument in validate_apikey and delete_apikey function ([3c40eab](https://github.com/mguyard/pydiagral/commit/3c40eabfe6100bea6715a789b4d9bb03500fe962))
46
- * Add function to identity webhook type based on alarm_code provided in webhook notification ([088a3c0](https://github.com/mguyard/pydiagral/commit/088a3c03e4aed8f20074ed1b55e1880f9e0ee242))
47
- * Add model for Webhook Notification ([ca1fe40](https://github.com/mguyard/pydiagral/commit/ca1fe4079ef3c0c54c0589ced92621fef73fa6cf))
48
- * Add WebHookNotificationUser model to represent users triggering webhook notifications and include it in WebHookNotification model ([d13341f](https://github.com/mguyard/pydiagral/commit/d13341f5ee328c6c4c8c56d046182885d1fc256c))
49
- * Allow get_configuration function to return results ([f94956a](https://github.com/mguyard/pydiagral/commit/f94956abb4aea8e38aa78451e2d0d6c28c162405))
50
- * Implement webhook registration, update, and deletion functionality ([37d2c40](https://github.com/mguyard/pydiagral/commit/37d2c40151bd7dbe3244bd33ae97e88589aad6d0))
51
- * Improve test script example with more easy usage ([8636b6f](https://github.com/mguyard/pydiagral/commit/8636b6f0c809af94f9b090e5decdfc46dac05e4c))
52
- * Improve test script example with more easy usage ([3199f64](https://github.com/mguyard/pydiagral/commit/3199f64e154f848c745d7e0e6287325b04479355))
53
- * Include timezone (utc) in the created_at answer for get_anomalies function + test adaptation ([9005af8](https://github.com/mguyard/pydiagral/commit/9005af8637000f94e3ff3007696b228d855565f0))
54
- * Inplementation of new methods ([d8a2c18](https://github.com/mguyard/pydiagral/commit/d8a2c18637803436a12b13fe7ce813217b5c8357))
55
- * Update get_anomalies method to return an empty dict if no anomalies are found ([ad2b1da](https://github.com/mguyard/pydiagral/commit/ad2b1daa3b2396866a7f69bfe6aefc0b054dc76d))
@@ -1,18 +0,0 @@
1
- <!-- prettier-ignore-start -->
2
-
3
- # Exceptions Reference
4
-
5
- ::: pydiagral.exceptions
6
- handler: python
7
- selection:
8
- members:
9
- - DiagralAPIError
10
- - AuthenticationError
11
- - ClientError
12
- - ConfigurationError
13
- - ServerError
14
- - SessionError
15
- - ValidationError
16
-
17
-
18
- <!-- prettier-ignore-end -->
@@ -1,16 +0,0 @@
1
- <!-- prettier-ignore-start -->
2
-
3
- # Models Reference
4
-
5
- ::: pydiagral.models
6
- handler: python
7
- options:
8
- show_root_heading: true
9
- show_source: false
10
- members: true
11
- filters:
12
- - "!^_" # Excludes members starting with an underscore
13
- - "!CamelCaseModel" # Specifically excludes the CamelCaseModel class
14
- - - "!^[a-z]" # Excludes members starting with a minus letter (following Python convention match functions)
15
-
16
- <!-- prettier-ignore-end -->
pydiagral-1.2.0/test.txt DELETED
@@ -1 +0,0 @@
1
- test
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes