pyLanguagetool


NamepyLanguagetool JSON
Version 0.10.1 PyPI version JSON
download
home_pageNone
SummaryA python library and CLI for the LanguageTool JSON API
upload_time2024-07-20 21:40:33
maintainerNone
docs_urlNone
authorNone
requires_python>=3.8
licenseMIT
keywords languagetool spell grammar checker
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage No coveralls.
            ==============
pyLanguagetool
==============
|license| |latestrelease| |pypi_versions|

A python library and CLI for the LanguageTool_ `JSON API`_.

LanguageTool_ is an open source spellchecking platform. It supports a large
variety of languages and has advanced grammar support.

.. image:: https://pylanguagetool.lw1.at/_images/screenshot.png

.. start-of-homepage-text

Installation
------------
pyLanguagetool can be installed with pip/pipenv:

.. code:: bash

    pip install pylanguagetool
    # or via pipenv
    pipenv install pylanguagetool

Basic Usage
-----------
.. code:: bash

    # pipe text to pylanguagetool
    echo "This is a example" | pylanguagetool

    # read text from a file
    pylanguagetool textfile.txt

    # read text from stdin
    pylanguagetool < textfile.txt

    # read text from the systems clipboard
    pylanguagetool -c # get text from system clipboard

All samples above will return a list of detected errors and possible
replacements.

.. code::

    # Use "an" instead of 'a' if the following word starts with a vowel sound, e.g. 'an article', 'an hour'
    #   ✗ This is a example
    #             ^
    #   ✓ This is an example



Configuration
-------------
All `LanguageTool API`_ parameters can be set via command line arguments,
environment variables or a configuration file
(``~/.config/pyLanguagetool.conf``) For more information about the
configuration file syntax, read the `ConfigArgParse documentation`_.

Privacy
-------

By default, pyLanguagetool sends all text via HTTPS to the `LanguageTool`_
server (see their `privacy policy`_). You can also `set up your own server`_ and
use it by changing the ``--api-url`` attribute.

Parameters
----------

