unicodecheck


Nameunicodecheck JSON
Version 1.2.3 PyPI version JSON
download
home_pageNone
SummaryCheck if Unicode text files are Unicode-normalized
upload_time2024-10-26 08:02:49
maintainerNone
docs_urlNone
authorNone
requires_python>=3.11
licenseMIT
keywords unicode character encoding
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage No coveralls.
            # Unicodecheck

Simple tool to check if Unicode text files are Unicode-normalized

## Install

```sh
pip3 install unicodecheck
```

## Usage

### Quickstart

```sh
unicodecheck -iv SPAM.txt
```

To check files in a directory recursively:

```sh
unicodecheck -ivr Ham/Eggs/
```

### Synopsis

The main program can be invoked either through the `unicodecheck` command or through the Python main module option `python3 -m unicodecheck`.

```txt
usage: unicodecheck [-h] [-V] [-m {NFC,NFD,NFKC,NFKD}] [-d] [-u [NUMBER]] [-r] [-i] [-v]
                    PATH [PATH ...]
```

### Options

```txt
positional arguments:
  PATH                  describe input file or directory (pass '-' to specify stdin)

options:
  -h, --help            show this help message and exit
  -V, --version         show program's version number and exit
  -m {NFC,NFD,NFKC,NFKD}, --mode {NFC,NFD,NFKC,NFKD}
                        target Unicode normalization (default: NFC)
  -d, --diff            show diffs between the original and normalized (default: False)
  -u [NUMBER], -U [NUMBER], --unified [NUMBER]
                        show unified diffs with NUMBER lines of context [NUMBER=3] (default: False)
  -r, --recursive       follow the directory tree rooted in each PATH argument (default: False)
  -i, --include-hidden  include hidden files and directories (default: False)
  -b PATTERN [PATTERN ...], --blacklist PATTERN [PATTERN ...]
                        notify if having PATTERN (case-sensitive) (default: None)
  -e, --error           return non-zero exit code on detection (default: False)
  -v, --verbose         report non-essential logs (default: False)
```

## Tips

### Check whether filenames are normalized

The `convmv` command is a good alternative to using this application.

#### NFC

```sh
convmv -f utf8 -t utf8 --nfc -r ./
```

#### NFD

```sh
convmv -f utf8 -t utf8 --nfd -r ./
```

## Notes

- This tool doesn't provide auto in-place (write) file normalization because Unicode normalization doesn't guarantee content equivalence.
- The procedure for determining the binary file refers to Git's algorithm.

## License

MIT

            

