Git Product home page Git Product logo

restfulie-py's Introduction

restfulie-py

One minute tutorial
Hypermedia Implementation
Client
Examples
Hypermedia Examples
OpenSearch Examples

Introduction

This is a one minute guide to get you going with Restfulie Python
We are ready to go, hypermedia supported:

from restfulie import Restfulie

# using restfulie as an http api:
>>> response = Restfulie.at('http://localhost:8080/items').accepts('application/xml').get()
>>> print response.body
<items>
    <item>
        <name>Car</name>
        <price>32000.00</price>
    </item>
    <item>
        <name>House</name>
        <price>231000.00</price>
    </item>
</items>

>>> print response.code
200

# unmarshalling the items response
>>> r = response.resource()
>>> print len(r.item)
2
>>> print len(r.item[0].name)
Car

# navigating through hypermedia
# using kwargs as request parameters
>>> result = items.link("self").follow().post(name='New product', price=30)

# or, using a dict as request parameters
>>> parameters = {"name":"New product", "price":30}
>>> result = items.link("self").follow().post(**parameters)

>>> print result.code
200

This is it. Adding hypermedia capabilities and following links. Now its time to use it in the right way.

Installing Restfulie

On project root, run:

$ python setup.py install

If you like to install from pip, run:

pip install restfulie

Or with easy_install:

easy_install restfulie

Installing Restfulie for development

First, create your Makefile based on Makefile.example.

Then, make the installation:

$ make dev

The required dependencies should be installed automatically.

Running tests

On project root, run:

$ make test

To run restfulie-restbuy integration test, first start restfulie-restbuy server and run:

$ python setup.py nosetests -i "spec|should"

Team

Alexandre Atoji
Andrew Toshiaki Nakayama Kurauchi
BecaMotta
Douglas Camata
Guilherme Silveira
Hugo Lopes Tavares
Marianna Reis
Pedro Matiello
Rodrigo Manhães
Tarsis Azevedo

restfulie-py's People

Contributors

atoji avatar douglascamata avatar jnrowe avatar thiagopa avatar toshikurauchi 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.