Skip to main content

Provides easy integration of the HAL specification for your REST Flask Applications.

Project description

circle downloads version license docs

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


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

Flask-HAL-BBVA-1.0.4.tar.gz (6.3 kB view details)

Uploaded Source

Built Distribution

Flask_HAL_BBVA-1.0.4-py3-none-any.whl (8.8 kB view details)

Uploaded Python 3

File details

Details for the file Flask-HAL-BBVA-1.0.4.tar.gz.

File metadata

File hashes

Hashes for Flask-HAL-BBVA-1.0.4.tar.gz
Algorithm Hash digest
SHA256 934cc6e0e20407455ae1d5688331e9ca408e4602e39c6de8f84471e1b1ad796f
MD5 b5e47dd899f8cf9212063f99d7f3f8dc
BLAKE2b-256 e1011afcfc78fe60aa7e10ce6f3a6723a2fa883af4ffae22d91558eb41533bea

See more details on using hashes here.

File details

Details for the file Flask_HAL_BBVA-1.0.4-py3-none-any.whl.

File metadata

File hashes

Hashes for Flask_HAL_BBVA-1.0.4-py3-none-any.whl
Algorithm Hash digest
SHA256 a093b86deca7085fb36ceffcab16835268624ee7095a65eb98c3406d4d0f3fd9
MD5 e36a58a92287362062104e6a38cedaa8
BLAKE2b-256 57082791ea6340898a5ff8f92def796c12ba3d66c75a212b93ba2d58edc51091

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page