Skip to content

gavinwahl/love

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

8 Commits
 
 
 
 
 
 

Repository files navigation

Love

Love is an experimental HATEOAS client. Retrieves HTTP(S) resources and follows links found in them. Currently only supports the Link HTTP header.

TODO

  • Support more than HTTP GET
  • Support finding links in hypertext (XML + XPath?). JSON would be nice, but how does hyperlinking work without hypertext?

Goal

Given an api that looks like this:

GET /
<links>
  <link rel="users" href="/users/"/>
  <link rel="items" href="/items/"/>
</links>
GET /users/
<users>
  <user name="alice">
    <link rel="profile" href="/users/alice/"/>
  </user>
</users>
GET /users/alice/
<user>
  <city>Anytown</city>
</user>

One should be able to write something like:

>>> service = Service('http://example.com/')
>>> service.users.find('//[@name="alice"]').profile.get('//city/text()')
'Anytown'

About

Experimental HATEOAS client

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages