Python wrapper around the dotloop API.
Project description
dotloop-python
Python wrapper around the dotloop API.
Quick Start
Authenticate
Start by getting access and refresh tokens.
from dotloop import Authenticate
with Authenticate('client-id', 'client-secret') as auth:
response = auth.url_for_authentication('https://example.com/redirect/')
...
# code is received
with Authenticate('client-id', 'client-secret') as auth:
response = auth.acquire_access_and_refresh_tokens(code, 'https://example.com/redirect/')
# response is a dictionary:
# {
# "access_token": "...",
# "token_type": "Bearer",
# "refresh_token": "...",
# "expires_in": ...,
# "scope": "..."
# }
Client
Then use the access token acquired to create a Client
object.
access_token = response['access_token']
client = Client(access_token)
From the Client
object, you can now access dotloop data.
For example, get data about all profiles
client.profile.get() # -> Dict
or get data about a specific profile
client.profile(<profile_id>).get()
or get all loops associated with a profile
client.profile(<profile_id>).loop.get()
or get all folders in a specific loop
client.profile(<profile_id>).loop(<loop_id>).folder.get()
or update a participant on a specific loop
client.profile(<profile_id>).loop(<loop_id>).participant(<participant_id>).patch(email='newemail@example.com')
Design Philosophy
All items accessible in the dotloop API follow a hierarchical structure as represented like this:
- Account
- Contact
- LoopIt
- Profile
- LoopTemplate
- Loop
- Activity
- Participant
- Detail
- TaskList
- Task
- Folder
- Document
The design of this wrapper was intended to emulate that while providing idiomatic ways of quickly accessing data. Endpoints and their HTTP methods are easily translated to python code.
Accessing
PATCH /profile/1/loop/1/folder/1
translates seamlessly to
client.profile(1).loop(1).folder(1).patch(...)
Inspiration was taken from dotloop-ruby and sendgrid-python.
Links
To-Do
- Account
- .get
- Activity
- .get
- Contact
- .delete
- .get
- .patch
- .post
- Detail
- .get
- .patch
- Document
- .get
- .post
- Folder
- .get
- .patch
- .post
- Loop
- .get
- .patch
- .post
- LoopIt
- .post
- LoopTemplate
- .get
- Participant
- .delete
- .get
- .patch
- .post
- Profile
- .get
- .patch
- .post
- Task
- .get
- TaskList
- .get
Disclaimer
I do not work for dotloop.
Project details
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
File details
Details for the file dotloop-python-0.0.2.tar.gz
.
File metadata
- Download URL: dotloop-python-0.0.2.tar.gz
- Upload date:
- Size: 7.2 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.2.0 pkginfo/1.5.0.1 requests/2.24.0 setuptools/44.0.0 requests-toolbelt/0.9.1 tqdm/4.48.2 CPython/3.8.2
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 23b63ddb9b48aa62890caf180c75b483656e3b2b78d05fc8cbd7ae3d90846759 |
|
MD5 | a14cca4d39438e0efc698b4c1d8447ff |
|
BLAKE2b-256 | 209ea8d145d1a010b6efd42ccda6f80a0d80a64579f26e43153f40b55ce6c021 |
File details
Details for the file dotloop_python-0.0.2-py3-none-any.whl
.
File metadata
- Download URL: dotloop_python-0.0.2-py3-none-any.whl
- Upload date:
- Size: 10.1 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.2.0 pkginfo/1.5.0.1 requests/2.24.0 setuptools/44.0.0 requests-toolbelt/0.9.1 tqdm/4.48.2 CPython/3.8.2
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 96df3814a0fa8280543a224d150042ebd903e0554c1a16eab1c585a750e0d42c |
|
MD5 | a6c08377727b786dc71110d0d301d5bb |
|
BLAKE2b-256 | 15e71a4c48776422e1b9feb6a97bea723f0ab0df04a1edc1bfc7f07fb244a751 |