neris-api-client 0.1.4__tar.gz → 0.1.5__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,10 +1,10 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: neris_api_client
3
- Version: 0.1.4
3
+ Version: 0.1.5
4
4
  Summary: NERIS API Client
5
5
  Author-email: Ben Coleman <ben.coleman@ul.org>
6
6
  Project-URL: Homepage, https://github.com/ulfsri/neris-api-client
7
- Project-URL: Issues, https://github.com/ulfsri/neris-api-client/issues
7
+ Project-URL: Issues, https://neris.atlassian.net/servicedesk/customer/portal/3/group/3/create/10027
8
8
  Classifier: Programming Language :: Python :: 3
9
9
  Classifier: License :: OSI Approved :: MIT License
10
10
  Classifier: Operating System :: OS Independent
@@ -22,6 +22,13 @@ Requires-Dist: typing_extensions
22
22
  A Python class to interact with the NERIS API programmatically.
23
23
 
24
24
  ## Usage
25
+
26
+ To install:
27
+ ```bash
28
+ pip install neris-api-client
29
+ ```
30
+ Package lives on pypi: [`NERIS API Client`](https://pypi.org/project/neris-api-client/)
31
+
25
32
  The client requires a username and password for authentication and authorization of requests unless the `env` argument is set to `local`
26
33
  at instantiation. The `local` environment is intended for development use on local machines and bypasses auth.
27
34
 
@@ -41,3 +48,6 @@ keyword argument or deleting the token cache.
41
48
  The models in this package are generated using [`datamodel-code-generator`](https://github.com/koxudaxi/datamodel-code-generator) and are not guaranteed
42
49
  to contain all of the information present in the full specification. The generated models are used to validate request payloads prior to
43
50
  API submission.
51
+
52
+ ## Additional Information
53
+ To ask a question, make a suggestion, or otherwise get help with the NERIS API Client, please visit [the NERIS helpdesk](https://neris.atlassian.net/servicedesk/customer/portals).
@@ -3,6 +3,13 @@
3
3
  A Python class to interact with the NERIS API programmatically.
4
4
 
5
5
  ## Usage
6
+
7
+ To install:
8
+ ```bash
9
+ pip install neris-api-client
10
+ ```
11
+ Package lives on pypi: [`NERIS API Client`](https://pypi.org/project/neris-api-client/)
12
+
6
13
  The client requires a username and password for authentication and authorization of requests unless the `env` argument is set to `local`
7
14
  at instantiation. The `local` environment is intended for development use on local machines and bypasses auth.
8
15
 
@@ -22,3 +29,6 @@ keyword argument or deleting the token cache.
22
29
  The models in this package are generated using [`datamodel-code-generator`](https://github.com/koxudaxi/datamodel-code-generator) and are not guaranteed
23
30
  to contain all of the information present in the full specification. The generated models are used to validate request payloads prior to
24
31
  API submission.
32
+
33
+ ## Additional Information
34
+ To ask a question, make a suggestion, or otherwise get help with the NERIS API Client, please visit [the NERIS helpdesk](https://neris.atlassian.net/servicedesk/customer/portals).
@@ -4,7 +4,7 @@ build-backend = "setuptools.build_meta"
4
4
 
5
5
  [project]
6
6
  name = "neris_api_client"
7
- version = "0.1.4"
7
+ version = "0.1.5"
8
8
  authors = [
9
9
  { name="Ben Coleman", email="ben.coleman@ul.org" },
10
10
  ]
@@ -26,4 +26,4 @@ dependencies = [
26
26
 
27
27
  [project.urls]
28
28
  Homepage = "https://github.com/ulfsri/neris-api-client"
29
- Issues = "https://github.com/ulfsri/neris-api-client/issues"
29
+ Issues = "https://neris.atlassian.net/servicedesk/customer/portal/3/group/3/create/10027"
@@ -1,3 +1,4 @@
1
+ import os
1
2
  import jwt
2
3
  import json
3
4
  from enum import Enum
@@ -39,6 +40,8 @@ COGNITO_CLIENT_CONFIG_URL = (
39
40
  "https://neris-{env}-public.s3.us-east-2.amazonaws.com/cognito_config.json"
40
41
  )
41
42
 
43
+ os.environ["AWS_DEFAULT_REGION"] = "us-east-2"
44
+
42
45
 
43
46
  class _NerisApiClient:
44
47
  def __init__(
@@ -200,7 +203,12 @@ class _NerisApiClient:
200
203
  e.args = e.args + (e.response.text,)
201
204
  raise e
202
205
 
203
- return res.json()
206
+ try:
207
+ response = res.json()
208
+ except requests.exceptions.JSONDecodeError:
209
+ response = res.text
210
+
211
+ return response
204
212
 
205
213
 
206
214
  class NerisApiClient(_NerisApiClient):
@@ -1,10 +1,10 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: neris_api_client
3
- Version: 0.1.4
3
+ Version: 0.1.5
4
4
  Summary: NERIS API Client
5
5
  Author-email: Ben Coleman <ben.coleman@ul.org>
6
6
  Project-URL: Homepage, https://github.com/ulfsri/neris-api-client
7
- Project-URL: Issues, https://github.com/ulfsri/neris-api-client/issues
7
+ Project-URL: Issues, https://neris.atlassian.net/servicedesk/customer/portal/3/group/3/create/10027
8
8
  Classifier: Programming Language :: Python :: 3
9
9
  Classifier: License :: OSI Approved :: MIT License
10
10
  Classifier: Operating System :: OS Independent
@@ -22,6 +22,13 @@ Requires-Dist: typing_extensions
22
22
  A Python class to interact with the NERIS API programmatically.
23
23
 
24
24
  ## Usage
25
+
26
+ To install:
27
+ ```bash
28
+ pip install neris-api-client
29
+ ```
30
+ Package lives on pypi: [`NERIS API Client`](https://pypi.org/project/neris-api-client/)
31
+
25
32
  The client requires a username and password for authentication and authorization of requests unless the `env` argument is set to `local`
26
33
  at instantiation. The `local` environment is intended for development use on local machines and bypasses auth.
27
34
 
@@ -41,3 +48,6 @@ keyword argument or deleting the token cache.
41
48
  The models in this package are generated using [`datamodel-code-generator`](https://github.com/koxudaxi/datamodel-code-generator) and are not guaranteed
42
49
  to contain all of the information present in the full specification. The generated models are used to validate request payloads prior to
43
50
  API submission.
51
+
52
+ ## Additional Information
53
+ To ask a question, make a suggestion, or otherwise get help with the NERIS API Client, please visit [the NERIS helpdesk](https://neris.atlassian.net/servicedesk/customer/portals).