Skip to main content

A straightforward, Pythonic interface for the SugarCRM API

Project description

Zucker

Tests and style linting

Zucker is a Python library for Sugar CRM with a simple, readable API. Features:

  • No dependencies (except for an HTTP client of your choice)
  • Native support for both synchronous and asyncio paradigms
  • Schema introspection that extracts supported fields from a Sugar server to speed up development
  • ORM-like feel that abstracts away details of the upstream API
  • Fully type-checked (internal and external code)

To get started, have a look at the Documentation. If you find that something is missing, feel free to open an issue.

What does it look like?

First, connect to a Sugar server. Then you can define a model that matches what you have on the backend (use the introspection features to speed up this process!):

from zucker import model, RequestsClient

crm = RequestsClient("https://crm.example.com", "zucker", "password")

class Contact(model.SyncModule, client=crm, api_name="Contacts"):
    lead_source = model.StringField()
    phone_work = model.StringField()


contacts = Contact.find(Contact.lead_source == "Word of mouth")
for contact in contacts:
    print(contact.phone_work)
print(",".join(contact.phone_work for contact in contacts[:3]))

Again, see the Documentation for more examples.

Introspection

Zucker also supports introspecting a server, which will list the available modules and fields. Use it like this:

$ python -m zucker.codegen -b "https://crm.example.com" -u "username" -c "my_client" -P inspect

See python -m zucker.codegen --help for detailed usage information.

License

MIT

Project details


Download files

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

Source Distribution

zucker-0.2.7.tar.gz (37.4 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

zucker-0.2.7-py3-none-any.whl (43.8 kB view details)

Uploaded Python 3

File details

Details for the file zucker-0.2.7.tar.gz.

File metadata

  • Download URL: zucker-0.2.7.tar.gz
  • Upload date:
  • Size: 37.4 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.4.2 importlib_metadata/4.8.1 pkginfo/1.8.1 requests/2.26.0 requests-toolbelt/0.9.1 tqdm/4.62.3 CPython/3.9.11

File hashes

Hashes for zucker-0.2.7.tar.gz
Algorithm Hash digest
SHA256 a7d2ec217e6cf5c08c4321f671330b074af96b06825721e9a47f43d35e1c7eb5
MD5 082191277305e28ef5931785f3de7760
BLAKE2b-256 b5e110729f78e2f206c7b1b021d1de2acd94c789e2bcf31f7bb2b975963b7f73

See more details on using hashes here.

File details

Details for the file zucker-0.2.7-py3-none-any.whl.

File metadata

  • Download URL: zucker-0.2.7-py3-none-any.whl
  • Upload date:
  • Size: 43.8 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.4.2 importlib_metadata/4.8.1 pkginfo/1.8.1 requests/2.26.0 requests-toolbelt/0.9.1 tqdm/4.62.3 CPython/3.9.11

File hashes

Hashes for zucker-0.2.7-py3-none-any.whl
Algorithm Hash digest
SHA256 ba1a7fce2d4259254aa54aea9eaccbf43bc5f1e8c998c3a428270a8cdcf98dde
MD5 92035685468694d38bf8a15ec4808d3e
BLAKE2b-256 d045843e55ec9170fbe75ce16531080a146cdac16690454457a8db60827de3f2

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page