Skip to main content
https://img.shields.io/travis/Feverup/pysugarcrm.svg https://img.shields.io/pypi/v/pysugarcrm.svg

Python API Wrapper for SugarCRM v10

Quickstart

$ pip install pysugarcrm
from pysugarcrm import SugarCRM
api = SugarCRM('https://yourdomain.sugaropencloud.eu', 'youruser', 'yourpassword')

# Return info about current user
api.me

# 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'John.doe@domain.com',
     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'alice@domain.com',
     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
api.post('/Leads', json={'first_name': 'John', 'last_name': 'Smith', 'business_name_c': 'Test John', 'contact_email_c': 'john@smith.com'})

Context manager (new in 0.1.4)

from pysugarcrm import sugar_api

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

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

Features

  • OAuth2 authentication with username and password

  • Context processor with auto-logout (new in 0.1.4)

TODO

  • Add more auxiliary methods/properties

  • Build documentation

History

0.1.0 (2015-09-09)

  • First release on PyPI.

0.1.1(2015-09-10)

  • More direct import from pysugarcrm import SugarCRM

  • Added some tests

0.1.2(2016-03-17)

  • Added POST and PUT methods

  • Improved error handling

0.1.3(2016-03-29)

  • Added platform parameter to constructor

0.1.4(2016-03-30)

  • Added close method and context manager for easier usage

1.0.0(2016-03-30)

  • Python 3 tests passing

1.0.1(2018-03-09)

  • Python 3 import fixes

1.0.2(2019-01-24)

  • Remove future library dependency

1.0.3(2021-09-06)

  • Fixed misleading error when Sugar connexion is not performed successfully

Metadata

Release files for pysugarcrm 1.0.3

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for pysugarcrm 1.0.3
File Size Uploaded
pysugarcrm-1.0.3.tar.gz 14.8 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for pysugarcrm 1.0.3
File Interpreter ABI Platform
pysugarcrm-1.0.3-py2.py3-none-any.whl Python 3, Python 2 none any Details

Total release size: 21.1 kB

Release files / pysugarcrm-1.0.3.tar.gz

Download URL pysugarcrm-1.0.3.tar.gz
Size 14.8 kB
Tags Source
SHA-256 checksum
How to use checksums
d7f334f11fdeb392b5d12cacd67d2183dcb6b0a81ed7afbafe7229538d38845e
BLAKE2b-256 checksum
How to use checksums
6a1b6dd3c9d1c1973c17dbb36ec4b751aec38513eaf385940db2fba69596027b
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/3.4.2 importlib_metadata/4.8.1 pkginfo/1.7.1 requests/2.26.0 requests-toolbelt/0.9.1 tqdm/4.62.2 CPython/3.6.13

Release files / pysugarcrm-1.0.3-py2.py3-none-any.whl

Download URL pysugarcrm-1.0.3-py2.py3-none-any.whl
Size 6.3 kB
Tags Python 2 Python 3
SHA-256 checksum
How to use checksums
e945ee2aac0f967b3dae851afbcf15b1d104ae56a3108652a336befc6c2d9026
BLAKE2b-256 checksum
How to use checksums
7d1c74d6a9e2e036373b38d50a8eb65026b9abe92d886fd2681fd6244e395847
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/3.4.2 importlib_metadata/4.8.1 pkginfo/1.7.1 requests/2.26.0 requests-toolbelt/0.9.1 tqdm/4.62.2 CPython/3.6.13

Release history Release notifications | RSS feed

This release

1.0.3 This release

2 release files

1.0.2

1 release file

1.0.1

1 release file

1.0.0

1 release file

0.1.4

1 release file

0.1.3

1 release file

0.1.2

1 release file

0.1.1

2 release files

0.1.0

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page