Code Monkey home page Code Monkey logo

requests_portability's Introduction

Integracion Portabilidad Python Client

Cliente en Python para el WS RESTful de integración de portabilidad usando la librería python-requests.

Uso:

from requests_portability import *

client = PortabilityAPI(
    base_url='http://apis.yachay.pe/portabilidad/v2/',
    api_key='5c901fde-88b1-4955-bcc6-cf0ffe87fa89'
)

obj = client.get_number('7022887') # response_type='object'

print obj.customer.customer_id # 19063

obj = client.get_number('7022887', response_type='dict')

print obj # Prints response as a Python dictionary

Referencia:

class PortabilityAPI(__builtin__.object)
 |  Methods defined here:
 |  
 |  __init__(self, base_url=None, api_key=None, headers=None, home=True)
 |  
 |  __repr__(self)
 |  
 |  delete(self, endpoint, params=None, response_type='dict')
 |  
 |  expand_uri_template(self, key, **params)
 |  
 |  get(self, endpoint, params=None, response_type='dict')
 |  
 |  get_customer(self, customer_id)
 |  
 |  get_customer_numbers(self, customer_id)
 |  
 |  get_customers(self)
 |  
 |  get_home_document(self, response_type='dict')
 |  
 |  get_number(self, number_id)
 |  
 |  get_numbers(self)
 |  
 |  get_resource(self, endpoint, response_type='object')
 |  
 |  get_uri_template(self, key)
 |  
 |  has_home_document(self)
 |  
 |  load_home_document(self)
 |  
 |  post(self, endpoint, params=None, files=None, response_type='dict')
 |  
 |  process_response(self, response, response_type='dict')
 |  
 |  put(self, endpoint, params=None, files=None, response_type='dict')
 |  
 |  request(self, endpoint, method='GET', params=None, response_type='dict')
 |  
 |  ----------------------------------------------------------------------
 |  Data descriptors defined here:
 |  
 |  __dict__
 |      dictionary for instance variables (if defined)
 |  
 |  __weakref__
 |      list of weak references to the object (if defined)
 |  
 |  ----------------------------------------------------------------------
 |  Data and other attributes defined here:
 |  
 |  RESPONSE_TYPES = ('dict', 'object', 'raw', 'response')

Instrucciones de instalación:

git -c http.sslVerify=false clone https://git.yachay.pe/devteam/requests-portability.git
cd requests-portability/
python setup.py install
cd ..
rm -Rf requests-portability/

(c) 2014 - Red Científica Peruana

requests_portability's People

Watchers

eduardotaipe 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.