Skip to main content

Toolkit for creating clients of HAL based Hypermedia APIs.

Project description

halchemy for Python

HAL for humans

Do you have an API that serves data following the HAL specification? The halchemy library makes it easy for your client to make the most of that API.

Getting Started

Install halchemy using the package manager of your chosen language:

pip install halchemy

In your code, create an Api object with the URL of your API.

from halchemy import Api

api = Api('http://example.org/api')

root = api.root.get()                           # get the root resource
people = api.follow(root).to('people').get()    # follow the people rel to get the list of people

# Issue a refund of $5 to everyone
for person in people['_items']:
    account = api.follow(person).to('account').get()
    api.follow(account).to('deposit').post({'amount':5.00})
    print(f"{person['name']} has a new balance of ${account['balance']}")

Read the docs to learn more!

Project details


Download files

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

Source Distributions

No source distribution files available for this release.See tutorial on generating distribution archives.

Built Distribution

halchemy-1.0.1-py3-none-any.whl (11.8 kB view hashes)

Uploaded Python 3

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