multicarriage


Namemulticarriage JSON
Version 1.1 PyPI version JSON
download
home_pagehttps://github.com/xyzpw/multicarriage
SummaryAllows the ability to rewrite multiple lines via carriage returns.
upload_time2024-03-03 17:04:46
maintainerxyzpw
docs_urlNone
authorxyzpw
requires_python>=3.7
licenseMIT
keywords
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage No coveralls.
            # multicarriage
![PyPI - Version](https://img.shields.io/pypi/v/multicarriage)
![Pepy Total Downlods](https://img.shields.io/pepy/dt/multicarriage)
![PyPI - Python Version](https://img.shields.io/pypi/pyversions/multicarriage)
![GitHub repo size](https://img.shields.io/github/repo-size/xyzpw/multicarriage)


A Python module designed for writing and updating text on multiple lines using the the carriage return.<br><br>
![multicarriage-preview](https://github.com/xyzpw/multicarriage/assets/76017734/fea181cd-3bbe-4ad5-beec-de6518033a2d)

## Usage
### Previewing Package
```bash
$ python3 -m multicarriage.demo
```
### Importing Package
```python
import multicarriage
```
### Creating Newlines
Creating newlines prevents text from being overwritten.
```python
multicarriage.MultiCarriage.create_newline(2)
```
### Writing to Screen
```python
multicarriage.MultiCarriage.write("first text", 2, clearline=True)
multicarriage.MultiCarriage.write("second text", 1, clearline=True)
```
Setting the `clearline` parameter to true will erase the current line of which the cursor is on, assuring there will be no overwritten text.
### Example of Real Script Usage
Example script that will write and update 3 lines at once.
```python
# example of auto updating epoch and datetime
import multicarriage
import time
import datetime

# creating newlines to avoid overwriting current text
multicarriage.MultiCarriage.create_newline(3)
while True:
    try:
        timestamp = time.time()
        date = datetime.datetime.fromtimestamp(timestamp)
        multicarriage.MultiCarriage.write(f"epoch: {timestamp}", 3, clearline=True, flushtxt=True)
        multicarriage.MultiCarriage.write(f"epoch (s): {timestamp//1}", 2, clearline=True, flushtxt=True)
        multicarriage.MultiCarriage.write(f"datetime string: {date}", 1, clearline=True, flushtxt=True)
        time.sleep(1/10)
    except KeyboardInterrupt:
        raise SystemExit(0)
```

            

Raw data

            {
    "_id": null,
    "home_page": "https://github.com/xyzpw/multicarriage",
    "name": "multicarriage",
    "maintainer": "xyzpw",
    "docs_url": null,
    "requires_python": ">=3.7",
    "maintainer_email": "",
    "keywords": "",
    "author": "xyzpw",
    "author_email": "",
    "download_url": "https://files.pythonhosted.org/packages/7d/e6/4b02d0c261d00061d90983661200bde2db63a65397c2499117d2d5e22fae/multicarriage-1.1.tar.gz",
    "platform": null,
    "description": "# multicarriage\n![PyPI - Version](https://img.shields.io/pypi/v/multicarriage)\n![Pepy Total Downlods](https://img.shields.io/pepy/dt/multicarriage)\n![PyPI - Python Version](https://img.shields.io/pypi/pyversions/multicarriage)\n![GitHub repo size](https://img.shields.io/github/repo-size/xyzpw/multicarriage)\n\n\nA Python module designed for writing and updating text on multiple lines using the the carriage return.<br><br>\n![multicarriage-preview](https://github.com/xyzpw/multicarriage/assets/76017734/fea181cd-3bbe-4ad5-beec-de6518033a2d)\n\n## Usage\n### Previewing Package\n```bash\n$ python3 -m multicarriage.demo\n```\n### Importing Package\n```python\nimport multicarriage\n```\n### Creating Newlines\nCreating newlines prevents text from being overwritten.\n```python\nmulticarriage.MultiCarriage.create_newline(2)\n```\n### Writing to Screen\n```python\nmulticarriage.MultiCarriage.write(\"first text\", 2, clearline=True)\nmulticarriage.MultiCarriage.write(\"second text\", 1, clearline=True)\n```\nSetting the `clearline` parameter to true will erase the current line of which the cursor is on, assuring there will be no overwritten text.\n### Example of Real Script Usage\nExample script that will write and update 3 lines at once.\n```python\n# example of auto updating epoch and datetime\nimport multicarriage\nimport time\nimport datetime\n\n# creating newlines to avoid overwriting current text\nmulticarriage.MultiCarriage.create_newline(3)\nwhile True:\n    try:\n        timestamp = time.time()\n        date = datetime.datetime.fromtimestamp(timestamp)\n        multicarriage.MultiCarriage.write(f\"epoch: {timestamp}\", 3, clearline=True, flushtxt=True)\n        multicarriage.MultiCarriage.write(f\"epoch (s): {timestamp//1}\", 2, clearline=True, flushtxt=True)\n        multicarriage.MultiCarriage.write(f\"datetime string: {date}\", 1, clearline=True, flushtxt=True)\n        time.sleep(1/10)\n    except KeyboardInterrupt:\n        raise SystemExit(0)\n```\n",
    "bugtrack_url": null,
    "license": "MIT",
    "summary": "Allows the ability to rewrite multiple lines via carriage returns.",
    "version": "1.1",
    "project_urls": {
        "Homepage": "https://github.com/xyzpw/multicarriage"
    },
    "split_keywords": [],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "cef78ff5fccd6a49d5eed4ea05d99cb5873ed09de93a780a4108f1c76f8eeffe",
                "md5": "077b8ef087f75fe8b0f16dde3e02e8e7",
                "sha256": "2f1981388447fb27547b5f3a84772e36cf7918822c30e103b27fc387b2945f59"
            },
            "downloads": -1,
            "filename": "multicarriage-1.1-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "077b8ef087f75fe8b0f16dde3e02e8e7",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": ">=3.7",
            "size": 4051,
            "upload_time": "2024-03-03T17:04:44",
            "upload_time_iso_8601": "2024-03-03T17:04:44.760533Z",
            "url": "https://files.pythonhosted.org/packages/ce/f7/8ff5fccd6a49d5eed4ea05d99cb5873ed09de93a780a4108f1c76f8eeffe/multicarriage-1.1-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "7de64b02d0c261d00061d90983661200bde2db63a65397c2499117d2d5e22fae",
                "md5": "1a4acf8c9d1c1652c45f1de4368003de",
                "sha256": "c2a8f27e33669c3e7ac979c2acca2cc8daca6806843e7fbc0c6df0e06f43bf3c"
            },
            "downloads": -1,
            "filename": "multicarriage-1.1.tar.gz",
            "has_sig": false,
            "md5_digest": "1a4acf8c9d1c1652c45f1de4368003de",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": ">=3.7",
            "size": 3430,
            "upload_time": "2024-03-03T17:04:46",
            "upload_time_iso_8601": "2024-03-03T17:04:46.252639Z",
            "url": "https://files.pythonhosted.org/packages/7d/e6/4b02d0c261d00061d90983661200bde2db63a65397c2499117d2d5e22fae/multicarriage-1.1.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2024-03-03 17:04:46",
    "github": true,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "github_user": "xyzpw",
    "github_project": "multicarriage",
    "travis_ci": false,
    "coveralls": false,
    "github_actions": false,
    "lcname": "multicarriage"
}
        
Elapsed time: 1.23570s