duffel-api-python icon indicating copy to clipboard operation
duffel-api-python copied to clipboard

Python client library for the Duffel API

Results 17 duffel-api-python issues
Sort by recently updated
recently updated
newest added

- offer request owner (airline) logo - offer request slice segment stops

**Describe the bug** Some validation doesn’t seem strict enough - e.g. [here](https://github.com/duffelhq/duffel-api-python/blob/main/duffel_api/api/booking/order_changes.py#L15) doesn’t check the types or allowed values passed in for currency and amount. **To Reproduce** n/a **Expected behavior**...

enhancement

**Describe the bug** To ensure that validation of attributes happens every time they're set, we should use `@property` [getters/setters](https://docs.python.org/3.5/library/functions.html?highlight=property#property) for attributes requiring validation. **To Reproduce** n/a **Expected behavior** Use `@property`...

enhancement

**Describe the bug** [Here](https://github.com/duffelhq/duffel-api-python/blob/main/duffel_api/api/booking/orders.py#L100) passes through the empty list of passengers, but [here](https://github.com/duffelhq/duffel-api-python/blob/main/duffel_api/api/booking/orders.py#L76) passes through the number (0) - but both are InvalidNumberOfX errors. **To Reproduce** n/a **Expected behavior** It’d...

enhancement

**Describe the bug** In some places, objects are created unnecessarily - e.g. [here](https://github.com/duffelhq/duffel-api-python/blob/main/duffel_api/api/booking/order_change_requests.py#L39): ```python if set(payment.keys()) != set(["amount", "currency", "type"]): ``` **To Reproduce** n/a **Expected behavior** There are slight clarity,...

enhancement

**Describe the bug** Some places use `type()` instead of `isinstance()` when checking types (e.g. [here](https://github.com/duffelhq/duffel-api-python/blob/main/duffel_api/api/booking/order_change_requests.py#L47)). Using `isinstance()` is preferred because it's [faster](https://switowski.com/blog/type-vs-isinstance) and also considers inheritance (and you’d probably want...

enhancement

**Describe the bug** In some places, `Exception` is raised - this isn't good practice as it makes it almost impossible for the users of the library to catch this specific...

bug