Skip to main content

jokepy 🎭

Tests PyPI version Python versions License: MIT

Mini package humour pour générer des blagues aléatoires en français.

🚀 Installation

Depuis PyPI (recommandé)

pip install jokepy

Depuis les sources

git clone https://github.com/tawounfouet/jokepy.git
cd jokepy
pip install -e .

📖 Utilisation

En tant que module Python

from jokepy import get_random_joke, get_all_categories, get_jokes_count

# Blague aléatoire
print(get_random_joke())
# "Pourquoi les plongeurs plongent-ils toujours en arrière ? Parce que sinon ils tombent dans le bateau !"

# Blague par catégorie
print(get_random_joke("sport"))

# Lister les catégories
print(get_all_categories())
# ['sport', 'travail', 'animaux', 'école']

# Compter les blagues
print(get_jokes_count())  # Total
print(get_jokes_count("sport"))  # Par catégorie

Interface en ligne de commande (CLI)

# Blague aléatoire
jokepy

# Blague par catégorie
jokepy -c sport

# Lister les catégories
jokepy --list-categories

# Compter les blagues
jokepy --count
jokepy --count sport

# Aide
jokepy --help

🎯 Fonctionnalités

  • ✅ Génération de blagues aléatoires
  • ✅ Support des catégories (sport, travail, animaux, école)
  • ✅ Interface en ligne de commande intuitive
  • ✅ API Python simple et claire
  • ✅ Type hints complets
  • ✅ Tests exhaustifs
  • ✅ Documentation complète

🏗️ Développement

Prérequis

  • Python 3.8+
  • Git

Configuration initiale

# 1. Cloner le repository
git clone https://github.com/tawounfouet/jokepy.git
cd jokepy

# 2. Créer un environnement virtuel (ESSENTIEL !)
python -m venv venv

# 3. Activer l'environnement virtuel
# Sur macOS/Linux :
source venv/bin/activate
# Sur Windows :
# venv\Scripts\activate

# 4. Installer en mode développement
make dev-install
# ou manuellement :
pip install -e ".[dev,docs]"
pre-commit install

⚠️ Important : Toujours utiliser un environnement virtuel pour éviter les conflits de dépendances !

Tests

# Lancer tous les tests
make test
# ou
pytest

# Tests avec couverture
pytest --cov=jokepy

# Tests sur plusieurs versions Python
tox

Outils de qualité

# Formatage du code
make format
# ou
black src tests
isort src tests

# Vérification du style
make lint
# ou
flake8 src tests

# Vérification des types
make type-check
# ou
mypy src

📁 Structure du projet

jokepy/
│
├── src/
│   └── jokepy/
│       ├── __init__.py          # API publique
│       ├── __main__.py          # Point d'entrée CLI
│       ├── generator.py         # Logique métier
│       └── py.typed            # Support des types
│
├── tests/
│   ├── __init__.py
│   └── test_generator.py       # Tests unitaires
│
├── docs/
│   ├── conf.py                 # Configuration Sphinx
│   ├── index.rst              # Page d'accueil
│   └── api.rst                # Documentation API
│
├── .github/
│   └── workflows/
│       ├── tests.yml           # CI/CD
│       └── publish.yml         # Publication PyPI
│
├── pyproject.toml              # Configuration moderne
├── tox.ini                     # Tests multi-versions
├── Makefile                    # Tâches automatisées
├── .pre-commit-config.yaml     # Hooks Git
├── .gitignore
├── LICENSE
├── CHANGELOG.md
└── README.md

🤝 Contribution

Les contributions sont les bienvenues ! Pour contribuer :

  1. Fork le projet
  2. Créez une branche pour votre fonctionnalité (git checkout -b feature/amazing-feature)
  3. Committez vos changements (git commit -m 'Add amazing feature')
  4. Pushez vers la branche (git push origin feature/amazing-feature)
  5. Ouvrez une Pull Request

Guidelines

  • Respectez les conventions PEP 8
  • Ajoutez des tests pour vos nouvelles fonctionnalités
  • Mettez à jour la documentation si nécessaire
  • Vérifiez que tous les tests passent

📊 Documentation

La documentation complète est disponible sur Read the Docs ou peut être construite localement :

# Construire la documentation
make docs
# ou
cd docs && make html

# Ouvrir la documentation
open docs/_build/html/index.html

📄 Licence

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

🎉 Remerciements

  • Merci à tous les contributeurs
  • Inspiré par la joie de partager de l'humour en français

Metadata

Release files for jokepykit 0.1.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for jokepykit 0.1.0
File Size Uploaded Provenance Actions
jokepykit-0.1.0.tar.gz 10.5 kB Without provenance Details for jokepykit-0.1.0.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for jokepykit 0.1.0
File Interpreter ABI Platform Actions
jokepykit-0.1.0-py3-none-any.whl Python 3 none any Details for jokepykit-0.1.0-py3-none-any.whl

Total release size: 18.2 kB

Release files / jokepykit-0.1.0.tar.gz

Download URL jokepykit-0.1.0.tar.gz
Size 10.5 kB
Tags Source
SHA-256 checksum
How to use checksums
96071330ee80d53a35eb37c9a87c801eb81e64e278d12079f763289783e05eec
BLAKE2b-256 checksum
How to use checksums
cb105a2e6ed3165dac0d7972fc92577f8ecd7085db1bf2856b83962107152bf4
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.13.12

Release files / jokepykit-0.1.0-py3-none-any.whl

Download URL jokepykit-0.1.0-py3-none-any.whl
Size 7.7 kB
Tags Python 3
SHA-256 checksum
How to use checksums
690037c8959335cda01730398cfa00470e7cf736e255abaa0222513af7f07933
BLAKE2b-256 checksum
How to use checksums
d770a8920cc0d328a6fccbff8b5f6b45fffca3353105e4dab44b79bf397c2a19
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.13.12

Security for jokepykit 0.1.0

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.

Release history Release notifications | RSS feed

This release

0.1.0 This release

2 release files No provenance

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page