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.3.0.tar.gz (16.8 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.3.0-py3-none-any.whl (16.3 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: ml_api_client-0.3.0.tar.gz
  • Upload date:
  • Size: 16.8 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.3.0.tar.gz
Algorithm Hash digest
SHA256 f2e0491758607341e2a659706d4c6286759d4ebef21c3c07214add340b6d1575
MD5 429b7a0ff66ecf43465a1dd1200304f3
BLAKE2b-256 392a7a39392dd0748bffcdb195ce502e5fcb1135a524551cd9796f9af3b69157

See more details on using hashes here.

File details

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

File metadata

  • Download URL: ml_api_client-0.3.0-py3-none-any.whl
  • Upload date:
  • Size: 16.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.3.0-py3-none-any.whl
Algorithm Hash digest
SHA256 348c89a86f24f204a938bd279064086de2f3c416e00a70b9e05983c2d5f8934a
MD5 d4dcb63fc305e328bb228a1ac4d39033
BLAKE2b-256 5e4ce866e626683a3ee94f3f1fb789f534c032247a2026eacb055b13fed31207

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