Git Product home page Git Product logo

cloverly-python-module's Introduction

Cloverly Python Module

PyPI version License: MIT

The Cloverly API Python module

Usage

Requirements

You should be signed up on the Cloverly Dashboard so that you can create and manage cloverly resources.

Installation

To easily install or upgrade to the latest release, use pip.

pip3 install --upgrade cloverly-python-module
Table of Contents (click to open)
  1. Getting started
  2. Resources
  3. API Versioning
  4. Limitations

Getting Started

  1. Log in to your cloverly dashboard and grab your public API key.
  2. Set up a cloverly session using clover.CloverlyResource.activate_session like so:
import cloverly

cloverly.CloverlyResource.activate_session(api_key=API_KEY, version=API_VERSION)
  1. Now you can perform any resource actions as needed in an authenticated section
  2. It's generally best practice to clear your session once you're done like so:
cloverly.CloverlyResource.clear_session()

Resources

As of 06/08/2021, there are 4 key resource classes:

The resource classes are what allow you to create, update, delete and list resource endpoints. Resources also implement subpoints in accordance with Cloverly's API documentation. For example, the /estimates/shipping endpoint can be accessed via the Shipping sub class:

cloverly.Estimate.Shipping(_from={"zip":"35209"}, _to={"zip":"94043"})

The above code snippet would return an instance of the Estimate class. All attributes returned in the expected payload would be able to be accessed as instance attributes, like estimate.slug

API Versioning

Versioning of the API can be passed to the python module in the session activation. Essentially, this populates the following in an API url:

https://api.cloverly.com/VERSION_HERE/estimates

Limitations

Currently there is no support for:

  • asynchronous requests
  • persistent connections

cloverly-python-module's People

Contributors

zainlks avatar

Stargazers

 avatar

Watchers

 avatar

Forkers

youssef-bakr

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.