Skip to main content

A Python client for interacting with Mathis LAMBERT's API

Project description

API Client

ml_api_client est une bibliothèque Python conçue pour faciliter l'interaction avec l'API de Mathis LAMBERT. Elle utilise aiohttp pour gérer les requêtes HTTP de manière asynchrone, ce qui la rend idéale pour les applications nécessitant des performances élevées et une gestion efficace des connexions simultanées.

Fonctionnalités

  • Connexion asynchrone : Utilise aiohttp pour des requêtes HTTP non bloquantes.
  • Facile à utiliser : API simple et intuitive pour une intégration rapide dans vos projets.
  • Authentification sécurisée : Supporte l'authentification par jeton et clé API.
  • Gestion des sessions : Support des cookies et des en-têtes personnalisés.
  • Modèles Pydantic : Utilisation de modèles Pydantic pour la validation et la gestion des données.

Installation

Pour installer ml_api_client, utilisez pip :

pip install ml_api_client

Utilisation

Voici un exemple de base pour utiliser ml_api_client dans votre projet :

import asyncio
from ml_api_client import APIClient


async def main():
    # Initialisez le client avec l'URL de base de votre API
    client = APIClient(api_key="your_api_key")

    # Effectuez une requête de connexion asynchrone
    response = await client.auth.login(username="your_username", password="your_password")
    print(response)


# Exécutez la fonction principale
asyncio.run(main())

Configuration

Vous pouvez configurer APIClient avec différentes options :

  • base_url : L'URL de base de votre API.
  • api_key : Clé API pour l'authentification.
  • headers : En-têtes HTTP personnalisés.
  • timeout : Délai d'attente pour les requêtes.
client = APIClient(
    base_url="https://api.mathislambert.fr/v1",
    api_key="your_api_key",
    headers={"Authorization": "Bearer YOUR_TOKEN"},
    timeout=10
)

Contribution

Les contributions sont les bienvenues ! Pour contribuer :

  1. Forkez le dépôt.
  2. Créez une branche pour votre fonctionnalité (git checkout -b feature/new-feature).
  3. Commitez vos modifications (git commit -am 'Add new feature').
  4. Poussez vers la branche (git push origin feature/new-feature).
  5. Ouvrez une Pull Request.

Licence

Ce projet est sous licence MIT. Voir le fichier LICENSE pour plus de détails.

Contact

Pour toute question ou suggestion, n'hésitez pas à ouvrir une issue ou à contacter l'auteur :

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

ml_api_client-0.2.0.tar.gz (13.7 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

ml_api_client-0.2.0-py3-none-any.whl (13.3 kB view details)

Uploaded Python 3

File details

Details for the file ml_api_client-0.2.0.tar.gz.

File metadata

  • Download URL: ml_api_client-0.2.0.tar.gz
  • Upload date:
  • Size: 13.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.13.3

File hashes

Hashes for ml_api_client-0.2.0.tar.gz
Algorithm Hash digest
SHA256 046eeaaf0526f3f0dc415148080b2a4b9975973bb227e109a0b4a11339999b8d
MD5 d0d93d21754d9d4539eeda7e5bd08ef6
BLAKE2b-256 ce9cb1df59a504d44f67d79ffcb413a5bf54a4af82b098ebc647f43d33f0872a

See more details on using hashes here.

File details

Details for the file ml_api_client-0.2.0-py3-none-any.whl.

File metadata

  • Download URL: ml_api_client-0.2.0-py3-none-any.whl
  • Upload date:
  • Size: 13.3 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.13.3

File hashes

Hashes for ml_api_client-0.2.0-py3-none-any.whl
Algorithm Hash digest
SHA256 9c150b77d6a1a1ba24e356f0cbf4c19602eeb8855a5d95bff9fb5c43cfccabfd
MD5 24955d3d76b3d6010ca0d27de92d8d9a
BLAKE2b-256 ca4f39283f44613c563a20fae20fb3a04714ff48be704cd05f169804b944a1d7

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page