🇫🇷 Ce script Python automatise le comptage des mots et le calcul du temps de lecture pour vos chapitres directement dans une base de données Notion.
🇬🇧 This Python script automates word counting and reading time calculation for your chapters directly in a Notion database.
Votre base de données doit contenir ces deux colonnes (Attention : les noms doivent être exacts) :
Nb Mots(Type: Nombre)Temps de lecture(Type: Texte)
💡 Note : Si vous changez ces noms dans Notion, vous devrez également les modifier dans le code Python.
- Créer une clé d'intégration : Allez sur notion.so/my-integrations.
- Autoriser l'accès : Dans Notion, sur votre page de base de données, cliquez sur
...>Connecter à> Sélectionnez votre intégration. - Installer les dépendances :
pip install httpx
- Configuration du script : Ouvrez
NbMots.pyet remplissez vos clés :NOTION_TOKEN = "VOTRE_SECRET_ICI"DATABASE_ID = "VOTRE_ID_DE_BASE_ICI"
Pour garder un bureau propre et lancer la mise à jour en un clic sans ouvrir de code :
- Créez un fichier
Lancer.batavec le bloc-notes contenant ceci :@echo off python "C:\CHEMIN\VERS\VOTRE\SCRIPT\NbMots.py" pause
- Créez un raccourci de ce fichier sur votre bureau.
- Faites un clic droit sur le raccourci > Propriétés.
- Dans le champ Cible, ajoutez
cmd /cau tout début de la ligne. - Changez l'icône si vous le souhaitez, puis faites un clic droit > Épingler à la barre des tâches.
- Vous pouvez maintenant supprimer le raccourci du bureau.
Your database must include these two columns:
- Nb Mots (Type:
Number) - Temps de lecture (Type:
Text)
💡 Note: If you change these names in Notion, you must update the variable names inside the Python code.
- Integration Key: Create your token at notion.so/my-integrations.
- Grant Access: In Notion, on your database page, click
...>Connect to> Select your integration. - Dependencies:
pip install httpx
- **Configuration: Fill in your NOTION_TOKEN and DATABASE_ID inside the script.
-
** Create a
Rub.batfile with the path to your script:@echo off python "C:\PATH\TO\YOUR\SCRIPT\NbMots.py" pause
-
Create a desktop shortcut for this file.
-
Right-click > Properties. In the Target field, add
cmd /cat the very beginning. -
Right-click > Pin to taskbar. You can then delete the desktop shortcut.
🇫🇷 Les contributions sont les bienvenues !
-
Forkez le projet.
-
Créez votre branche (
git checkout -b feature/Amelioration). -
Commitez vos changements (
git commit -m 'Ajout de fonctionnalité'). -
Ouvrez une Pull Request.
🇬🇧 Contributions make the open-source community amazing!
-
Fork the Project.
-
Create you Feature Branch (
git checkout -b feature/Amelioration). -
Commit your changes (
git commit -m 'Ajout de fonctionnalité'). -
Open a Pull Request.