{"id":21961677,"url":"https://github.com/vpoulailleau/pygrammalecte","last_synced_at":"2025-07-22T12:32:19.578Z","repository":{"id":62580774,"uuid":"283968402","full_name":"vpoulailleau/pygrammalecte","owner":"vpoulailleau","description":"Grammalecte, le correcteur grammatical en Python","archived":false,"fork":false,"pushed_at":"2024-11-06T15:11:15.000Z","size":74,"stargazers_count":14,"open_issues_count":4,"forks_count":5,"subscribers_count":2,"default_branch":"master","last_synced_at":"2024-11-06T16:18:56.337Z","etag":null,"topics":["french","grammalecte","grammar-checker","linter"],"latest_commit_sha":null,"homepage":"","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"bsd-3-clause","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/vpoulailleau.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2020-07-31T07:11:56.000Z","updated_at":"2024-11-06T15:11:19.000Z","dependencies_parsed_at":"2024-11-06T16:28:36.550Z","dependency_job_id":null,"html_url":"https://github.com/vpoulailleau/pygrammalecte","commit_stats":null,"previous_names":[],"tags_count":5,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/vpoulailleau%2Fpygrammalecte","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/vpoulailleau%2Fpygrammalecte/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/vpoulailleau%2Fpygrammalecte/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/vpoulailleau%2Fpygrammalecte/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/vpoulailleau","download_url":"https://codeload.github.com/vpoulailleau/pygrammalecte/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":227096616,"owners_count":17730377,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["french","grammalecte","grammar-checker","linter"],"created_at":"2024-11-29T10:17:22.709Z","updated_at":"2025-07-22T12:32:19.559Z","avatar_url":"https://github.com/vpoulailleau.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# pygrammalecte\n\n[![PyPI](https://img.shields.io/pypi/v/pygrammalecte.svg)](https://pypi.python.org/pypi/pygrammalecte)\n[![PyPI](https://img.shields.io/pypi/l/pygrammalecte.svg)](https://github.com/vpoulailleau/pygrammalecte/blob/master/LICENSE)\n[![Code style: Ruff](https://img.shields.io/badge/code%20style-ruff-000000.svg)](https://github.com/astral-sh/ruff)\n[![Downloads](https://pepy.tech/badge/pygrammalecte)](https://pepy.tech/project/pygrammalecte)\n[![Test Coverage](https://api.codeclimate.com/v1/badges/44347ade656fa1e652ae/test_coverage)](https://codeclimate.com/github/vpoulailleau/pygrammalecte/test_coverage)\n[![Maintainability](https://api.codeclimate.com/v1/badges/44347ade656fa1e652ae/maintainability)](https://codeclimate.com/github/vpoulailleau/pygrammalecte/maintainability)\n\n(english version at the bottom of this document)\n\nGrammalecte, le correcteur grammatical en Python.\n\nPour être précis, ce projet n’est pas Grammalecte, mais un « wrapper » permettant de l’utiliser facilement en Python.\n\n## Installation\n\nVous devez utiliser un Python en version supérieure ou égale à 3.9.\n\nL’utilisation d’un environnement virtuel est fortement recommandé.\n\n```sh\npython3 -m pip install pygrammalecte\n```\n\n## Utilisation\n\n### Vérification d’une chaîne de caractères\n\n```python\nfrom pygrammalecte import grammalecte_text\n\ntexte_bidon = \"\"\"\\\nCoucou, je veut du fromage.\nJe sais coder en VHDL.\nLe VHDL est est compliquer.\n\"\"\"\n\nfor message in grammalecte_text(texte_bidon):\n    print(message)\n```\n\n### Vérification d’un fichier\n\nVous devez fournir le chemin du fichier en `str` ou en `pathlib.Path`. Le fichier doit être un fichier texte brut (pas un fichier Word ou OpenDocument par exemple).\n\n```python\nfrom pathlib import Path\n\nfrom pygrammalecte import grammalecte_file\n\nfilepath = Path(\"toto.txt\")\n\nfor message in grammalecte_file(filepath):\n    print(message)\n```\n\n### Messages générés\n\nLes fonctions `grammalecte_file` et `grammalecte_text` sont des générateurs, vous pouvez donc les utiliser dans une boucle `for`. Elles génèrent des `GrammalecteMessage`.\n\nDeux types de `GrammalecteMessage` existent :\n\n- `GrammalecteSpellingMessage` qui a comme attributs :\n\n  - `line` : numéro de la ligne dans le texte vérifié\n  - `start` : numéro du caractère de début de l’erreur dans la ligne\n  - `end` : numéro du caractère de fin de l’erreur dans la ligne\n  - `word` : le mot non reconnu par `Grammalecte`\n  - `message` : message d’erreur\n\n- `GrammalecteGrammarMessage` qui a comme attributs :\n  - `line` : numéro de la ligne dans le texte vérifié\n  - `start` : numéro du caractère de début de l’erreur dans la ligne\n  - `end` : numéro du caractère de fin de l’erreur dans la ligne\n  - `url` : l’URL fournie par `Grammalecte`\n  - `color` : une couleur fournie par `Grammalecte`, c’est une liste de 3 entiers entre 0 et 255.\n  - `suggestions` : propositions de correction\n  - `message` : message d’erreur\n  - `rule` : identifiant de la règle violée\n  - `type` : type de la règle (`\"conj\"`…)\n\n## Changelog\n\n### Version 1.5.0\n\n- Amélioration du support de Windows\n\n### Version 1.4.0\n\n- Passage à `uv`\n- Compatibilité Python 3.9 à 3.13\n- Utilisation de Grammalecte v2.1.1\n\n### Version v1.3.0\n\n- Correction due à un fonctionnement étrange de Grammalecte v1.12.0\n\n### Version v1.2.0\n\n- Utilisation de Grammalecte v1.12.0\n\n### Version v1.1.0\n\n- Ajout de l'attribut `message` pour `GrammalecteSpellingMessage`\n\n### Version v1.0.0\n\n- Refactoring\n- Ajout de l'intégration continue\n\n### Version v0.1.0\n\n- Première version !\n- Utilisation de Grammalecte v1.11.0\n\n## English version\n\nThis is a wrapper for the french grammatical checker called Grammalecte.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fvpoulailleau%2Fpygrammalecte","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fvpoulailleau%2Fpygrammalecte","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fvpoulailleau%2Fpygrammalecte/lists"}