Aller au contenu
Cheat Sheet
Python

[Python] Comment bien démarrer un nouveau projet ?

Quand on commence un nouveau projet, ça peut être pratique d’utiliser un template qui contient déjà tout ce qu’il faut.

La librairie cookiecutter permet de créer un nouveau projet Python en utilisant un template prédéfini.

Pour l’utiliser, il est recommandé d’utiliser pipx.

# You'll be prompted to enter values.
# Then it'll create your Python package in the current working directory,
# based on those values.
# For the sake of brevity, repos on GitHub can just use the 'gh' prefix
$ pipx run cookiecutter gh:audreyfeldroy/cookiecutter-pypackage

Il existe de nombreux templates disponibles sur GitHub.

Par exemple :

  • cookiecutter-pypackage : pour créer un package Python
  • cookiecutter-django : pour créer un un projet Django
  • cookiecutter-hypermodern-python : pour créer un projet qui utilise de outils récents (Poetry, Nox, PyTest, …).
  • sourcery-python-best-practices : le template recommandé par Sourcery.

Pour créer un nouveau projet, on utilise la commande :

cookiecutter gh:cjolowicz/cookiecutter-hypermodern-python --checkout=2022.6.3

en remplaçant avec le template et la version de son choix.

[Python] Extraire une page PDF en image
[WordPress] Protéger son répertoire « wp-admin »
cookiecutter pip python template

Articles similaires

Pylance / Pyright fait ramer…
Créer une application Android avec…
Accéder à un serveur qui…
[Python] Extraire une page PDF…
[Python] Protocol
[Python] Liste de choix en…
[Python] Benedict : une autre…
[Python] Exécuter un programme externe…
Un package Python nécessite Visual…
Publier un site Flask sur…

Catégories

  • Android
  • Calibre
  • Docker
  • Excel
  • Git
  • Google Sheet
  • Knime
  • Linux
  • Logiciels
  • Matériel
  • Non classé
  • Notepad++
  • PHP
  • Power BI
  • Programmation
  • Python
  • Qlik
  • Service
  • Synology
  • Visual Studio Code
  • VSCode
  • Windows
  • Word
  • WordPress

Étiquettes

adb android apache audio calibre convertion css debian docker drivers excel fichiers firefox flask google grep html kobo linux manette markdown mp3 notepad++ office php pip portable privoxy python qlik qliksense qlikview realtek selenium synology tor venv vim virtualenv vscode web windows wordpress xargs youtube

Tags

adb android apache audio calibre convertion css debian docker drivers excel fichiers firefox flask google grep html kobo linux manette markdown mp3 notepad++ office php pip portable privoxy python qlik qliksense qlikview realtek selenium synology tor venv vim virtualenv vscode web windows wordpress xargs youtube
Thème par Colorlib Propulsé par WordPress