.. code::

    $ pylanguagetool --help
    usage: pylanguagetool [-h] [-V] [-v] [-a API_URL] [--no-color] [-c] [-s]
                          [-t {txt,html,md,markdown,rst,ipynb,json,xliff}] [-u] [-r]
                          [--rule-categories] [-l LANG] [-m MOTHER_TONGUE]
                          [-p PREFERRED_VARIANTS] [-e ENABLED_RULES]
                          [-d DISABLED_RULES]
                          [--enabled-categories ENABLED_CATEGORIES]
                          [--disabled-categories DISABLED_CATEGORIES]
                          [--enabled-only] [--picky] [--pwl PWL]
                          [input file]

    positional arguments:
      input file            input file

    options:
      -h, --help            show this help message and exit
      -V, --version         print version and exit
      -v, --verbose         verbose output [env var: VERBOSE]
      -a API_URL, --api-url API_URL
                            the URL of the v2 languagetool API, should end with
                            '/v2/' [env var: API_URL]
      --no-color            don't color output [env var: NO_COLOR]
      -c, --clipboard       get text from system clipboard [env var: CLIPBOARD]
      -s, --single-line     check every line on its own [env var: SINGLE_LINE]
      -t {txt,html,md,markdown,rst,ipynb,json,xliff}, --input-type {txt,html,md,markdown,rst,ipynb,json,xliff}
                            if not plaintext [env var: INPUT_TYPE]
      -u, --explain-rule    print URLs with more information about rules [env var:
                            EXPLAIN_RULE]
      -r, --rules           show the matching rules [env var: RULES]
      --rule-categories     show the the categories of the matching rules [env var:
                            RULE_CATEGORIES]
      -l LANG, --lang LANG  A language code like en or en-US, or auto to guess the
                            language automatically (see preferredVariants below).
                            For languages with variants (English, German,
                            Portuguese) spell checking will only be activated when
                            you specify the variant, e.g. en-GB instead of just en.
                            [env var: TEXTLANG]
      -m MOTHER_TONGUE, --mother-tongue MOTHER_TONGUE
                            A language code of the user's native language, enabling
                            false friends checks for some language pairs. [env var:
                            MOTHER__TONGUE]
      -p PREFERRED_VARIANTS, --preferred-variants PREFERRED_VARIANTS
                            Comma-separated list of preferred language variants. The
                            language detector used with language=auto can detect
                            e.g. English, but it cannot decide whether British
                            English or American English is used. Thus this parameter
                            can be used to specify the preferred variants like en-GB
                            and de-AT. Only available with language=auto. [env var:
                            PREFERRED_VARIANTS]
      -e ENABLED_RULES, --enabled-rules ENABLED_RULES
                            IDs of rules to be enabled, comma-separated [env var:
                            ENABLED_RULES]
      -d DISABLED_RULES, --disabled-rules DISABLED_RULES
                            IDs of rules to be disabled, comma-separated [env var:
                            DISABLED_RULES]
      --enabled-categories ENABLED_CATEGORIES
                            IDs of categories to be enabled, comma-separated [env
                            var: ENABLED_CATEGORIES]
      --disabled-categories DISABLED_CATEGORIES
                            IDs of categories to be disabled, comma-separated [env
                            var: DISABLED_CATEGORIES]
      --enabled-only        enable only the rules and categories whose IDs are
                            specified with --enabled-rules or --enabled-categories
      --picky               if enabled, additional rules will be activated
      --pwl PWL, --personal-word-list PWL
                            File name of personal dictionary. A private dictionary
                            can be used to add special words that would otherwise be
                            marked as spelling errors. [env var: PERSONAL_WORD_LIST]

    Args that start with '--' can also be set in a config file
    (~/.config/pyLanguagetool.conf). Config file syntax allows: key=value,
    flag=true, stuff=[a,b,c] (for details, see syntax at
    https://pypi.org/project/ConfigArgParse/). In general, command-line values
    override environment variables which override config file values which override
    defaults.


.. |license| image:: https://img.shields.io/badge/license-MIT-blue.svg
    :target: https://raw.githubusercontent.com/Findus23/pyLanguagetool/master/LICENSE
.. |latestrelease| image:: https://img.shields.io/pypi/v/pyLanguagetool.svg
    :target: https://pypi.python.org/pypi/pyLanguagetool
    :alt: Latest Version
.. |pypi_versions| image:: https://img.shields.io/pypi/pyversions/pylanguagetool.svg
    :target: https://pypi.python.org/pypi/pyLanguagetool

.. _LanguageTool: https://languagetool.org/

.. _JSON API: https://languagetool.org/http-api/swagger-ui/#/default

.. _LanguageTool API: https://languagetool.org/http-api/swagger-ui/#/default

.. _ConfigArgParse documentation: https://github.com/bw2/ConfigArgParse#config-file-syntax

.. _privacy policy: https://languagetool.org/privacy/

.. _set up your own server: https://dev.languagetool.org/http-server

            

Raw data

            {
    "_id": null,
    "home_page": null,
    "name": "pyLanguagetool",
    "maintainer": null,
    "docs_url": null,
    "requires_python": ">=3.8",
    "maintainer_email": null,
    "keywords": "languagetool, spell, grammar, checker",
    "author": null,
    "author_email": "Lukas Winkler <python@lw1.at>",
    "download_url": null,
    "platform": null,
    "description": "==============\npyLanguagetool\n==============\n|license| |latestrelease| |pypi_versions|\n\nA python library and CLI for the LanguageTool_ `JSON API`_.\n\nLanguageTool_ is an open source spellchecking platform. It supports a large\nvariety of languages and has advanced grammar support.\n\n.. image:: https://pylanguagetool.lw1.at/_images/screenshot.png\n\n.. start-of-homepage-text\n\nInstallation\n------------\npyLanguagetool can be installed with pip/pipenv:\n\n.. code:: bash\n\n    pip install pylanguagetool\n    # or via pipenv\n    pipenv install pylanguagetool\n\nBasic Usage\n-----------\n.. code:: bash\n\n    # pipe text to pylanguagetool\n    echo \"This is a example\" | pylanguagetool\n\n    # read text from a file\n    pylanguagetool textfile.txt\n\n    # read text from stdin\n    pylanguagetool < textfile.txt\n\n    # read text from the systems clipboard\n    pylanguagetool -c # get text from system clipboard\n\nAll samples above will return a list of detected errors and possible\nreplacements.\n\n.. code::\n\n    # Use \"an\" instead of 'a' if the following word starts with a vowel sound, e.g. 'an article', 'an hour'\n    #   \u2717 This is a example\n    #             ^\n    #   \u2713 This is an example\n\n\n\nConfiguration\n-------------\nAll `LanguageTool API`_ parameters can be set via command line arguments,\nenvironment variables or a configuration file\n(``~/.config/pyLanguagetool.conf``) For more information about the\nconfiguration file syntax, read the `ConfigArgParse documentation`_.\n\nPrivacy\n-------\n\nBy default, pyLanguagetool sends all text via HTTPS to the `LanguageTool`_\nserver (see their `privacy policy`_). You can also `set up your own server`_ and\nuse it by changing the ``--api-url`` attribute.\n\nParameters\n----------\n\n.. code::\n\n    $ pylanguagetool --help\n    usage: pylanguagetool [-h] [-V] [-v] [-a API_URL] [--no-color] [-c] [-s]\n                          [-t {txt,html,md,markdown,rst,ipynb,json,xliff}] [-u] [-r]\n                          [--rule-categories] [-l LANG] [-m MOTHER_TONGUE]\n                          [-p PREFERRED_VARIANTS] [-e ENABLED_RULES]\n                          [-d DISABLED_RULES]\n                          [--enabled-categories ENABLED_CATEGORIES]\n                          [--disabled-categories DISABLED_CATEGORIES]\n                          [--enabled-only] [--picky] [--pwl PWL]\n                          [input file]\n\n    positional arguments:\n      input file            input file\n\n    options:\n      -h, --help            show this help message and exit\n      -V, --version         print version and exit\n      -v, --verbose         verbose output [env var: VERBOSE]\n      -a API_URL, --api-url API_URL\n                            the URL of the v2 languagetool API, should end with\n                            '/v2/' [env var: API_URL]\n      --no-color            don't color output [env var: NO_COLOR]\n      -c, --clipboard       get text from system clipboard [env var: CLIPBOARD]\n      -s, --single-line     check every line on its own [env var: SINGLE_LINE]\n      -t {txt,html,md,markdown,rst,ipynb,json,xliff}, --input-type {txt,html,md,markdown,rst,ipynb,json,xliff}\n                            if not plaintext [env var: INPUT_TYPE]\n      -u, --explain-rule    print URLs with more information about rules [env var:\n                            EXPLAIN_RULE]\n      -r, --rules           show the matching rules [env var: RULES]\n      --rule-categories     show the the categories of the matching rules [env var:\n                            RULE_CATEGORIES]\n      -l LANG, --lang LANG  A language code like en or en-US, or auto to guess the\n                            language automatically (see preferredVariants below).\n                            For languages with variants (English, German,\n                            Portuguese) spell checking will only be activated when\n                            you specify the variant, e.g. en-GB instead of just en.\n                            [env var: TEXTLANG]\n      -m MOTHER_TONGUE, --mother-tongue MOTHER_TONGUE\n                            A language code of the user's native language, enabling\n                            false friends checks for some language pairs. [env var:\n                            MOTHER__TONGUE]\n      -p PREFERRED_VARIANTS, --preferred-variants PREFERRED_VARIANTS\n                            Comma-separated list of preferred language variants. The\n                            language detector used with language=auto can detect\n                            e.g. English, but it cannot decide whether British\n                            English or American English is used. Thus this parameter\n                            can be used to specify the preferred variants like en-GB\n                            and de-AT. Only available with language=auto. [env var:\n                            PREFERRED_VARIANTS]\n      -e ENABLED_RULES, --enabled-rules ENABLED_RULES\n                            IDs of rules to be enabled, comma-separated [env var:\n                            ENABLED_RULES]\n      -d DISABLED_RULES, --disabled-rules DISABLED_RULES\n                            IDs of rules to be disabled, comma-separated [env var:\n                            DISABLED_RULES]\n      --enabled-categories ENABLED_CATEGORIES\n                            IDs of categories to be enabled, comma-separated [env\n                            var: ENABLED_CATEGORIES]\n      --disabled-categories DISABLED_CATEGORIES\n                            IDs of categories to be disabled, comma-separated [env\n                            var: DISABLED_CATEGORIES]\n      --enabled-only        enable only the rules and categories whose IDs are\n                            specified with --enabled-rules or --enabled-categories\n      --picky               if enabled, additional rules will be activated\n      --pwl PWL, --personal-word-list PWL\n                            File name of personal dictionary. A private dictionary\n                            can be used to add special words that would otherwise be\n                            marked as spelling errors. [env var: PERSONAL_WORD_LIST]\n\n    Args that start with '--' can also be set in a config file\n    (~/.config/pyLanguagetool.conf). Config file syntax allows: key=value,\n    flag=true, stuff=[a,b,c] (for details, see syntax at\n    https://pypi.org/project/ConfigArgParse/). In general, command-line values\n    override environment variables which override config file values which override\n    defaults.\n\n\n.. |license| image:: https://img.shields.io/badge/license-MIT-blue.svg\n    :target: https://raw.githubusercontent.com/Findus23/pyLanguagetool/master/LICENSE\n.. |latestrelease| image:: https://img.shields.io/pypi/v/pyLanguagetool.svg\n    :target: https://pypi.python.org/pypi/pyLanguagetool\n    :alt: Latest Version\n.. |pypi_versions| image:: https://img.shields.io/pypi/pyversions/pylanguagetool.svg\n    :target: https://pypi.python.org/pypi/pyLanguagetool\n\n.. _LanguageTool: https://languagetool.org/\n\n.. _JSON API: https://languagetool.org/http-api/swagger-ui/#/default\n\n.. _LanguageTool API: https://languagetool.org/http-api/swagger-ui/#/default\n\n.. _ConfigArgParse documentation: https://github.com/bw2/ConfigArgParse#config-file-syntax\n\n.. _privacy policy: https://languagetool.org/privacy/\n\n.. _set up your own server: https://dev.languagetool.org/http-server\n",
    "bugtrack_url": null,
    "license": "MIT",
    "summary": "A python library and CLI for the LanguageTool JSON API",
    "version": "0.10.1",
    "project_urls": {
        "Documentation": "https://pylanguagetool.lw1.at/",
        "Issues": "https://github.com/Findus23/pyLanguagetool/issues",
        "Source": "https://github.com/Findus23/pyLanguagetool/"
    },
    "split_keywords": [
        "languagetool",
        " spell",
        " grammar",
        " checker"
    ],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "ab7b42a2c8edcbf487f8038c8c61ab3b344f9b4bcf9d1d22b596f82b97e086a3",
                "md5": "21cba9a7910d87a05043d0890c4300e4",
                "sha256": "29031ded35b7e47eeb4485b2b83cb00789466bd279bee700b9d1712d3eeb090b"
            },
            "downloads": -1,
            "filename": "pyLanguagetool-0.10.1-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "21cba9a7910d87a05043d0890c4300e4",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": ">=3.8",
            "size": 4955,
            "upload_time": "2024-07-20T21:40:33",
            "upload_time_iso_8601": "2024-07-20T21:40:33.343528Z",
            "url": "https://files.pythonhosted.org/packages/ab/7b/42a2c8edcbf487f8038c8c61ab3b344f9b4bcf9d1d22b596f82b97e086a3/pyLanguagetool-0.10.1-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2024-07-20 21:40:33",
    "github": true,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "github_user": "Findus23",
    "github_project": "pyLanguagetool",
    "travis_ci": false,
    "coveralls": false,
    "github_actions": false,
    "lcname": "pylanguagetool"
}
        
Elapsed time: 3.25892s