python3-ptock


Namepython3-ptock JSON
Version 1.3.1 PyPI version JSON
download
home_pageNone
SummaryA digital clock made in Python for the terminal, inspired by tty-clock and tock.
upload_time2024-10-29 03:19:07
maintainerNone
docs_urlNone
authorNone
requires_python>=3.12.7
licenseMIT
keywords digital clock terminal tty-clock tock
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage No coveralls.
            # pTock

A digital clock for the terminal, inspired by [tty-clock][0] and [tock][1].
The main difference with this version is that it is written in Python, and my goal was primarily to learn as much as possible about the language itself.

Note: emulating all the features of tty-clock and tock is **not** a goal of this project.

## Features

- Efficient bitmap and diff-based drawing.
- Timezone fetched fro mthe system using the **timedatectl** command [2].
- Military time and second display toggling.
- Color customization.
- Positioned or centered clock.
- Adjustable display size.
- Synchronization with system clock seconds.
- Do not require any particular Python library, only standard Python libs.
- If the terminal size changed, it will adjusts the clock position automatically.

## Installation and Dependencies

1. The only requirement is to have Python 3 installed and the basic core libraries.

2. It is already available in PyPi, so you only need to run pip to intall and ptock to start the clock, as below:

```sh
pip install python3-ptock
```

```sh
ptock -h
```

## Usage

```output
Usage: ptock [OPTIONS]

A digital clock for the terminal.

Options:
  -h, --help             show this help message and exit.
  -x, --x <X>            Horizontal 0-indexed position of top-left corner [default: 0].
  -y, --y <Y>            Vertical 0-indexed position of top-left corner [default: 0].
  -W, --width <WIDTH>    Font width in characters per tile [default: 2].
  -H, --height <HEIGHT>  Font height in characters per tile [default: 1].
  -s, --second           Display seconds.
  -m, --military         Display military (24-hour) time.
  -c, --center           Center the clock in the terminal. Overrides manual positioning.
  -C, --color <COLOR>    Change the color of the time [If none is given, random from 1 to 7].
  -v, --version          Show program's version number and exit.
```

Available commands with this feature flag set are:

- `q` or `Q` or `<ESC>`: Exit.
- `s`: Toggle second display.
- `m`: Toggle military (24H) time.
- `c`: Center the clock in the terminal.
- `0`..=`7`: Change to corresponding ANSI color.

## References

- [The timedatectl man page][2]

[0]: https://github.com/xorg62/tty-clock
[1]: https://github.com/nwtnni/tock
[2]: https://man7.org/linux/man-pages/man1/timedatectl.1.html

            

