razer-chroma-keyboard


Namerazer-chroma-keyboard JSON
Version 0.0.1.post2 PyPI version JSON
download
home_page
SummaryRazer chroma compatible keyboard backlight driving library.
upload_time2023-01-03 12:09:08
maintainer
docs_urlNone
authorJean Oustry
requires_python>=3.9
license
keywords
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage No coveralls.
            # What is this library ?

This library allows a python application or script to change the keys backlight colors of a razer chroma compatible keyboard.
A demo is also available.

# How to install ?

Install [https://www.razer.com/fr-fr/synapse-3](https://www.razer.com/fr-fr/synapse-3). <br/>
Create an environment and activate it if you want to (optionnal). <br/>
Execute ```pip install razer-chroma-keyboard```

# How to test ?

Execute ```python -m razer_chroma_keyboard```. You should see promptly (in less than 3 seconds) the result on your keyboard.

# How to use as a library ?

Import with ```import razer_chroma_keyboard```. For this example, also ```import time```.
Prepare your (R, G, B) color tuples matrix. So you know the dimensions, you can use this black matrix and modify it : ```m = [[(0, 0, 0) for _ in range(22)] for _ in range(6)]```.
Then you can use a with statement (to allow fine control of the connection) like this : <br/>
```
with razer_chroma_keyboard.razerServerChromaConnection() as connection :
    connection.apply_chroma_custom(m)
    while True: time.sleep(1)
```
The second line is because, when the with statement is left, the connection will be stopped, and the keyboard will back to it's previous state after a moment (if another software controls it).
Example of full code to turn the whole keyboard into a specific color :
```
import razer_chroma_keyboard
import time

def change_color(color: tuple[int, int, int] = (50, 50, 50)):
    m = [[color for _ in range(22)] for _ in range(6)]
    with razer_chroma_keyboard.razerServerChromaConnection() as connection :
        connection.apply_chroma_custom(m)
        while True: time.sleep(1)

change_color((255, 191, 0)) #  Amber yellow.
```
            

Raw data

            {
    "_id": null,
    "home_page": "",
    "name": "razer-chroma-keyboard",
    "maintainer": "",
    "docs_url": null,
    "requires_python": ">=3.9",
    "maintainer_email": "",
    "keywords": "",
    "author": "Jean Oustry",
    "author_email": "",
    "download_url": "https://files.pythonhosted.org/packages/4f/3b/c6f0c21ba422815300864068d2f8bb5a28f1ae1746a72ddd8721a88cc374/razer_chroma_keyboard-0.0.1.post2.tar.gz",
    "platform": null,
    "description": "# What is this library ?\n\nThis library allows a python application or script to change the keys backlight colors of a razer chroma compatible keyboard.\nA demo is also available.\n\n# How to install ?\n\nInstall [https://www.razer.com/fr-fr/synapse-3](https://www.razer.com/fr-fr/synapse-3). <br/>\nCreate an environment and activate it if you want to (optionnal). <br/>\nExecute ```pip install razer-chroma-keyboard```\n\n# How to test ?\n\nExecute ```python -m razer_chroma_keyboard```. You should see promptly (in less than 3 seconds) the result on your keyboard.\n\n# How to use as a library ?\n\nImport with ```import razer_chroma_keyboard```. For this example, also ```import time```.\nPrepare your (R, G, B) color tuples matrix. So you know the dimensions, you can use this black matrix and modify it : ```m = [[(0, 0, 0) for _ in range(22)] for _ in range(6)]```.\nThen you can use a with statement (to allow fine control of the connection) like this : <br/>\n```\nwith razer_chroma_keyboard.razerServerChromaConnection() as connection :\n    connection.apply_chroma_custom(m)\n    while True: time.sleep(1)\n```\nThe second line is because, when the with statement is left, the connection will be stopped, and the keyboard will back to it's previous state after a moment (if another software controls it).\nExample of full code to turn the whole keyboard into a specific color :\n```\nimport razer_chroma_keyboard\nimport time\n\ndef change_color(color: tuple[int, int, int] = (50, 50, 50)):\n    m = [[color for _ in range(22)] for _ in range(6)]\n    with razer_chroma_keyboard.razerServerChromaConnection() as connection :\n        connection.apply_chroma_custom(m)\n        while True: time.sleep(1)\n\nchange_color((255, 191, 0)) #  Amber yellow.\n```",
    "bugtrack_url": null,
    "license": "",
    "summary": "Razer chroma compatible keyboard backlight driving library.",
    "version": "0.0.1.post2",
    "split_keywords": [],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "b9afd9cc874f6e7b2bb0f2dcfeef3734ff821925feae016e90dcfe5e0c252976",
                "md5": "24e409960a934f17577542c876964a84",
                "sha256": "ac18486be81e532de806b6a745e022ba4007e78e32a0724f47230b7ecb034da2"
            },
            "downloads": -1,
            "filename": "razer_chroma_keyboard-0.0.1.post2-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "24e409960a934f17577542c876964a84",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": ">=3.9",
            "size": 5911,
            "upload_time": "2023-01-03T12:09:07",
            "upload_time_iso_8601": "2023-01-03T12:09:07.038467Z",
            "url": "https://files.pythonhosted.org/packages/b9/af/d9cc874f6e7b2bb0f2dcfeef3734ff821925feae016e90dcfe5e0c252976/razer_chroma_keyboard-0.0.1.post2-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "4f3bc6f0c21ba422815300864068d2f8bb5a28f1ae1746a72ddd8721a88cc374",
                "md5": "631944c604baff7a2b4130f1b2359597",
                "sha256": "6a7c028f3a7d26f9120851e003280694a4340b722dc4eb5e94d9497eff2f3770"
            },
            "downloads": -1,
            "filename": "razer_chroma_keyboard-0.0.1.post2.tar.gz",
            "has_sig": false,
            "md5_digest": "631944c604baff7a2b4130f1b2359597",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": ">=3.9",
            "size": 4473,
            "upload_time": "2023-01-03T12:09:08",
            "upload_time_iso_8601": "2023-01-03T12:09:08.681205Z",
            "url": "https://files.pythonhosted.org/packages/4f/3b/c6f0c21ba422815300864068d2f8bb5a28f1ae1746a72ddd8721a88cc374/razer_chroma_keyboard-0.0.1.post2.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2023-01-03 12:09:08",
    "github": false,
    "gitlab": false,
    "bitbucket": false,
    "lcname": "razer-chroma-keyboard"
}
        
Elapsed time: 0.02883s