neris-api-client 1.2.1.post0__tar.gz → 1.3.1__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.
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.2
2
2
  Name: neris_api_client
3
- Version: 1.2.1.post0
3
+ Version: 1.3.1
4
4
  Summary: NERIS API Client
5
5
  Author-email: Ben Coleman <ben.coleman@ul.org>, Tommy Messbauer <thomas.messbauer@ul.org>, Joseph Pagani <joseph.pagani@ul.org>
6
6
  Project-URL: Homepage, https://github.com/ulfsri/neris-api-client
@@ -19,6 +19,12 @@ Requires-Dist: python-dotenv
19
19
 
20
20
  A Python class to interact with the NERIS API programmatically.
21
21
 
22
+ > **NOTE:** Due to the changes and transition to using Oauth 2.0 version 1.2 is now deprecated. Please upgrade to version 1.3. You can do that in a package manager with the following update: `neris-api-client = ">=1.3"` or in your `requirements.txt` you can do `neris-api-client >=1.3`. Or you can install with `pip install neris_api_client>=1.3.`.
23
+
24
+ ## Versioning
25
+
26
+ This API client does not directly follow semver practices. In order to remove confusion between the NERIS API client and API, we have decided to align the major version of this client with the major version of the API release. The minor and patch versions of this client will differ from API release version, they will instead represent changes made to the API client itself.
27
+
22
28
  ## Installation
23
29
 
24
30
  To install:
@@ -91,6 +97,14 @@ client = NerisApiClient()
91
97
  entity = client.get_entity("FD24027240")
92
98
  ```
93
99
 
100
+ ## Additional config parameters
101
+
102
+ | Parameter | Description |
103
+ | --------- | ----------------------------------------------------------- |
104
+ | debug | Controls whether the application outputs debug information. |
105
+ | validate | Controls whether the client performs model validations. |
106
+
107
+
94
108
  ## Disclaimer
95
109
  The models in this package are generated using [`datamodel-code-generator`](https://github.com/koxudaxi/datamodel-code-generator) and are not guaranteed
96
110
  to contain all of the information present in the full specification. The generated models are used to validate request payloads prior to
@@ -2,6 +2,12 @@
2
2
 
3
3
  A Python class to interact with the NERIS API programmatically.
4
4
 
5
+ > **NOTE:** Due to the changes and transition to using Oauth 2.0 version 1.2 is now deprecated. Please upgrade to version 1.3. You can do that in a package manager with the following update: `neris-api-client = ">=1.3"` or in your `requirements.txt` you can do `neris-api-client >=1.3`. Or you can install with `pip install neris_api_client>=1.3.`.
6
+
7
+ ## Versioning
8
+
9
+ This API client does not directly follow semver practices. In order to remove confusion between the NERIS API client and API, we have decided to align the major version of this client with the major version of the API release. The minor and patch versions of this client will differ from API release version, they will instead represent changes made to the API client itself.
10
+
5
11
  ## Installation
6
12
 
7
13
  To install:
@@ -74,6 +80,14 @@ client = NerisApiClient()
74
80
  entity = client.get_entity("FD24027240")
75
81
  ```
76
82
 
83
+ ## Additional config parameters
84
+
85
+ | Parameter | Description |
86
+ | --------- | ----------------------------------------------------------- |
87
+ | debug | Controls whether the application outputs debug information. |
88
+ | validate | Controls whether the client performs model validations. |
89
+
90
+
77
91
  ## Disclaimer
78
92
  The models in this package are generated using [`datamodel-code-generator`](https://github.com/koxudaxi/datamodel-code-generator) and are not guaranteed
79
93
  to contain all of the information present in the full specification. The generated models are used to validate request payloads prior to
@@ -4,7 +4,7 @@ build-backend = "setuptools.build_meta"
4
4
 
5
5
  [project]
6
6
  name = "neris_api_client"
7
- version = "1.2.1.post0"
7
+ version = "1.3.1"
8
8
  authors = [
9
9
  { name="Ben Coleman", email="ben.coleman@ul.org" },
10
10
  { name="Tommy Messbauer", email="thomas.messbauer@ul.org" },
@@ -161,7 +161,7 @@ class _NerisApiClient:
161
161
  self._update_auth()
162
162
  self._session.headers.update({"Authorization": f"Bearer {self.tokens.access_token}"})
163
163
 
164
- if model:
164
+ if self.config.validate and model:
165
165
  if isinstance(data, str):
166
166
  data = model.model_validate_json(data).model_dump(mode="json", by_alias=True)
167
167
  if isinstance(data, dict):
@@ -16,11 +16,13 @@ class Config:
16
16
  client_id: str | None = None
17
17
  client_secret: str | None = None
18
18
  grant_type: GrantType | None = None
19
+ validate: bool | None = None
19
20
 
20
21
  def __post_init__(self):
21
22
  # env var handling
22
23
  self.base_url = self.base_url or os.getenv("NERIS_BASE_URL")
23
24
  self.debug = self.debug if self.debug is not None else os.getenv("NERIS_DEBUG") == "true"
25
+ self.validate = self.validate if self.validate is not None else os.getenv("NERIS_VALIDATE") == "true"
24
26
 
25
27
  match os.getenv("NERIS_GRANT_TYPE"):
26
28
  case GrantType.PASSWORD:
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.2
2
2
  Name: neris_api_client
3
- Version: 1.2.1.post0
3
+ Version: 1.3.1
4
4
  Summary: NERIS API Client
5
5
  Author-email: Ben Coleman <ben.coleman@ul.org>, Tommy Messbauer <thomas.messbauer@ul.org>, Joseph Pagani <joseph.pagani@ul.org>
6
6
  Project-URL: Homepage, https://github.com/ulfsri/neris-api-client
@@ -19,6 +19,12 @@ Requires-Dist: python-dotenv
19
19
 
20
20
  A Python class to interact with the NERIS API programmatically.
21
21
 
22
+ > **NOTE:** Due to the changes and transition to using Oauth 2.0 version 1.2 is now deprecated. Please upgrade to version 1.3. You can do that in a package manager with the following update: `neris-api-client = ">=1.3"` or in your `requirements.txt` you can do `neris-api-client >=1.3`. Or you can install with `pip install neris_api_client>=1.3.`.
23
+
24
+ ## Versioning
25
+
26
+ This API client does not directly follow semver practices. In order to remove confusion between the NERIS API client and API, we have decided to align the major version of this client with the major version of the API release. The minor and patch versions of this client will differ from API release version, they will instead represent changes made to the API client itself.
27
+
22
28
  ## Installation
23
29
 
24
30
  To install:
@@ -91,6 +97,14 @@ client = NerisApiClient()
91
97
  entity = client.get_entity("FD24027240")
92
98
  ```
93
99
 
100
+ ## Additional config parameters
101
+
102
+ | Parameter | Description |
103
+ | --------- | ----------------------------------------------------------- |
104
+ | debug | Controls whether the application outputs debug information. |
105
+ | validate | Controls whether the client performs model validations. |
106
+
107
+
94
108
  ## Disclaimer
95
109
  The models in this package are generated using [`datamodel-code-generator`](https://github.com/koxudaxi/datamodel-code-generator) and are not guaranteed
96
110
  to contain all of the information present in the full specification. The generated models are used to validate request payloads prior to