Raw data

            {
    "_id": null,
    "home_page": null,
    "name": "python3-ptock",
    "maintainer": null,
    "docs_url": null,
    "requires_python": ">=3.12.7",
    "maintainer_email": null,
    "keywords": "digital clock, terminal, tty-clock, tock",
    "author": null,
    "author_email": "Andre Ribeiro <andre.ribeiro.srs@gmail.com>",
    "download_url": "https://files.pythonhosted.org/packages/22/28/a4ec729a8f9606901dcf9485a38cc637f3e450f4296a41d537339dabda76/python3_ptock-1.3.1.tar.gz",
    "platform": null,
    "description": "# pTock\n\nA digital clock for the terminal, inspired by [tty-clock][0] and [tock][1].\nThe main difference with this version is that it is written in Python, and my goal was primarily to learn as much as possible about the language itself.\n\nNote: emulating all the features of tty-clock and tock is **not** a goal of this project.\n\n## Features\n\n- Efficient bitmap and diff-based drawing.\n- Timezone fetched fro mthe system using the **timedatectl** command [2].\n- Military time and second display toggling.\n- Color customization.\n- Positioned or centered clock.\n- Adjustable display size.\n- Synchronization with system clock seconds.\n- Do not require any particular Python library, only standard Python libs.\n- If the terminal size changed, it will adjusts the clock position automatically.\n\n## Installation and Dependencies\n\n1. The only requirement is to have Python 3 installed and the basic core libraries.\n\n2. It is already available in PyPi, so you only need to run pip to intall and ptock to start the clock, as below:\n\n```sh\npip install python3-ptock\n```\n\n```sh\nptock -h\n```\n\n## Usage\n\n```output\nUsage: ptock [OPTIONS]\n\nA digital clock for the terminal.\n\nOptions:\n  -h, --help             show this help message and exit.\n  -x, --x <X>            Horizontal 0-indexed position of top-left corner [default: 0].\n  -y, --y <Y>            Vertical 0-indexed position of top-left corner [default: 0].\n  -W, --width <WIDTH>    Font width in characters per tile [default: 2].\n  -H, --height <HEIGHT>  Font height in characters per tile [default: 1].\n  -s, --second           Display seconds.\n  -m, --military         Display military (24-hour) time.\n  -c, --center           Center the clock in the terminal. Overrides manual positioning.\n  -C, --color <COLOR>    Change the color of the time [If none is given, random from 1 to 7].\n  -v, --version          Show program's version number and exit.\n```\n\nAvailable commands with this feature flag set are:\n\n- `q` or `Q` or `<ESC>`: Exit.\n- `s`: Toggle second display.\n- `m`: Toggle military (24H) time.\n- `c`: Center the clock in the terminal.\n- `0`..=`7`: Change to corresponding ANSI color.\n\n## References\n\n- [The timedatectl man page][2]\n\n[0]: https://github.com/xorg62/tty-clock\n[1]: https://github.com/nwtnni/tock\n[2]: https://man7.org/linux/man-pages/man1/timedatectl.1.html\n",
    "bugtrack_url": null,
    "license": "MIT",
    "summary": "A digital clock made in Python for the terminal, inspired by tty-clock and tock.",
    "version": "1.3.1",
    "project_urls": {
        "Homepage": "https://github.com/andrerclaudio/python3-ptock",
        "Issues": "https://github.com/andrerclaudio/python3-ptock/issues"
    },
    "split_keywords": [
        "digital clock",
        " terminal",
        " tty-clock",
        " tock"
    ],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "66d6e0833b52e5dfe622b5e9629f4954ade4f419f197a95eb6c88f28a1c0eebc",
                "md5": "98d191e2ef8ddc640226a4bbfec69d72",
                "sha256": "ed2c444c353c41e7429174c2822e3ab5d1a9aa0872198eb1676cc91d924af178"
            },
            "downloads": -1,
            "filename": "python3_ptock-1.3.1-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "98d191e2ef8ddc640226a4bbfec69d72",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": ">=3.12.7",
            "size": 12477,
            "upload_time": "2024-10-29T03:19:05",
            "upload_time_iso_8601": "2024-10-29T03:19:05.953019Z",
            "url": "https://files.pythonhosted.org/packages/66/d6/e0833b52e5dfe622b5e9629f4954ade4f419f197a95eb6c88f28a1c0eebc/python3_ptock-1.3.1-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "2228a4ec729a8f9606901dcf9485a38cc637f3e450f4296a41d537339dabda76",
                "md5": "554862b8d4e6d9a58f580ce3a72fc40c",
                "sha256": "3914b3b417f5366abc6f4ba2bdf7cf23b1b8bb79d6f0e3da95a18b4ed70ec0bd"
            },
            "downloads": -1,
            "filename": "python3_ptock-1.3.1.tar.gz",
            "has_sig": false,
            "md5_digest": "554862b8d4e6d9a58f580ce3a72fc40c",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": ">=3.12.7",
            "size": 12216,
            "upload_time": "2024-10-29T03:19:07",
            "upload_time_iso_8601": "2024-10-29T03:19:07.886395Z",
            "url": "https://files.pythonhosted.org/packages/22/28/a4ec729a8f9606901dcf9485a38cc637f3e450f4296a41d537339dabda76/python3_ptock-1.3.1.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2024-10-29 03:19:07",
    "github": true,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "github_user": "andrerclaudio",
    "github_project": "python3-ptock",
    "travis_ci": false,
    "coveralls": false,
    "github_actions": false,
    "lcname": "python3-ptock"
}
        
Elapsed time: 0.46610s