alma-python-client
Python API Client for the Alma API.
Support Python >= 3.8
Install
pip install alma-client
Demo
We support both a sync and async client.
Synchronous client
from alma_client import Client
alma_client = Client.with_api_key("sk_test..")
payments = alma_client.payments.fetch_all()
for p in payments:
print(f"{p.id}: Paiement en {len(p.payment_plan)} fois")
payment_data = {
"payment": {
"purchase_amount": 10000,
"return_url": "http://merchant.com/payment-success",
"shipping_address": {
"first_name": "Martin",
"last_name": "Dupond",
"line1": "1 rue de Rivoli",
"postal_code": "75004",
"city": "Paris"
}
}
}
eligibility = alma_client.payments.eligibility(payment_data)
if eligibility.eligible:
payment = alma_client.payments.create(payment_data)
print(payment.raw_data)
Asynchronous client
from alma_client import AsyncClient
alma_client = AsyncClient.with_api_key("sk_test..")
payments = await alma_client.payments.fetch_all()
for p in payments:
print(f"{p.id}: Paiement en {len(p.payment_plan)} fois")
payment_data = {
"payment": {
"purchase_amount": 10000,
"return_url": "http://merchant.com/payment-success",
"shipping_address": {
"first_name": "Martin",
"last_name": "Dupond",
"line1": "1 rue de Rivoli",
"postal_code": "75004",
"city": "Paris"
}
}
}
eligibility = await alma_client.payments.eligibility(payment_data)
if eligibility.eligible:
payment = await alma_client.payments.create(payment_data)
print(payment.raw_data)
Changelog
3.0.2 (2022-12-07)
- Fix dump for null-body requests.
3.0.1 (2022-12-05)
- Configure credentials later in the flow.
3.0.0 (2022-06-29)
Breaking change
- Move the code from the
almanamespace into thealma_clientnamespace. - Remove support for Python 3.6 and Python 3.7
2.0.2 (2022-06-22)
- Fix
potential-fraudmethod URLs (#27)
2.0.1 (2022-06-17)
- Adds
include_child_accountsandcustom_fieldsparams to the DataExport creation endpoint
2.0.0 (2021-08-12)
Breaking changes
- Move from requests to HTTPX
- Handle both sync and async python clients
- Remove support for Python 3.5
- Add support for Python 3.9
1.2.0 (2020-09-01)
- Add support for different authentication methods
- Add Black & isort checks on pull requests
1.1.0 (2020-03-25)
- Add support for Python 3.5+
1.0.1 (2020-03-24)
- Automatically detects the API mode from the api_key.
1.0.0 (2020-03-24)
- Create a Python client for Alma
- Handle Order entity for Payment
- Handle the refund endpoint
- Handle pagination for orders
- Handle the send-sms API for payments.
Metadata
Release files for alma-client 3.0.2
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| alma-client-3.0.2.tar.gz | 16.0 kB | Without provenance | Details for alma-client-3.0.2.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| alma_client-3.0.2-py3-none-any.whl | Python 3 | none | any | Details for alma_client-3.0.2-py3-none-any.whl |
Total release size: 38.3 kB
Release files / alma-client-3.0.2.tar.gz
| Download URL | alma-client-3.0.2.tar.gz |
|---|---|
| Size | 16.0 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
aa63294d77d537e5297a8c11b1e14548216e6a62ee171f97e950f09fed809343
|
|
BLAKE2b-256 checksum How to use checksums |
e0c95e03cc6a119c57b234bd856fdb004539d10c3810a7d6de15fc83640f3efe
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/4.0.2 CPython/3.11.0
|
Release files / alma_client-3.0.2-py3-none-any.whl
| Download URL | alma_client-3.0.2-py3-none-any.whl |
|---|---|
| Size | 22.3 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
361ad615b24b128f310b83b7ffeff8b1959764f9095b8f34f6ef8a18b41a80d8
|
|
BLAKE2b-256 checksum How to use checksums |
ba481142976d28801eccbfb1d64235c2b82297ab442a65468d75e5d487a99ebb
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/4.0.2 CPython/3.11.0
|
Security for alma-client 3.0.2
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.