Provides easy integration of the HAL specification for your REST Flask Applications.
Project description
Hello Dave…
I provide easy integration of the HAL specification for your REST Flask Applications.
Here is an example Dave…
# Third Party Libs
from flask import Flask
# First Party Libs
from flask_hal import HAL, document
app = Flask(__name__)
HAL(app) # Initialise HAL
@app.route('/hello')
def hello():
return document.Document(data={
'message': 'Hello World'
})
if __name__ == "__main__":
app.run(debug=True)
Here is the response from the above view.
HTTP/1.1 200 OK
Content-Type: application/hal+json; charset=UTF-8
Date: Thu, 06 Aug 2015 10:24:04 GMT
{
"_links": {
"self": {
"href": "/hello"
},
},
"foo": "bar"
}
## Contributing
Run tests using python setup.py test.
Change Log
1.0.3
Correctly deserialise embedded documents: #25
Support python setup.py test syntax: #24
1.0.2
Multiple links with the same relation will be put into an array
1.0.1
self links now take into account SERVER_NAME configuration
1.0.0
A list can be used in data for Embedded object
2015.10.8
Initial release including the core feature set
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
File details
Details for the file Flask-HAL-1.0.4.tar.gz
.
File metadata
- Download URL: Flask-HAL-1.0.4.tar.gz
- Upload date:
- Size: 6.1 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | daa0d723d0b5d3e7ac47e98283d76d652192d023b021c66fb35eab5a607a2df7 |
|
MD5 | 01576a602b4e1ff146b4f6b04dcc6907 |
|
BLAKE2b-256 | 492a3814885540bd22d737068494756b3fbd2fa025f0e7f5ac1781dfe1d13f99 |