ccontrol


Nameccontrol JSON
Version 0.0.1 PyPI version JSON
download
home_pagehttps://github.com/INTERJL
Summarylibrary that simplifies working with the console
upload_time2024-01-14 13:04:45
maintainer
docs_urlNone
authorINTERJL
requires_python>=3.6
license
keywords console speed python
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage No coveralls.
            п»ї# ccontrol
ccontrol is a library designed for creating text-based user interfaces in Python. It simplifies the rendering of text to the screen, user input processing, and interacting with terminal functionalities without directly exposing the underlying complexity.
## Features
- Easy to use functions for displaying text with various attributes such as color and style
- Functions to initialize custom terminal screen settings
- Helper functions for creating input boxes and handling key presses
## Installation
This library is designed to work as a part of a Python project. Perfect for applications that require direct terminal manipulations for text-based interfaces.

To use ccontrol, you will need to ensure that you have Python installed on your system. No additional packages or curses-specific modules are required to be mentioned as dependencies for the basic running of ccontrol.
## Quick Start
Here's a quick example on how you can utilize the ccontrol library:
```
import ccontrol

\# Initialize the screen with default settings
stdscr = ccontrol.initialize\_screen()

try:
    # Display text at a specific location with color and bold style
    ccontrol.text(stdscr, x=10, y=5, text="Hello, ccontrol!", color\_pair=ccontrol.BLUE, style=ccontrol.BOLD)

    # Create an input box for user input
    user\_input = ccontrol.input\_box(stdscr, x=10, y=10, width=20, title="Input:")
    print("User input:", user\_input)

    # Wait for a key press
    key = ccontrol.get\_key(stdscr)
    print("Key pressed:", key)

finally:
    # Make sure to end the ccontrol application
    ccontrol.exit\_programm()
```
Note that while the ccontrol library uses the curses module internally, its API abstracts away the curses-specific details, providing a straightforward interface for building text user interfaces.
## Documentation
Functions provided by ccontrol include, but are not limited to:

- initialize\_screen:
  Accepts various boolean flags to customize terminal settings such as hiding the cursor or enabling the keypad for special keys.
- text:
  Outputs text at a given screen location with the provided colors and styling attributes.
- input\_box:
  Renders a simple input box at the specified screen location and accepts user input.
- get\_key:
  Waits for a user key press and returns the pressed key's keycode.
## Color and Style Constants
The ccontrol library comes with predefined constants for colors and text attributes:

- Colors:
  - WHITE
  - RED
  - YELLOW
  - GREEN
  - BLUE
  - CYAN
  - MAGENTA
- Styles:
  - NORMAL
  - BOLD
  - UNDERLINE
  - REVERSE
  - BLINK

These can be used to modify the text output's appearance on the terminal.
## Contributing
Contributions to the ccontrol library are welcome. If you have a suggestion that would make this library better, please fork the repo and create a pull request.
## License
Licensed under the MIT License. See the LICENSE file for more details.

            