Raw data

            {
    "_id": null,
    "home_page": null,
    "name": "unicodecheck",
    "maintainer": null,
    "docs_url": null,
    "requires_python": ">=3.11",
    "maintainer_email": "curegit <contact@curegit.jp>",
    "keywords": "Unicode, character encoding",
    "author": null,
    "author_email": null,
    "download_url": "https://files.pythonhosted.org/packages/53/18/b5ee445a2f9ba8f213afb848895876363af3d4224f4c32959c78bc6d5aba/unicodecheck-1.2.3.tar.gz",
    "platform": null,
    "description": "# Unicodecheck\n\nSimple tool to check if Unicode text files are Unicode-normalized\n\n## Install\n\n```sh\npip3 install unicodecheck\n```\n\n## Usage\n\n### Quickstart\n\n```sh\nunicodecheck -iv SPAM.txt\n```\n\nTo check files in a directory recursively:\n\n```sh\nunicodecheck -ivr Ham/Eggs/\n```\n\n### Synopsis\n\nThe main program can be invoked either through the `unicodecheck` command or through the Python main module option `python3 -m unicodecheck`.\n\n```txt\nusage: unicodecheck [-h] [-V] [-m {NFC,NFD,NFKC,NFKD}] [-d] [-u [NUMBER]] [-r] [-i] [-v]\n                    PATH [PATH ...]\n```\n\n### Options\n\n```txt\npositional arguments:\n  PATH                  describe input file or directory (pass '-' to specify stdin)\n\noptions:\n  -h, --help            show this help message and exit\n  -V, --version         show program's version number and exit\n  -m {NFC,NFD,NFKC,NFKD}, --mode {NFC,NFD,NFKC,NFKD}\n                        target Unicode normalization (default: NFC)\n  -d, --diff            show diffs between the original and normalized (default: False)\n  -u [NUMBER], -U [NUMBER], --unified [NUMBER]\n                        show unified diffs with NUMBER lines of context [NUMBER=3] (default: False)\n  -r, --recursive       follow the directory tree rooted in each PATH argument (default: False)\n  -i, --include-hidden  include hidden files and directories (default: False)\n  -b PATTERN [PATTERN ...], --blacklist PATTERN [PATTERN ...]\n                        notify if having PATTERN (case-sensitive) (default: None)\n  -e, --error           return non-zero exit code on detection (default: False)\n  -v, --verbose         report non-essential logs (default: False)\n```\n\n## Tips\n\n### Check whether filenames are normalized\n\nThe `convmv` command is a good alternative to using this application.\n\n#### NFC\n\n```sh\nconvmv -f utf8 -t utf8 --nfc -r ./\n```\n\n#### NFD\n\n```sh\nconvmv -f utf8 -t utf8 --nfd -r ./\n```\n\n## Notes\n\n- This tool doesn't provide auto in-place (write) file normalization because Unicode normalization doesn't guarantee content equivalence.\n- The procedure for determining the binary file refers to Git's algorithm.\n\n## License\n\nMIT\n",
    "bugtrack_url": null,
    "license": "MIT",
    "summary": "Check if Unicode text files are Unicode-normalized",
    "version": "1.2.3",
    "project_urls": {
        "homepage": "https://github.com/curegit/unicodecheck",
        "repository": "https://github.com/curegit/unicodecheck.git"
    },
    "split_keywords": [
        "unicode",
        " character encoding"
    ],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "4f586afc456298dcd3f312031cbd3c5807282b082ce2d1d5e522d10200cceef2",
                "md5": "baaf4790865e092737ba15f9ee090d95",
                "sha256": "72788103a423856fe45f8f1508d1c86bc3809d279ec6b0357d45cffb4ca0fa55"
            },
            "downloads": -1,
            "filename": "unicodecheck-1.2.3-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "baaf4790865e092737ba15f9ee090d95",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": ">=3.11",
            "size": 8603,
            "upload_time": "2024-10-26T08:02:48",
            "upload_time_iso_8601": "2024-10-26T08:02:48.267726Z",
            "url": "https://files.pythonhosted.org/packages/4f/58/6afc456298dcd3f312031cbd3c5807282b082ce2d1d5e522d10200cceef2/unicodecheck-1.2.3-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "5318b5ee445a2f9ba8f213afb848895876363af3d4224f4c32959c78bc6d5aba",
                "md5": "25c042bcbf8aa63868a35017750f1ed6",
                "sha256": "ea5eee39b6f8bab9fb07d920ee0f1116c718ce01fa2346c7f7f5a798c4c32cba"
            },
            "downloads": -1,
            "filename": "unicodecheck-1.2.3.tar.gz",
            "has_sig": false,
            "md5_digest": "25c042bcbf8aa63868a35017750f1ed6",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": ">=3.11",
            "size": 8168,
            "upload_time": "2024-10-26T08:02:49",
            "upload_time_iso_8601": "2024-10-26T08:02:49.434716Z",
            "url": "https://files.pythonhosted.org/packages/53/18/b5ee445a2f9ba8f213afb848895876363af3d4224f4c32959c78bc6d5aba/unicodecheck-1.2.3.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2024-10-26 08:02:49",
    "github": true,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "github_user": "curegit",
    "github_project": "unicodecheck",
    "travis_ci": false,
    "coveralls": false,
    "github_actions": false,
    "lcname": "unicodecheck"
}
        
Elapsed time: 7.39052s