hakai_api 0.2.2__tar.gz → 1.0.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.
- {hakai_api-0.2.2 → hakai_api-1.0.0}/PKG-INFO +1 -1
- {hakai_api-0.2.2 → hakai_api-1.0.0}/README.md +7 -1
- {hakai_api-0.2.2 → hakai_api-1.0.0}/hakai_api/Client.py +3 -6
- {hakai_api-0.2.2 → hakai_api-1.0.0}/hakai_api.egg-info/PKG-INFO +1 -1
- {hakai_api-0.2.2 → hakai_api-1.0.0}/hakai_api.egg-info/SOURCES.txt +1 -0
- {hakai_api-0.2.2 → hakai_api-1.0.0}/hakai_api.egg-info/requires.txt +0 -2
- hakai_api-1.0.0/setup.cfg +7 -0
- {hakai_api-0.2.2 → hakai_api-1.0.0}/setup.py +3 -3
- hakai_api-0.2.2/setup.cfg +0 -4
- {hakai_api-0.2.2 → hakai_api-1.0.0}/hakai_api/__init__.py +0 -0
- {hakai_api-0.2.2 → hakai_api-1.0.0}/hakai_api.egg-info/dependency_links.txt +0 -0
- {hakai_api-0.2.2 → hakai_api-1.0.0}/hakai_api.egg-info/not-zip-safe +0 -0
- {hakai_api-0.2.2 → hakai_api-1.0.0}/hakai_api.egg-info/top_level.txt +0 -0
|
@@ -9,6 +9,9 @@ The exported `Client` class extends the functionality of the Python [requests li
|
|
|
9
9
|
pip install hakai-api
|
|
10
10
|
```
|
|
11
11
|
|
|
12
|
+
# Requirements
|
|
13
|
+
Python 3.6 or higher
|
|
14
|
+
|
|
12
15
|
# Quickstart
|
|
13
16
|
|
|
14
17
|
```python
|
|
@@ -48,4 +51,7 @@ print(client.api_root) # http://localhost:8666
|
|
|
48
51
|
# Development
|
|
49
52
|
The business code for this package is in the file [`hakai_api/Client.py`](hakai_api/Client.py).
|
|
50
53
|
The `./setup.py` file is important for giving details about how to install the package when users do `pip install hakai-api`.
|
|
51
|
-
|
|
54
|
+
|
|
55
|
+
To build a new PyPi package version push a tag matching the pattern `v[0-9]+.[0-9]+.[0-9]+` or `v[0-9]+.[0-9]+.[0-9]+rc[0-9]+` to the origin (e.g. `v0.4.1` or `v0.5.2rc1`).
|
|
56
|
+
Github Actions should take care of packagin and pushing it to Hakai's PyPi repository from there.
|
|
57
|
+
|
|
@@ -1,11 +1,9 @@
|
|
|
1
|
-
"""
|
|
1
|
+
"""Get authorized requests to the Hakai API using the requests library.
|
|
2
2
|
|
|
3
3
|
Written by: Taylor Denouden, Chris Davis, and Nate Rosenstock
|
|
4
4
|
Last updated: April 2021
|
|
5
5
|
"""
|
|
6
6
|
|
|
7
|
-
from __future__ import print_function
|
|
8
|
-
|
|
9
7
|
import os
|
|
10
8
|
import pickle
|
|
11
9
|
from datetime import datetime
|
|
@@ -13,7 +11,6 @@ from time import mktime
|
|
|
13
11
|
|
|
14
12
|
from pytz import utc
|
|
15
13
|
from requests_oauthlib import OAuth2Session
|
|
16
|
-
from six.moves import input
|
|
17
14
|
|
|
18
15
|
|
|
19
16
|
class Client(OAuth2Session):
|
|
@@ -29,8 +26,8 @@ class Client(OAuth2Session):
|
|
|
29
26
|
Defaults to the production server.
|
|
30
27
|
"""
|
|
31
28
|
self._api_root = api_root
|
|
32
|
-
self._authorization_base_url = '{}/auth/oauth2'
|
|
33
|
-
self._token_url = '{}/auth/oauth2/token'
|
|
29
|
+
self._authorization_base_url = f'{api_root}/auth/oauth2'
|
|
30
|
+
self._token_url = f'{api_root}/auth/oauth2/token'
|
|
34
31
|
|
|
35
32
|
# Try to get cached credentials
|
|
36
33
|
credentials = self._try_to_load_credentials()
|
|
@@ -1,20 +1,20 @@
|
|
|
1
|
+
import os
|
|
2
|
+
|
|
1
3
|
from setuptools import setup
|
|
2
4
|
|
|
3
5
|
setup(
|
|
4
6
|
name='hakai_api',
|
|
5
7
|
packages=['hakai_api'],
|
|
6
|
-
version=
|
|
8
|
+
version=os.environ['VERSION'],
|
|
7
9
|
description='Get Hakai database resources using http calls',
|
|
8
10
|
url='https://github.com/tayden/hakai-api-client-python',
|
|
9
11
|
author='Taylor Denouden',
|
|
10
12
|
author_email='taylor.denouden@hakai.org',
|
|
11
13
|
license='MIT',
|
|
12
14
|
install_requires=[
|
|
13
|
-
'future',
|
|
14
15
|
'pytz',
|
|
15
16
|
'requests',
|
|
16
17
|
'requests-oauthlib',
|
|
17
|
-
'six',
|
|
18
18
|
],
|
|
19
19
|
zip_safe=False,
|
|
20
20
|
)
|
hakai_api-0.2.2/setup.cfg
DELETED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|