Coder Social home page Coder Social logo

dotloop-python's Introduction

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='[email protected]')

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

dotloop API documentation

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.

dotloop-python's People

Contributors

benr-calam avatar dependabot[bot] avatar

Stargazers

 avatar

Watchers

 avatar

Forkers

spentaur

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.