Coder Social home page Coder Social logo

python-pipedrive's Introduction

python-pipedrive

Python library for interacting with the pipedrive.com API

This is being developed for my specific use so there's no guarantee I'll cover all of the aspects of the Pipedrive API. Feel free to add features though, I welcome pull requests.

All features should be supported though as this is just a lightweight wrapper around the API.

Usage:

Create a Pipedrive object, passing either the api key or your username and password as the parameters

from pipedrive import Pipedrive
pipedrive = Pipedrive(USERNAME, PASSSWORD)

or

from pipedrive import Pipedrive
pipedrive = Pipedrive(API_KEY)

The rest of the functions relate to the URL as specified in the API Docs.

Do yourself a favor and try a few simple requests and look the raw responses to know what data Pipedrive's API gives you. This will aid in knowing how to deal with your responses in python code. For example, to find an organzation:

curl 'https://api.pipedrive.com/v1/organizations/find?api_token=abcd1234abcd1234abcd1234abcd1234abcd1234&term=microsoft'

which spits out something like:

{"success":true,"data":[{"id":215,"name":"Microsoft Main Organization","visible_to":"3"},{"id":360,"name":"Microsoft Subdivision Company","visible_to":"3"}],"additional_data":{"pagination":{"start":0,"limit":100,"more_items_in_collection":false}}}

The two things to note are the HTTP Method, and the path:

Examples:

  1. List the organizations

        pipedrive.organizations(method='GET')
  2. Add a New Deal

        pipedrive.deals({
        	'title': 'Big Sucker',
        	'value': 1000000,
        	'org_id': 2045,
        	'status': 'open'
       	}, method='POST')
  3. Delete an Activity

        pipedrive.activities({'id': 6789}, method='DELETE')
  4. Find a person, and use the search results. The variable term is the search term that has been passed in.

        import json
        ...
        response = pipedrive.persons_find({'term':term}, method='GET')
        results = response['data']
        suggestions = []
        if results != None:
                for result in results:
                    suggestions.append({'value': result['name'], 'data': result})
        json_response = {'query': term, 'suggestions': suggestions}
        data = json.dumps(json_response)

    And return data to some kind of javascript search result autocomplete thing (this example is formatted for devbridge's simple and easy-to-use jquery.autocomplete.js)

python-pipedrive's People

Contributors

jscott1989 avatar jayache80 avatar tukutela avatar ironslob avatar jordanh avatar skion avatar

Watchers

 avatar  avatar

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.