DATE:
AUTHOR:
The Duffel team
API

We've released a Python client library

DATE:
AUTHOR: The Duffel team

We’ve released a Python client library for the Duffel API! It’s available to download from PyPI here.

The client library makes it fast and easy to use our API in your Python-based applications. Instead of worrying about the ins-and-outs of sending requests and receiving responses, you can focus on building a quality product for your business.

We have full feature coverage with our API, including error handling.

We currently officially support Python versions 3.6 to 3.9. The client library should work on any versions newer than 3.9 as well. You can use pip through PyPi to easily install the client library.

$ pip install duffel-api

Using the client library is as simple as this:

from duffel_api import Duffel

access_token = 'YOUR ACCESS TOKEN'

client = Duffel(access_token = access_token)

for airline in client.airlines.list():
    print(airline.name)

We’re happy to release the code as open source as well on GitHub. To learn more about Duffel's open source philosophy, check out our blog post.

If you need any help with the library, please let us know.

Powered by LaunchNotes