Skip to main content
This is a pre-production deployment of Warehouse. Changes made here affect the production instance of PyPI (
Help us improve Python packaging - Donate today!

API Wrapper for SugarCRM v10

Project Description

Python API Wrapper for SugarCRM v10


$ pip install pysugarcrm
from pysugarcrm import SugarCRM
api = SugarCRM('', 'youruser', 'yourpassword')

# Return info about current user

# A more complex query requesting employees
api.get('/Employees', query_params={'max_num': 2, 'offset': 2, 'fields': 'user_name,email'})

{u'next_offset': 4,
 u'records': [{u'_acl': {u'fields': {}},
   u'_module': u'Employees',
   u'date_modified': u'2015-09-09T13:40:32+02:00',
   u'email': [{u'email_address': u'',
     u'invalid_email': False,
     u'opt_out': False,
     u'primary_address': True,
     u'reply_to_address': False}],
   u'id': u'12364218-7d79-80e0-4f6d-35ed99a8419d',
   u'user_name': u'john.doe'},
  {u'_acl': {u'fields': {}},
   u'_module': u'Employees',
   u'date_modified': u'2015-09-09T13:39:54+02:00',
   u'email': [{u'email_address': u'',
     u'invalid_email': False,
     u'opt_out': False,
     u'primary_address': True,
     u'reply_to_address': False}],
   u'id': u'a0e117c0-9e46-aebf-f71a-55ed9a2b4731',
   u'user_name': u'alice'}]}

# Generate a Lead'/Leads', json={'first_name': 'John', 'last_name': 'Smith', 'business_name_c': 'Test John', 'contact_email_c': ''})

Context manager (new in 0.1.4)

from pysugarcrm import sugar_api

with sugar_api('', "admin", "12345") as api:
    data = api.get('/Employees', query_params={'max_num': 2, 'offset': 2, 'fields': 'user_name,email'})'/Leads', json={'first_name': 'John', 'last_name': 'Smith', 'business_name_c': 'Test John', 'contact_email_c': ''})

# Once we exit the context manager the sugar connection is closed and the user is logged out


  • OAuth2 authentication with username and password
  • Context processor with auto-logout (new in 0.1.4)


  • Add more auxiliary methods/properties
  • Build documentation


0.1.0 (2015-09-09)

  • First release on PyPI.


  • More direct import from pysugarcrm import SugarCRM
  • Added some tests


  • Added POST and PUT methods
  • Improved error handling


  • Added platform parameter to constructor


  • Added close method and context manager for easier usage


  • Python 3 tests passing
Release History

Release History

This version
History Node


History Node


History Node


History Node


History Node


History Node


Download Files

Download Files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

File Name & Checksum SHA256 Checksum Help Version File Type Upload Date
pysugarcrm-1.0.0.tar.gz (13.2 kB) Copy SHA256 Checksum SHA256 Source Mar 30, 2016

Supported By

WebFaction WebFaction Technical Writing Elastic Elastic Search Pingdom Pingdom Monitoring Dyn Dyn DNS Sentry Sentry Error Logging CloudAMQP CloudAMQP RabbitMQ Heroku Heroku PaaS Kabu Creative Kabu Creative UX & Design Fastly Fastly CDN DigiCert DigiCert EV Certificate Rackspace Rackspace Cloud Servers DreamHost DreamHost Log Hosting