Code Monkey home page Code Monkey logo

zucker's Introduction

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

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.