Python SDK for interacting with the Whaller API
Project description
Whaller Client SDK in Python
📌 Introduction
This project is a Python SDK for interacting with the Whaller API.
This library is in the early stages of implementation and contains only a few endpoints, but you can easily extend it by following the do. We encourage you to work with the Whaller teams on extending it.
📦 Installation
pip install whaller-client
🚀 Try the examples
1️⃣ Set environment variables
Before running examples scripts, you must create a env.py file with the following content as indicated in the env.orig.py file at the root of the examples folder:
BASE_URL = "https://my.whaller.com"
CLIENT_ID = "your_client_id"
CLIENT_TOKEN = "your_client_token"
LOGIN = "your_email"
PASSWORD = "your_password"
[!IMPORTANT] If you do not have client_id and client_token, please contact contact@whaller.com. Please note that there is a charge for obtaining these credentials.
2️⃣ Run an authentication example
An authentication example script is available in examples/. To run it:
cd examples/
python example_auth.py
If authentication is successful, you will see:
Authentication successful.
3️⃣ Use the SDK in your project
Minimal usage example:
from whaller_client.client import Client
from whaller_client.endpoints.persons import Persons
# Initialize the client
client = Client(BASE_URL, CLIENT_ID, CLIENT_TOKEN)
client.set_credentials(LOGIN, PASSWORD)
client.authenticate()
# Example usage of endpoints
persons = Persons(client)
print(persons.get_notifications(LOGIN))
👨💻 For Developers
Setting up the development environment
If you want to contribute to this project or modify it for your own needs, follow these steps to set up a development environment:
- Clone the repository
git clone https://github.com/whallerfr/client-python.git
cd client-python
- Create a virtual environment (recommended)
python -m venv venv
source venv/bin/activate # On Windows: venv\Scripts\activate
- Install the package in development mode
pip install -e .
- Install development dependencies
pip install pytest pytest-cov
Running the tests
The project includes a comprehensive test suite with 100% code coverage. To run the tests:
python -m pytest
To run the tests with coverage report:
python -m pytest --cov=whaller_client
To generate an HTML coverage report:
python -m pytest --cov=whaller_client --cov-report=html
The HTML report will be available in the htmlcov directory. Open htmlcov/index.html in your browser to view it.
Project structure
whaller_client/ # Main package
├── __init__.py # Package initialization
├── api.py # API client implementation
├── auth.py # Authentication handling
├── client.py # Main client class
├── exceptions.py # Custom exceptions
├── logger.py # Logging utilities
└── endpoints/ # API endpoints
├── __init__.py
├── box.py # Box resource endpoints
├── invitation.py # Invitation endpoints
├── me.py # User-related endpoints
└── upload.py # File upload endpoints
tests/ # Test suite
├── unit/ # Unit tests
│ └── whaller_client/ # Tests for main package
│ ├── endpoints/ # Tests for endpoints
│ └── ... # Tests for other modules
📄 License
This project is licensed under the MIT License. See the LICENSE file for more details.
📫 Support
For any questions or suggestions, open an issue on GitHub.
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
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file whaller_client-0.1.3.tar.gz.
File metadata
- Download URL: whaller_client-0.1.3.tar.gz
- Upload date:
- Size: 7.7 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
ebc2d992ac6c7136cde2f8d40e665e12a9344c419d9d44020e28807a354a448b
|
|
| MD5 |
92caf472650492cc66e6d86972aea358
|
|
| BLAKE2b-256 |
3e8f51d32096971d49f7fad55b43e1db8a6f5b32b5dbc6989adb8d422e8844bf
|
Provenance
The following attestation bundles were made for whaller_client-0.1.3.tar.gz:
Publisher:
python-publish.yml on whallerfr/client-python
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
whaller_client-0.1.3.tar.gz -
Subject digest:
ebc2d992ac6c7136cde2f8d40e665e12a9344c419d9d44020e28807a354a448b - Sigstore transparency entry: 658839590
- Sigstore integration time:
-
Permalink:
whallerfr/client-python@e19342550faf08715cbbec5c001e2c15893e467a -
Branch / Tag:
refs/tags/v0.1.3 - Owner: https://github.com/whallerfr
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
python-publish.yml@e19342550faf08715cbbec5c001e2c15893e467a -
Trigger Event:
release
-
Statement type:
File details
Details for the file whaller_client-0.1.3-py3-none-any.whl.
File metadata
- Download URL: whaller_client-0.1.3-py3-none-any.whl
- Upload date:
- Size: 7.2 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
3e8a113410b1814b96d7256d759d4ef3d160c7379290d7dd13f00a0fd184ca41
|
|
| MD5 |
eaa053b1b5bb0c7e93c24af5115f2a95
|
|
| BLAKE2b-256 |
7f3151d9cf5017cc03193eee98a8be3e05f70dc937916eb1fc0c05c513384f3c
|
Provenance
The following attestation bundles were made for whaller_client-0.1.3-py3-none-any.whl:
Publisher:
python-publish.yml on whallerfr/client-python
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
whaller_client-0.1.3-py3-none-any.whl -
Subject digest:
3e8a113410b1814b96d7256d759d4ef3d160c7379290d7dd13f00a0fd184ca41 - Sigstore transparency entry: 658839605
- Sigstore integration time:
-
Permalink:
whallerfr/client-python@e19342550faf08715cbbec5c001e2c15893e467a -
Branch / Tag:
refs/tags/v0.1.3 - Owner: https://github.com/whallerfr
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
python-publish.yml@e19342550faf08715cbbec5c001e2c15893e467a -
Trigger Event:
release
-
Statement type: