Giter Site home page Giter Site logo

reso-webapi-client-python's Introduction

DEPRECATION NOTICE

RESO is no longer maintaining or supporting this codebase.

Developers should be using popular OAuth2 and HTTP libraries specific to their platforms instead.

If you are actively using this library and would like to "adopt" it, please contact [email protected].

This repository will be made private after August 1, 2021.

RESO SDK Python

This is a client library to interface with a RESO certified Web API server. For more information on the Real Estate Standards Organization (RESO) please visit www.reso.org or contact [email protected]. Developers wishing to better understand how to use and contribute to our standards visit RESO Developers FAQ.

Specific questions about this repository should be posted to the 'Issues' section with the Issue Template.

All documentation can be found in -docs folder.

Requirements

Python 3.6 and later.

PIP

Install package via pip:

pip install git+https://github.com/RESOStandards/RESO-WebAPI-Client-Python.git

Dependencies

The following Python extensions are required for all the RESO WebAPI Client Python SDK functions to work properly:

Getting Started

Simple usage looks like:

# Set the variables
reso = RESO(
        client_id='YOUR_CLIENT_ID',
        client_secret='YOUR_CLIENT_SECRET',
        api_auth_url='https://op.api.crmls.org/identity/connect/authorize',
        api_token_url='https://op.api.crmls.org/identity/connect/token',
        api_request_url='https://h.api.crmls.org/RESO/OData/'
    )
# Authorize user
req_obj = OpenIDAuthentication(
        redirect_uri='https://openid.reso.org/',
        scope='ODataApi',
        reso=reso
    )
# Get access token
req_obj.auth_code = req_obj.authorize('USERNAME', 'PASSWORD')
reso.access_token = req_obj.request_access_token()
# Retrieve top 10 properties from the RESO API endpoint
http_request = HttpRequest(reso=reso)
result = http_request.request('Property?$top=10', 'json')

# Display records
print(result);

Example apps

Several usage examples are provided in the examples/ folder:

  • cli-example - provides a sample console application to query RESO API data;

To configure the example app variables / settings - fill config.json file.

Configuring a Logger

The SDK has a built-in logger for debug / testing purposes. Usage:

# Set logging. Logger is enabled by default
reso.disable_logger() # disables logger
reso.enable_logger() # enables logger
reso.set_logging_level('debug') # sets logging level. Possible values: 'debug', 'info', 'warning'

Unit Tests

The SDK code set contains Python unit tests. The tests reside in the tests/ folder and covers core RESO WebAPI Client Python SDK functionality testing.

To run the tests fill the tests/config.json file with the appropriate API variables. Then, execute:

python setup.py test

Contributing

Please read the contributing guidelines if You are interested in contributing to the project.

reso-webapi-client-python's People

Contributors

bobgott avatar justinask7 avatar darnjo avatar mindaugaskiznis avatar dependabot[bot] 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.