win-pos


Namewin-pos JSON
Version 0.1.0 PyPI version JSON
download
home_pagehttps://github.com/liam-edwards/python-window-positions
SummaryAdd utility methods that allow you to easily grab the position of a window
upload_time2023-02-06 02:53:39
maintainer
docs_urlNone
authorLiam Edwards
requires_python>=3.7
licenseLICENSE.txt
keywords windows window position helpers human friendly python
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage No coveralls.
            A tiny Python utility library used to get the bounds of an application window.

The `get_window_pos` function takes either a string, or a callable
where the first argument is a string and that returns a boolean.

As an example, we'll get the position of Discord. As Discord's window title
can vary depending on what server and channel you're in, we'll take advantage
of the expected callable and pass a lambda to see if the window ends with `'Discord'`.

```python
from WinPos import get_window_pos

get_window_pos(lambda title: title.endswith('Discord'))
# (619, 473, 1624, 716)
```

Not all windows are as complicated as Discord, fortunately. If the window you're
trying to get the position of is static and never changes, you can simply pass
a string through and get your value.

```python
from WinPos import get_window_pos

get_window_pos('Task Manager')
# (125, 117, 895, 726)
```

If for whatever reason you need to repeatedly get the position of the same window,
you can import `get_window_hwnd` and `get_window_pos_from_hwnd` functions. This will
save some time from not having to iterate over every application to check the title.

```python
from WinPos import get_window_hwnd, get_window_pos_from_hwnd

hwnd = get_window_hwnd('Task Manager')
get_window_pos_from_hwnd(hwnd)
# (125, 117, 895, 726)
```

            

Raw data

            {
    "_id": null,
    "home_page": "https://github.com/liam-edwards/python-window-positions",
    "name": "win-pos",
    "maintainer": "",
    "docs_url": null,
    "requires_python": ">=3.7",
    "maintainer_email": "",
    "keywords": "windows,window,position,helpers,human friendly,python",
    "author": "Liam Edwards",
    "author_email": "me@liamedwards.dev",
    "download_url": "https://files.pythonhosted.org/packages/3f/d3/6afb8b10b02c08ca29c2e6656cc98f1228ff311f94e2449022a1cfac0e8a/win-pos-0.1.0.tar.gz",
    "platform": null,
    "description": "A tiny Python utility library used to get the bounds of an application window.\n\nThe `get_window_pos` function takes either a string, or a callable\nwhere the first argument is a string and that returns a boolean.\n\nAs an example, we'll get the position of Discord. As Discord's window title\ncan vary depending on what server and channel you're in, we'll take advantage\nof the expected callable and pass a lambda to see if the window ends with `'Discord'`.\n\n```python\nfrom WinPos import get_window_pos\n\nget_window_pos(lambda title: title.endswith('Discord'))\n# (619, 473, 1624, 716)\n```\n\nNot all windows are as complicated as Discord, fortunately. If the window you're\ntrying to get the position of is static and never changes, you can simply pass\na string through and get your value.\n\n```python\nfrom WinPos import get_window_pos\n\nget_window_pos('Task Manager')\n# (125, 117, 895, 726)\n```\n\nIf for whatever reason you need to repeatedly get the position of the same window,\nyou can import `get_window_hwnd` and `get_window_pos_from_hwnd` functions. This will\nsave some time from not having to iterate over every application to check the title.\n\n```python\nfrom WinPos import get_window_hwnd, get_window_pos_from_hwnd\n\nhwnd = get_window_hwnd('Task Manager')\nget_window_pos_from_hwnd(hwnd)\n# (125, 117, 895, 726)\n```\n",
    "bugtrack_url": null,
    "license": "LICENSE.txt",
    "summary": "Add utility methods that allow you to easily grab the position of a window",
    "version": "0.1.0",
    "split_keywords": [
        "windows",
        "window",
        "position",
        "helpers",
        "human friendly",
        "python"
    ],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "3271b63df8943eb39b5138517a7557ba07a064d7634626dd0289d978c38106e9",
                "md5": "dcc669c4fdad2cb15752658a8b7d5009",
                "sha256": "1317ad7ef8db5a00f31f483d8b9b7f59c261c4a7f46b1ac7d53c1fcf9556419f"
            },
            "downloads": -1,
            "filename": "win_pos-0.1.0-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "dcc669c4fdad2cb15752658a8b7d5009",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": ">=3.7",
            "size": 2769,
            "upload_time": "2023-02-06T02:53:38",
            "upload_time_iso_8601": "2023-02-06T02:53:38.743850Z",
            "url": "https://files.pythonhosted.org/packages/32/71/b63df8943eb39b5138517a7557ba07a064d7634626dd0289d978c38106e9/win_pos-0.1.0-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "3fd36afb8b10b02c08ca29c2e6656cc98f1228ff311f94e2449022a1cfac0e8a",
                "md5": "ca8adf9d094db773ef71b2da0556bd4d",
                "sha256": "f36aba05294a99eac2f87d0a2c7511de22286a9b177aa1a06c1f63ae9a8f248e"
            },
            "downloads": -1,
            "filename": "win-pos-0.1.0.tar.gz",
            "has_sig": false,
            "md5_digest": "ca8adf9d094db773ef71b2da0556bd4d",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": ">=3.7",
            "size": 2833,
            "upload_time": "2023-02-06T02:53:39",
            "upload_time_iso_8601": "2023-02-06T02:53:39.791775Z",
            "url": "https://files.pythonhosted.org/packages/3f/d3/6afb8b10b02c08ca29c2e6656cc98f1228ff311f94e2449022a1cfac0e8a/win-pos-0.1.0.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2023-02-06 02:53:39",
    "github": true,
    "gitlab": false,
    "bitbucket": false,
    "github_user": "liam-edwards",
    "github_project": "python-window-positions",
    "travis_ci": false,
    "coveralls": false,
    "github_actions": true,
    "tox": true,
    "lcname": "win-pos"
}
        
Elapsed time: 0.03662s