Giter Club home page Giter Club logo

sdk-python's Introduction

Edmunds API Python Wrapper

This is an awesome Python 2 wrapper for the Edmunds.com API. The Edmunds.com API provides automative data including vehicle specs, pricing, media, reviews, and more. There are also Edmunds API endpoints for dealership information and Edmunds editorial content.

Usage

Enter your Edmunds API key:

from edmunds import Edmunds
api = Edmunds('YOUR API KEY') # use Edmunds('YOUR API KEY', True) for debug mode

Make API calls to any endpoint, get a JSON object returned. For example, get the style details for the 2011 Lexus RX 350:

>>> response = api.make_call('/api/vehicle/v2/lexus/rx350/2011/styles')
>>> response
{u'styles': [{u'id': 101353967,
   u'make': {u'id': 200001623, u'name': u'Lexus', u'niceName': u'lexus'},
   u'model': {u'id': u'Lexus_RX_350',
    u'name': u'RX 350',
    u'niceName': u'rx-350'},
   u'name': u'4dr SUV (3.5L 6cyl 6A)',
   u'submodel': {u'body': u'SUV', u'modelName': u'RX 350 SUV'},
   u'trim': u'Base',
   u'year': {u'id': 100533091, u'year': 2011}},
  {u'id': 101353968,
   u'make': {u'id': 200001623, u'name': u'Lexus', u'niceName': u'lexus'},
   u'model': {u'id': u'Lexus_RX_350',
    u'name': u'RX 350',
    u'niceName': u'rx-350'},
   u'name': u'4dr SUV AWD (3.5L 6cyl 6A)',
   u'submodel': {u'body': u'SUV', u'modelName': u'RX 350 SUV'},
   u'trim': u'Base',
   u'year': {u'id': 100533091, u'year': 2011}}],
 u'stylesCount': 2}

Get photos for the style ID 3883 (1990 Honda Civic 2dr Hatchback):

>>> response = api.make_call('/v1/api/vehiclephoto/service/findphotosbystyleid', comparator='simple', styleId='3883')
>>> response
[{u'authorNames': [u'American Honda Motor Company, Inc.'],
  u'captionTranscript': u'1991 Honda Civic 2 Dr Si Hatchback',
  u'photoSrcs': [u'/honda/civic/1991/oem/1991_honda_civic_2dr-hatchback_si_fq_oem_1_131.jpg',
   u'/honda/civic/1991/oem/1991_honda_civic_2dr-hatchback_si_fq_oem_1_396.jpg',
   u'/honda/civic/1991/oem/1991_honda_civic_2dr-hatchback_si_fq_oem_1_300.jpg',
   u'/honda/civic/1991/oem/1991_honda_civic_2dr-hatchback_si_fq_oem_1_400.jpg',
   u'/honda/civic/1991/oem/1991_honda_civic_2dr-hatchback_si_fq_oem_1_500.jpg',
   u'/honda/civic/1991/oem/1991_honda_civic_2dr-hatchback_si_fq_oem_1_185.jpg',
   u'/honda/civic/1991/oem/1991_honda_civic_2dr-hatchback_si_fq_oem_1_175.jpg',
   u'/honda/civic/1991/oem/1991_honda_civic_2dr-hatchback_si_fq_oem_1_196.jpg',
   u'/honda/civic/1991/oem/1991_honda_civic_2dr-hatchback_si_fq_oem_1_423.jpg',
   u'/honda/civic/1991/oem/1991_honda_civic_2dr-hatchback_si_fq_oem_1_276.jpg',
   u'/honda/civic/1991/oem/1991_honda_civic_2dr-hatchback_si_fq_oem_1_87.jpg',
   u'/honda/civic/1991/oem/1991_honda_civic_2dr-hatchback_si_fq_oem_1_150.jpg',
   u'/honda/civic/1991/oem/1991_honda_civic_2dr-hatchback_si_fq_oem_1_98.jpg'],
  u'shotTypeAbbreviation': u'FQ',
  u'subType': u'exterior',
  u'type': u'PHOTOS'}]

Installation

The Edmunds API Python wrapper requires the amazing requests library. Here are the installation instructions and the source code.

To install using pip:

pip install edmunds or pip install git+https://github.com/EdmundsAPI/sdk-python

Then:

git clone https://github.com/EdmundsAPI/sdk-python.git or just click "Clone in Desktop" or "Download ZIP"

Install

Notes:

  • Using pip to install this package will atuomatically install the requests library
  • The files (edmunds.py and tests.py) will be installed to your Python site-packages folder
  • It is suggested you then clone the repository (using the second command) in order to download all of the files to your computer and so that you can insert your API Key into the edmunds.py code

Contents

sdk-python/
   .gitignore
   AUTHORS.md # Info about development and how to contribute
   HISTORY.md # Version history
   LICENSE
   MANIFEST
   MANIFEST.in
   README.md # You're looking at it!
   requirements.txt
   setup.py
   edmunds/
      examples/ # Examples of using the SDK
         README.md
         media_photos.py
         spec_make.py
      __init__.py
      edmunds.py # The source code for the SDK
      tests.py

Issues

Please submit any problems, requests, and comments here.

SDK Status

This is a beta release. We have opened sourced it at this stage to guide the development of the library and allow you to freely inspect and use the source.

Documentation

The Edmunds API documentation can be found here.

License

Licensed under the Apache v2 License.

sdk-python's People

Contributors

michaelrbock avatar theoryno3 avatar

Stargazers

 avatar

Watchers

 avatar  avatar

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.