dotloop-python
Python wrapper around the dotloop API.
Quick Start
Authenticate
Start by getting access and refresh tokens.
from dotloop import Authenticate
auth = Authenticate('dotloop-client-id', 'dotloop-client-secret')
url = auth.url_for_authentication('https://example.com/redirect/')
...
# code is received
with 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 (i.e. profiles have loops which have folders which have documents) 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
with data
{
"name": "Disclosures (renamed)"
}
translates seamlessly to
client.profile(1).loop(1).folder(1).patch(name='Disclosures (renamed)')
Note: if data keys ever have spaces then those keys can be included by unpacking a dictionary e.g.
client.profile(1).loop(1).detail.patch(**{'Property Information': {...}})
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
-
Better typing
-
Better passing of parameters
-
Async
-
Better handling of request sessions
-
Better exception handling
-
Better documentation
-
Unit tests
import asyncio
import aiohttp
import dotloop
async def main():
async with aiohttp.ClientSession() as s:
async with s.post()
if __name__ == '__main__':
main()
Disclaimer
I do not work for dotloop nor for Zillow.
Metadata
Release files for dotloop-python 0.1.1
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| dotloop-python-0.1.1.tar.gz | 12.7 kB | Without provenance | Details for dotloop-python-0.1.1.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| dotloop_python-0.1.1-py3-none-any.whl | Python 3 | none | any | Details for dotloop_python-0.1.1-py3-none-any.whl |
Total release size: 34.6 kB
Release files / dotloop-python-0.1.1.tar.gz
| Download URL | dotloop-python-0.1.1.tar.gz |
|---|---|
| Size | 12.7 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
4567f0f3f842cad26a8fd29ef6cd2163551f2749e59167e9a8886d1a9a8c2278
|
|
BLAKE2b-256 checksum How to use checksums |
8ccc2ed66ddddf390b9a6f23b4f947385fb4968ab268272284db95c94bbdeec9
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/3.3.0 pkginfo/1.7.0 requests/2.25.1 setuptools/52.0.0 requests-toolbelt/0.9.1 tqdm/4.58.0 CPython/3.9.0+
|
Release files / dotloop_python-0.1.1-py3-none-any.whl
| Download URL | dotloop_python-0.1.1-py3-none-any.whl |
|---|---|
| Size | 21.9 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
694d055b82c5fdeaa850a8ee9d257bad68dec39fcf7cd9b481060e649c3f43a9
|
|
BLAKE2b-256 checksum How to use checksums |
d81d9c6d2b098d2aef4fcfb4299921fc7e2c55c810435d2f4e1902543bc7af52
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/3.3.0 pkginfo/1.7.0 requests/2.25.1 setuptools/52.0.0 requests-toolbelt/0.9.1 tqdm/4.58.0 CPython/3.9.0+
|
Security for dotloop-python 0.1.1
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.