Giter VIP home page Giter VIP logo

dougrain's People

Contributors

dracoblue avatar wharris avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar

dougrain's Issues

Key order

Wondering if you've considered using collections.OrderedDict to make key order somewhat predictable.

Allow force-wrapping of embedded resources in a list

I don't think the spec has a rule for this, but I could easily be wrong on this. Currently, when using Document.embed, you get a different data structure depending on whether you call it once or more often. If you iterate over, for example, a database result and want to provide a unified interface independent of the result length, you would have to have make a check like this on the server:

if len(result) == 1:
    doc.embed('rel', [result])
else:
    [doc.embed('rel', r) for r in result]

I'd like to have a flag on embed to always wrap the object in a list, even on the first call. What do you think?

Does not support draft 5.

Dougrain does not support draft 5 of the HAL spec.

The main change in draft 5 is to make explicit the Hypertext Cache Pattern, embedded resources are merely advice to the client and should not replace links.

Servers SHOULD NOT entirely "swap out" a link for an embedded
resource (or vice versa) because client support for this technique is
OPTIONAL.

Dougrain should ensure that an equivalent link exists whenever a resource is embedded in a document.

Draft 5: http://tools.ietf.org/html/draft-kelly-json-hal-05
Diffs between draft 4 and draft 5: http://tools.ietf.org/rfcdiff?url2=draft-kelly-json-hal-05.txt

Support for expanding URI templates

_links often contain URI templates[http://tools.ietf.org/html/rfc6570],

This is what I do at the moment:

the_url = uritemplate.expand( mydoc.links['myrel'].url(), { "a": b, "c": d, })

I'd like to have this functionality built into dougrain, so I can write

the_url = mydoc.links['myrel'].url(a=b, c=d)

Also, I'd have to re-read the HAL spec to figure out if there are situations where the values can be extrapolated from the document itself, so the url could expand automatically.

https://pypi.python.org/pypi/uritemplate is a great URI template library I've worked with.

CURIE maybe not working?

I have the impression, that CURIE does actually not work, they only expand to the correct url if you have a "base_uri" specified which prefixes everything.

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.