Skip to content

Commit e0972ea

Browse files
authored
Merge pull request #5 from adobe-apiplatform/v1
Move v1 release candidates to master
2 parents e5215f0 + 067975a commit e0972ea

File tree

11 files changed

+250
-81
lines changed

11 files changed

+250
-81
lines changed

README.md

Lines changed: 26 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -1,21 +1,25 @@
1-
# adobe-umapi.py
1+
# adobe-umapi-client.py
22

3-
Python client for the Adobe User Management API, aka the
4-
[Adobe UMAPI](https://www.adobe.io/products/usermanagement/docs/gettingstarted.html)
3+
This is a Python client for the Adobe User Management API, aka the
4+
[Adobe UMAPI](https://www.adobe.io/products/usermanagement/docs/gettingstarted.html).
5+
6+
The Adobe User Management API is an Adobe-hosted network service
7+
which provides Adobe Enterprise customers the ability to manage their users. This
8+
client makes it easy to access the Adobe UMAPI from a local Python application.
9+
10+
This client is open source, maintained by Adobe, and distributed under the terms
11+
of the OSI-approved MIT license. Copyright (c) 2016 Adobe Systems Incorporated.
512

613
# Installation
714

8-
You can get this package from PyPI: `pip install adobe-umapi`.
15+
You can get this package from PyPI: `pip install adobe-umapi-client`.
916
Or you can download the posted package from GitHub and use pip
1017
to install from the download.
1118

12-
(Note: as of 13 Dec 2016, there was an issue with the PyPI posting.
13-
We are working to fix that problem.)
14-
1519
# Building
1620

1721
1. Clone this repository or download the latest stable release.
18-
2. From the command line, change to the `adobe-umapi.py` directory.
22+
2. From the command line, change to the `adobe-umapi-client.py` directory.
1923
3. To install, run the command `python setup.py install`.
2024
[**NOTE**: You may need admin/root privileges to install new packages in your environment.
2125
It is recommended that you use `virtualenv` to make a virtual python environment.
@@ -62,7 +66,7 @@ The JSON Web Token (JWT) is used to get an authorization token for using the API
6266
The `JWT` object will build the JWT for use with the `AccessRequest` object.
6367

6468
```python
65-
from adobe_umapi.auth import JWT
69+
from adobe_umapi_client.auth import JWT
6670

6771
jwt = JWT(
6872
org_id, # Organization ID
@@ -79,7 +83,7 @@ The `AccessRequest` object uses the JWT to call an IMS endpoint to obtain an acc
7983
token is then used in all later UMAPI calls to authenticate and authorize the request.
8084

8185
```python
82-
from adobe_umapi.auth import AccessRequest
86+
from adobe_umapi_client.auth import AccessRequest
8387

8488
token = AccessRequest(
8589
"https://" + ims_host + ims_endpoint_jwt, # Access Request Endpoint (IMS Host + JWT Endpoint)
@@ -103,7 +107,7 @@ Once you have an access `token`, you use it to create an Auth object. This Auth
103107
is used to build the necessary authentication headers for making an API call.
104108

105109
```python
106-
from adobe_umapi.auth import Auth
110+
from adobe_umapi_client.auth import Auth
107111

108112
auth = Auth(api_key, token())
109113
```
@@ -114,7 +118,7 @@ Once the `auth` object is built, you use it to construct a UMAPI object. This U
114118
object can then be used over and over to make your desired API calls.
115119

116120
```python
117-
from adobe_umapi import UMAPI
121+
from adobe_umapi_client import UMAPI
118122

119123
api_endpoint = 'https://usermanagement.adobe.io/v2/usermanagement'
120124
api = UMAPI(api_endpoint, auth)
@@ -124,15 +128,15 @@ api = UMAPI(api_endpoint, auth)
124128

125129
These snippets presume you have constructed a UMAPI object named `api` as detailed in the last section.
126130
The query APIs return data in paginated form, each page contaning up to 200 results.
127-
The `adobe_umapi.helper`
131+
The `adobe_umapi_client.helper`
128132
module has a `paginate` utility which can will concatenate and return the results from all pages.
129133

130134
## Get a List of Users
131135

132136
```python
133137
users = api.users(org_id, page=0) # optional arg page defaults to 0
134138

135-
from adobe_umapi.helper import paginate
139+
from adobe_umapi_client.helper import paginate
136140
all_users = paginate(api.users, org_id) # optional args for max_pages and max_records
137141
```
138142

@@ -158,7 +162,7 @@ To create the action object, we name the user we wish to operate on.
158162
(As above, `api` here in a UMAPI object.)
159163

160164
```python
161-
from adobe_umapi import Action
165+
from adobe_umapi_client import Action
162166

163167
action = Action(user="[email protected]")
164168
```
@@ -443,9 +447,9 @@ The "add" portion of the JSON looks like this:
443447
"add": {"product": ["product1"]}
444448
```
445449

446-
## adobe_umapi.auth
450+
## adobe_umapi_client.auth
447451

448-
The submodule `adobe_umapi.auth` contains the components needed to build
452+
The submodule `adobe_umapi_client.auth` contains the components needed to build
449453
the authentication headers needed for API communication.
450454

451455
### JWT
@@ -466,7 +470,7 @@ The `JWT` object is callable. Calling it returns the encoded JWT.
466470
Example:
467471

468472
```python
469-
from adobe_umapi.auth import JWT
473+
from adobe_umapi_client.auth import JWT
470474

471475
jwt = JWT(
472476
org_id, # Organization ID
@@ -495,7 +499,7 @@ Like the `JWT` object, the `AccessRequest` object is callable. Calling it retur
495499
Basic Usage Example:
496500

497501
```python
498-
from adobe_umapi.auth import AccessRequest
502+
from adobe_umapi_client.auth import AccessRequest
499503

500504
token = AccessRequest(
501505
"https://" + ims_host + ims_endpoint_jwt, # Access Request Endpoint (IMS Host + JWT Endpoint)
@@ -529,15 +533,15 @@ It is a subclass of the
529533
Example:
530534

531535
```python
532-
from adobe_umapi.auth import Auth
536+
from adobe_umapi_client.auth import Auth
533537

534538
token = AccessRequest( ... )
535539
auth = Auth(api_key, token())
536540
```
537541

538-
## adobe_umapi.error
542+
## adobe_umapi_client.error
539543

540-
The `adobe_umapi.error` submodule contains all custom Exceptions for the UMAPI library.
544+
The `adobe_umapi_client.error` submodule contains all custom Exceptions for the UMAPI library.
541545

542546
### UMAPIError
543547

adobe_umapi/__init__.py

Lines changed: 0 additions & 1 deletion
This file was deleted.

adobe_umapi/error.py

Lines changed: 0 additions & 20 deletions
This file was deleted.

adobe_umapi_client/__init__.py

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
# Copyright (c) 2016 Adobe Systems Incorporated. All rights reserved.
2+
#
3+
# Permission is hereby granted, free of charge, to any person obtaining a copy
4+
# of this software and associated documentation files (the "Software"), to deal
5+
# in the Software without restriction, including without limitation the rights
6+
# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
7+
# copies of the Software, and to permit persons to whom the Software is
8+
# furnished to do so, subject to the following conditions:
9+
#
10+
# The above copyright notice and this permission notice shall be included in all
11+
# copies or substantial portions of the Software.
12+
#
13+
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
14+
# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
15+
# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
16+
# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
17+
# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
18+
# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
19+
# SOFTWARE.
20+
21+
from .api import UMAPI, Action

adobe_umapi/api.py renamed to adobe_umapi_client/api.py

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,23 @@
1+
# Copyright (c) 2016 Adobe Systems Incorporated. All rights reserved.
2+
#
3+
# Permission is hereby granted, free of charge, to any person obtaining a copy
4+
# of this software and associated documentation files (the "Software"), to deal
5+
# in the Software without restriction, including without limitation the rights
6+
# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
7+
# copies of the Software, and to permit persons to whom the Software is
8+
# furnished to do so, subject to the following conditions:
9+
#
10+
# The above copyright notice and this permission notice shall be included in all
11+
# copies or substantial portions of the Software.
12+
#
13+
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
14+
# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
15+
# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
16+
# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
17+
# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
18+
# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
19+
# SOFTWARE.
20+
121
import requests
222
import json
323
import six

adobe_umapi/auth.py renamed to adobe_umapi_client/auth.py

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,23 @@
1+
# Copyright (c) 2016 Adobe Systems Incorporated. All rights reserved.
2+
#
3+
# Permission is hereby granted, free of charge, to any person obtaining a copy
4+
# of this software and associated documentation files (the "Software"), to deal
5+
# in the Software without restriction, including without limitation the rights
6+
# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
7+
# copies of the Software, and to permit persons to whom the Software is
8+
# furnished to do so, subject to the following conditions:
9+
#
10+
# The above copyright notice and this permission notice shall be included in all
11+
# copies or substantial portions of the Software.
12+
#
13+
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
14+
# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
15+
# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
16+
# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
17+
# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
18+
# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
19+
# SOFTWARE.
20+
121
import time
222
# noinspection PyPackageRequirements,PyUnresolvedReferences
323
import jwt # package name is PyJWT in setup

adobe_umapi_client/error.py

Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
# Copyright (c) 2016 Adobe Systems Incorporated. All rights reserved.
2+
#
3+
# Permission is hereby granted, free of charge, to any person obtaining a copy
4+
# of this software and associated documentation files (the "Software"), to deal
5+
# in the Software without restriction, including without limitation the rights
6+
# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
7+
# copies of the Software, and to permit persons to whom the Software is
8+
# furnished to do so, subject to the following conditions:
9+
#
10+
# The above copyright notice and this permission notice shall be included in all
11+
# copies or substantial portions of the Software.
12+
#
13+
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
14+
# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
15+
# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
16+
# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
17+
# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
18+
# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
19+
# SOFTWARE.
20+
21+
class UMAPIError(Exception):
22+
def __init__(self, res):
23+
Exception.__init__(self, "UMAPI Error: "+str(res.status_code))
24+
self.res = res
25+
26+
27+
class UMAPIRetryError(Exception):
28+
def __init__(self, res):
29+
Exception.__init__(self, "UMAPI Error: "+str(res.status_code))
30+
self.res = res
31+
32+
33+
class UMAPIRequestError(Exception):
34+
def __init__(self, code):
35+
Exception.__init__(self, "Request Error -- %s" % code)
36+
self.code = code
37+
38+
39+
class ActionFormatError(Exception):
40+
pass

adobe_umapi/helper.py renamed to adobe_umapi_client/helper.py

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,23 @@
1+
# Copyright (c) 2016 Adobe Systems Incorporated. All rights reserved.
2+
#
3+
# Permission is hereby granted, free of charge, to any person obtaining a copy
4+
# of this software and associated documentation files (the "Software"), to deal
5+
# in the Software without restriction, including without limitation the rights
6+
# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
7+
# copies of the Software, and to permit persons to whom the Software is
8+
# furnished to do so, subject to the following conditions:
9+
#
10+
# The above copyright notice and this permission notice shall be included in all
11+
# copies or substantial portions of the Software.
12+
#
13+
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
14+
# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
15+
# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
16+
# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
17+
# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
18+
# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
19+
# SOFTWARE.
20+
121
import logging
222
from email.utils import parsedate_tz, mktime_tz
323
from math import pow

setup.py

Lines changed: 29 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,34 @@
1+
# Copyright (c) 2016 Adobe Systems Incorporated. All rights reserved.
2+
#
3+
# Permission is hereby granted, free of charge, to any person obtaining a copy
4+
# of this software and associated documentation files (the "Software"), to deal
5+
# in the Software without restriction, including without limitation the rights
6+
# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
7+
# copies of the Software, and to permit persons to whom the Software is
8+
# furnished to do so, subject to the following conditions:
9+
#
10+
# The above copyright notice and this permission notice shall be included in all
11+
# copies or substantial portions of the Software.
12+
#
13+
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
14+
# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
15+
# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
16+
# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
17+
# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
18+
# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
19+
# SOFTWARE.
20+
121
from setuptools import setup, find_packages
222

323

4-
setup(name='adobe-umapi',
5-
version='1.0.1',
6-
description='Adobe User Management API (UMAPI) client - see http://bit.ly/2hwkVrs',
24+
setup(name='adobe-umapi-client',
25+
version='1.0.0rc3',
26+
description='Adobe User Management API (UMAPI) client - see https://adobe.ly/2h1pHgV',
27+
long_description=('The Adobe User Management API (aka the Adobe UMAPI) is an Adobe-hosted network service '
28+
'which provides Adobe Enterprise customers the ability to manage their users. This '
29+
'client makes it easy to access the Adobe UMAPI from a local Python application. '
30+
'This client is open source, maintained by Adobe, and distributed under the terms '
31+
'of the OSI-approved MIT license. Copyright (c) 2016 Adobe Systems Incorporated.'),
732
classifiers=[
833
'Development Status :: 5 - Production/Stable',
934
'Programming Language :: Python :: 2.7',
@@ -12,7 +37,7 @@
1237
'Intended Audience :: Developers',
1338
'Intended Audience :: System Administrators',
1439
],
15-
url='https://github.com/adobe-apiplatform/adobe-umapi.py',
40+
url='https://github.com/adobe-apiplatform/adobe-umapi-client.py',
1641
maintainer='Daniel Brotsky',
1742
maintainer_email='[email protected]',
1843
license='MIT',

0 commit comments

Comments
 (0)