Raw data

            {
    "_id": null,
    "home_page": "https://github.com/INTERJL",
    "name": "ccontrol",
    "maintainer": "",
    "docs_url": null,
    "requires_python": ">=3.6",
    "maintainer_email": "",
    "keywords": "console speed python",
    "author": "INTERJL",
    "author_email": "makar.arapov.real@gmail.com",
    "download_url": "https://files.pythonhosted.org/packages/b8/01/b3778a1c30bf991a3711c88805137d7c6053c42d6b7b14fdadc3166c0701/ccontrol-0.0.1.tar.gz",
    "platform": null,
    "description": "\u043f\u00bb\u0457# ccontrol\r\nccontrol is a library designed for creating text-based user interfaces in Python. It simplifies the rendering of text to the screen, user input processing, and interacting with terminal functionalities without directly exposing the underlying complexity.\r\n## Features\r\n- Easy to use functions for displaying text with various attributes such as color and style\r\n- Functions to initialize custom terminal screen settings\r\n- Helper functions for creating input boxes and handling key presses\r\n## Installation\r\nThis library is designed to work as a part of a Python project. Perfect for applications that require direct terminal manipulations for text-based interfaces.\r\n\r\nTo use ccontrol, you will need to ensure that you have Python installed on your system. No additional packages or curses-specific modules are required to be mentioned as dependencies for the basic running of ccontrol.\r\n## Quick Start\r\nHere's a quick example on how you can utilize the ccontrol library:\r\n```\r\nimport ccontrol\r\n\r\n\\# Initialize the screen with default settings\r\nstdscr = ccontrol.initialize\\_screen()\r\n\r\ntry:\r\n    # Display text at a specific location with color and bold style\r\n    ccontrol.text(stdscr, x=10, y=5, text=\"Hello, ccontrol!\", color\\_pair=ccontrol.BLUE, style=ccontrol.BOLD)\r\n\r\n    # Create an input box for user input\r\n    user\\_input = ccontrol.input\\_box(stdscr, x=10, y=10, width=20, title=\"Input:\")\r\n    print(\"User input:\", user\\_input)\r\n\r\n    # Wait for a key press\r\n    key = ccontrol.get\\_key(stdscr)\r\n    print(\"Key pressed:\", key)\r\n\r\nfinally:\r\n    # Make sure to end the ccontrol application\r\n    ccontrol.exit\\_programm()\r\n```\r\nNote that while the ccontrol library uses the curses module internally, its API abstracts away the curses-specific details, providing a straightforward interface for building text user interfaces.\r\n## Documentation\r\nFunctions provided by ccontrol include, but are not limited to:\r\n\r\n- initialize\\_screen:\r\n  Accepts various boolean flags to customize terminal settings such as hiding the cursor or enabling the keypad for special keys.\r\n- text:\r\n  Outputs text at a given screen location with the provided colors and styling attributes.\r\n- input\\_box:\r\n  Renders a simple input box at the specified screen location and accepts user input.\r\n- get\\_key:\r\n  Waits for a user key press and returns the pressed key's keycode.\r\n## Color and Style Constants\r\nThe ccontrol library comes with predefined constants for colors and text attributes:\r\n\r\n- Colors:\r\n  - WHITE\r\n  - RED\r\n  - YELLOW\r\n  - GREEN\r\n  - BLUE\r\n  - CYAN\r\n  - MAGENTA\r\n- Styles:\r\n  - NORMAL\r\n  - BOLD\r\n  - UNDERLINE\r\n  - REVERSE\r\n  - BLINK\r\n\r\nThese can be used to modify the text output's appearance on the terminal.\r\n## Contributing\r\nContributions to the ccontrol library are welcome. If you have a suggestion that would make this library better, please fork the repo and create a pull request.\r\n## License\r\nLicensed under the MIT License. See the LICENSE file for more details.\r\n",
    "bugtrack_url": null,
    "license": "",
    "summary": "library that simplifies working with the console",
    "version": "0.0.1",
    "project_urls": {
        "GitHub": "https://github.com/INTERJL/ccontrol/tree/main?tab=MIT-1-ov-file",
        "Homepage": "https://github.com/INTERJL"
    },
    "split_keywords": [
        "console",
        "speed",
        "python"
    ],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "687154ab0e779cf67276fbcb54bb717d280ab9c9aa3d6da255857e416e72744c",
                "md5": "98e6155ed0d0f049db7daaeb30a29eb8",
                "sha256": "52c7e527cbe69edc42aefa6fb51e9749b2f8863b69c63ad65934cf30e87358a5"
            },
            "downloads": -1,
            "filename": "ccontrol-0.0.1-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "98e6155ed0d0f049db7daaeb30a29eb8",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": ">=3.6",
            "size": 5086,
            "upload_time": "2024-01-14T13:04:43",
            "upload_time_iso_8601": "2024-01-14T13:04:43.469093Z",
            "url": "https://files.pythonhosted.org/packages/68/71/54ab0e779cf67276fbcb54bb717d280ab9c9aa3d6da255857e416e72744c/ccontrol-0.0.1-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "b801b3778a1c30bf991a3711c88805137d7c6053c42d6b7b14fdadc3166c0701",
                "md5": "271bf81f4e7fd2e800895807650bf918",
                "sha256": "0ab389e8652f34e298f57ef092695dfe6a49d7d59585bcd9716cb834c14408e0"
            },
            "downloads": -1,
            "filename": "ccontrol-0.0.1.tar.gz",
            "has_sig": false,
            "md5_digest": "271bf81f4e7fd2e800895807650bf918",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": ">=3.6",
            "size": 4848,
            "upload_time": "2024-01-14T13:04:45",
            "upload_time_iso_8601": "2024-01-14T13:04:45.204038Z",
            "url": "https://files.pythonhosted.org/packages/b8/01/b3778a1c30bf991a3711c88805137d7c6053c42d6b7b14fdadc3166c0701/ccontrol-0.0.1.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2024-01-14 13:04:45",
    "github": true,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "github_user": "INTERJL",
    "github_project": "ccontrol",
    "travis_ci": false,
    "coveralls": false,
    "github_actions": false,
    "lcname": "ccontrol"
}
        
Elapsed time: 0.16826s