clipcount


Nameclipcount JSON
Version 1.0.1 PyPI version JSON
download
home_pagehttps://github.com/yusu79/clipcount
SummaryReads the clipboard and outputs the character count.
upload_time2024-03-04 08:33:31
maintainer
docs_urlNone
authoryusu79
requires_python>=3.8
licenseMIT License Copyright (c) 2024 yusu79 Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
keywords pyperclip character_count clipboard
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage No coveralls.
            # clipcount
![GitHub License](https://img.shields.io/github/license/yusu79/clipcount)
![PyPI - Version](https://img.shields.io/pypi/v/clipcount)
![PyPI - Downloads](https://img.shields.io/pypi/dm/clipcount)

This is a Python package that reads text from the clipboard and outputs the character count.

<!-- omit in toc -->
- [Setup](#setup)
- [Quick Usage](#quick-usage)
- [Usage](#usage)
- [Dependencies](#dependencies)

## Setup
Install via pip:
```bash:
pip install clipcount
```

### Handling "Warning" on Windows
If you encounter a "`WARNING: The script clipcount.exe is installed in 'path' which is not on PATH.`" when running the above command on Windows, please refer to the following article.

Reference: [【Python Windows】pip install でPATHが通らない時の解決方法 | ゆすノート](https://yusu79.com/python-path-issue/)

If you see "`WARNING: Failed to write executable - trying to use .deleteme logic`," please run the terminal with administrator privileges and then proceed with the installation. For more details, refer to the following article:

Reference: [Error installing package with executable · Issue #9023 · pypa/pip](https://github.com/pypa/pip/issues/9023)

## Quick Usage
| Option             | Description                                                              | 
| ------------------ | ------------------------------------------------------------------------ | 
| clipcount -h       | Display the help screen.                                                 | 
| clipcount --help_jp| Display the help screen in Japanese.                                     | 
| clipcount -b       | Output the character count after removing line breaks (`\n` or `\r\n`). | 
| clipcount -s       | Output the character count after removing half-width spaces.            | 
| clipcount -S       | Output the character count after removing full-width spaces.            | 
| clipcount -t       | Output the character count after removing tab characters (`\t`).       | 
| clipcount --split  | Output the character count after removing all whitespace characters (line breaks, half-width spaces, full-width spaces, tabs). | 
| clipcount -m       | Calculate characters with half-width alphanumeric characters as 0.5 and output the character count.                    | 

Use it as a command-line tool to output character counts on the terminal:
```bash:
clipcount [options]
```

It can also be imported into Python files:
```python:
from clipcount import clipcount
x = clipcount({options})
```

### Example
*Note: The examples below are executed in a "Windows" environment, so line breaks are counted as "`\r\n`".*

Copy the following text and run clipcount:
```md:
Read
clipboard text.
```

#### CLI
- Run it as is:
```bash:
# Output the character count including whitespace characters
$ clipcount
21
```
- Remove half-width spaces and output:
```bash:
# One half-width space is removed and output
$ clipcount -s
20
```
- Remove full-width spaces:
```bash:
# The above spaces are half-width spaces, so nothing changes.
$ clipcount -S
21
```
- Remove line breaks:
```bash:
# Line breaks are removed and output
$ clipcount -b
19
```
- Remove all whitespace characters:
```bash:
# Full-width space characters are removed
$ clipcount -sSbt
18
```
Alternatively, using `--split` yields the same result.
```bash:
# Full-width space characters are removed
$ clipcount --split
18
```
- Calculate half-width alphanumeric characters as 0.5 and output:
```bash:
# Half-width alphanumeric characters are counted as 0.5
$ clipcount -m
10.5
```

#### Import
It can also be used in a Python file with "import".
As a note, when passing commands to options, please exclude "`-`" or "`--`".
```python:
# Store the character count of the clipboard in a variable
from clipcount import clipcount
x = clipcount({"split"})
print(x)
```
```bash:
# Produces the same result as "clipcount --split"
$ python foo.py
18
```

## Usage
clipcount is a Python package that "reads the clipboard and outputs the character count."
By default, it outputs the "character count including whitespace characters (line breaks, half-width spaces, full-width spaces, tabs)."
It also calculates both half-width and full-width characters as "the same 1 character."

With various options, you can output the character count after removing each whitespace character.
When used in the terminal, options can be combined. For example, to output "the character count after removing only full-width spaces and tabs," you can use "`clipcount -St`".

If you want to remove all whitespace characters at once, the "`--split`" option can be used. This has the same meaning as "`-bsSt`".

If you want to calculate half-width and full-width characters separately, you can use the "`-m`" option. This is an option to calculate half-width characters as "0.5 characters." It may be useful when considering character counts in situations like WordPress titles or meta keywords.

## Dependencies
- [pyperclip](https://github.com/asweigart/pyperclip)

            

Raw data

            {
    "_id": null,
    "home_page": "https://github.com/yusu79/clipcount",
    "name": "clipcount",
    "maintainer": "",
    "docs_url": null,
    "requires_python": ">=3.8",
    "maintainer_email": "",
    "keywords": "pyperclip,character_count,clipboard",
    "author": "yusu79",
    "author_email": "oss@yusu79.com",
    "download_url": "https://files.pythonhosted.org/packages/db/3d/c9a7727a7e9e4b10b8ecc527364d88359b5d6f43d73ba518de4e3f9cc278/clipcount-1.0.1.tar.gz",
    "platform": null,
    "description": "# clipcount\r\n![GitHub License](https://img.shields.io/github/license/yusu79/clipcount)\r\n![PyPI - Version](https://img.shields.io/pypi/v/clipcount)\r\n![PyPI - Downloads](https://img.shields.io/pypi/dm/clipcount)\r\n\r\nThis is a Python package that reads text from the clipboard and outputs the character count.\r\n\r\n<!-- omit in toc -->\r\n- [Setup](#setup)\r\n- [Quick Usage](#quick-usage)\r\n- [Usage](#usage)\r\n- [Dependencies](#dependencies)\r\n\r\n## Setup\r\nInstall via pip:\r\n```bash:\r\npip install clipcount\r\n```\r\n\r\n### Handling \"Warning\" on Windows\r\nIf you encounter a \"`WARNING: The script clipcount.exe is installed in 'path' which is not on PATH.`\" when running the above command on Windows, please refer to the following article.\r\n\r\nReference: [\u3010Python Windows\u3011pip install \u3067PATH\u304c\u901a\u3089\u306a\u3044\u6642\u306e\u89e3\u6c7a\u65b9\u6cd5 | \u3086\u3059\u30ce\u30fc\u30c8](https://yusu79.com/python-path-issue/)\r\n\r\nIf you see \"`WARNING: Failed to write executable - trying to use .deleteme logic`,\" please run the terminal with administrator privileges and then proceed with the installation. For more details, refer to the following article:\r\n\r\nReference: [Error installing package with executable \u00b7 Issue #9023 \u00b7 pypa/pip](https://github.com/pypa/pip/issues/9023)\r\n\r\n## Quick Usage\r\n| Option             | Description                                                              | \r\n| ------------------ | ------------------------------------------------------------------------ | \r\n| clipcount -h       | Display the help screen.                                                 | \r\n| clipcount --help_jp| Display the help screen in Japanese.                                     | \r\n| clipcount -b       | Output the character count after removing line breaks (`\\n` or `\\r\\n`). | \r\n| clipcount -s       | Output the character count after removing half-width spaces.            | \r\n| clipcount -S       | Output the character count after removing full-width spaces.            | \r\n| clipcount -t       | Output the character count after removing tab characters (`\\t`).       | \r\n| clipcount --split  | Output the character count after removing all whitespace characters (line breaks, half-width spaces, full-width spaces, tabs). | \r\n| clipcount -m       | Calculate characters with half-width alphanumeric characters as 0.5 and output the character count.                    | \r\n\r\nUse it as a command-line tool to output character counts on the terminal:\r\n```bash:\r\nclipcount [options]\r\n```\r\n\r\nIt can also be imported into Python files:\r\n```python:\r\nfrom clipcount import clipcount\r\nx = clipcount({options})\r\n```\r\n\r\n### Example\r\n*Note: The examples below are executed in a \"Windows\" environment, so line breaks are counted as \"`\\r\\n`\".*\r\n\r\nCopy the following text and run clipcount:\r\n```md:\r\nRead\r\nclipboard text.\r\n```\r\n\r\n#### CLI\r\n- Run it as is:\r\n```bash:\r\n# Output the character count including whitespace characters\r\n$ clipcount\r\n21\r\n```\r\n- Remove half-width spaces and output:\r\n```bash:\r\n# One half-width space is removed and output\r\n$ clipcount -s\r\n20\r\n```\r\n- Remove full-width spaces:\r\n```bash:\r\n# The above spaces are half-width spaces, so nothing changes.\r\n$ clipcount -S\r\n21\r\n```\r\n- Remove line breaks:\r\n```bash:\r\n# Line breaks are removed and output\r\n$ clipcount -b\r\n19\r\n```\r\n- Remove all whitespace characters:\r\n```bash:\r\n# Full-width space characters are removed\r\n$ clipcount -sSbt\r\n18\r\n```\r\nAlternatively, using `--split` yields the same result.\r\n```bash:\r\n# Full-width space characters are removed\r\n$ clipcount --split\r\n18\r\n```\r\n- Calculate half-width alphanumeric characters as 0.5 and output:\r\n```bash:\r\n# Half-width alphanumeric characters are counted as 0.5\r\n$ clipcount -m\r\n10.5\r\n```\r\n\r\n#### Import\r\nIt can also be used in a Python file with \"import\".\r\nAs a note, when passing commands to options, please exclude \"`-`\" or \"`--`\".\r\n```python:\r\n# Store the character count of the clipboard in a variable\r\nfrom clipcount import clipcount\r\nx = clipcount({\"split\"})\r\nprint(x)\r\n```\r\n```bash:\r\n# Produces the same result as \"clipcount --split\"\r\n$ python foo.py\r\n18\r\n```\r\n\r\n## Usage\r\nclipcount is a Python package that \"reads the clipboard and outputs the character count.\"\r\nBy default, it outputs the \"character count including whitespace characters (line breaks, half-width spaces, full-width spaces, tabs).\"\r\nIt also calculates both half-width and full-width characters as \"the same 1 character.\"\r\n\r\nWith various options, you can output the character count after removing each whitespace character.\r\nWhen used in the terminal, options can be combined. For example, to output \"the character count after removing only full-width spaces and tabs,\" you can use \"`clipcount -St`\".\r\n\r\nIf you want to remove all whitespace characters at once, the \"`--split`\" option can be used. This has the same meaning as \"`-bsSt`\".\r\n\r\nIf you want to calculate half-width and full-width characters separately, you can use the \"`-m`\" option. This is an option to calculate half-width characters as \"0.5 characters.\" It may be useful when considering character counts in situations like WordPress titles or meta keywords.\r\n\r\n## Dependencies\r\n- [pyperclip](https://github.com/asweigart/pyperclip)\r\n",
    "bugtrack_url": null,
    "license": "MIT License  Copyright (c) 2024 yusu79  Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the \"Software\"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:  The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.  THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. ",
    "summary": "Reads the clipboard and outputs the character count.",
    "version": "1.0.1",
    "project_urls": {
        "Homepage": "https://yusu79.com",
        "Repository": "https://github.com/yusu79/clipcount"
    },
    "split_keywords": [
        "pyperclip",
        "character_count",
        "clipboard"
    ],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "e38e155be7b96de09a104a2de523c3e7d9e4ff01946842505442df5e15b7c1a5",
                "md5": "a42e65a3591fea4793f8bd4b8a76b99c",
                "sha256": "98d7ed1de6c4bba6007c6ee9c7819acd8c6b8e33b744a5790724d163492b4ffd"
            },
            "downloads": -1,
            "filename": "clipcount-1.0.1-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "a42e65a3591fea4793f8bd4b8a76b99c",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": ">=3.8",
            "size": 6266,
            "upload_time": "2024-03-04T08:33:29",
            "upload_time_iso_8601": "2024-03-04T08:33:29.251485Z",
            "url": "https://files.pythonhosted.org/packages/e3/8e/155be7b96de09a104a2de523c3e7d9e4ff01946842505442df5e15b7c1a5/clipcount-1.0.1-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "db3dc9a7727a7e9e4b10b8ecc527364d88359b5d6f43d73ba518de4e3f9cc278",
                "md5": "f693bf0a3978e354c02838f4c6c5db9d",
                "sha256": "6b491a1e0bcdd7516f009f583681352bde1b49159c2e828f461c986b09c9d4bc"
            },
            "downloads": -1,
            "filename": "clipcount-1.0.1.tar.gz",
            "has_sig": false,
            "md5_digest": "f693bf0a3978e354c02838f4c6c5db9d",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": ">=3.8",
            "size": 7929,
            "upload_time": "2024-03-04T08:33:31",
            "upload_time_iso_8601": "2024-03-04T08:33:31.754019Z",
            "url": "https://files.pythonhosted.org/packages/db/3d/c9a7727a7e9e4b10b8ecc527364d88359b5d6f43d73ba518de4e3f9cc278/clipcount-1.0.1.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2024-03-04 08:33:31",
    "github": true,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "github_user": "yusu79",
    "github_project": "clipcount",
    "travis_ci": false,
    "coveralls": false,
    "github_actions": false,
    "lcname": "clipcount"
}
        
Elapsed time: 0.25526s