programmify


Nameprogrammify JSON
Version 0.0.8 PyPI version JSON
download
home_page
SummaryQuickly make a windows executable with a system tray icon and an configurable (read empty) PyQT5 window
upload_time2024-02-20 05:51:52
maintainer
docs_urlNone
author
requires_python>=3.10
licenseThis is free and unencumbered software released into the public domain. Anyone is free to copy, modify, publish, use, compile, sell, or distribute this software, either in source code form or as a compiled binary, for any purpose, commercial or non-commercial, and by any means. In jurisdictions that recognize copyright laws, the author or authors of this software dedicate any and all copyright interest in the software to the public domain. We make this dedication for the benefit of the public at large and to the detriment of our heirs and successors. We intend this dedication to be an overt act of relinquishment in perpetuity of all present and future rights to this software under copyright law. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. For more information, please refer to <https://unlicense.org>
keywords program app icon system tray pyqt5 windows executable pyinstaller
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage No coveralls.
            # Programmify
Quickly make a windows executable with a system tray icon and an configurable (read empty) PyQT5 window

![Sample Widget](https://raw.githubusercontent.com/modularizer/programmify/master/resources/full.png)

Task Manager
![Task Manager](https://raw.githubusercontent.com/modularizer/programmify/master/resources/task_manager.png)

**Yes! You can use your own icon**

### Features
* [x] Use your own icon
* [x] System tray icon (in task bar)
* [x] Window title (in window title bar)
* [x] Window icon (in window title bar)
* [x] Executable name (in File Explorer & Task Manager)
* [x] Executable file icon (in File Explorer & Task Manager)
* [x] PyQT Widget OR PyQT Main Window
* [x] executable with icon on desktop
* [x] can be pinned to taskbar

### Support
* [x] Windows
* [ ] Linux
* [ ] Mac

<hr/> 

# Quickstart

1. Make a new python project folder, let's call it `myprogram`
2. Make a virtual environment if you want, or just use your system python
3. Install `programmify`
    ```commandline
    pip install programmify
    ```
3. Make a new file in `myprogram`, let's call it `myapp.py`
4. import and use either `ProgrammifyWidget` or `ProgrammifyMainWindow` from `programmify` in your script
    ```python
    # myprogram/myapp.py
    from PyQt5 import QtWidgets
    
    from programmify import ProgrammifyWidget
    
    
    class MyWidget(ProgrammifyWidget):
        def setupUI(self):
            # Create a layout
            layout = QtWidgets.QVBoxLayout(self)
    
            # Add a label
            label = QtWidgets.QLabel("Hello, Programmify!")
            layout.addWidget(label)
    
            # Add a button
            button = QtWidgets.QPushButton("Click Me")
            button.clicked.connect(self.on_button_clicked)  # Connect to a method to handle the click event
            layout.addWidget(button)
    
            # Set the layout on the QWidget
            self.setLayout(layout)
    
        def on_button_clicked(self):
            QtWidgets.QMessageBox.information(self, "Action", "Button was clicked!")
    
    
    if __name__ == '__main__':
        MyWidget.run()
    ```
6. Build the executable

    From command prompt in the project directory:
    
    **(venv) C:\Users\user\myprogram>** `programmify --desktop`

NOTES:
* If you have ONLY one .py file in the current working directory you don't need to specify the file to build, otherwise you may need to specify `programmify myapp.py`
* include a `favicon.ico` in your current working directory to use as the icon for the program
* `--desktop` will copy the executable to your desktop

8. Run
An executable should have been created at `myprogram/myapp.exe` and also copied to your desktop. Double click to run!


<hr/> 

## Usage:
```commandline
programmify myapp.py --name testprogram --icon testicon.ico
```

### Advanced usage:
* `programmify --help` to see all options
* add `--show_cmd` to show the `pyinstaller` command that will be run instead of running it (useful for debugging)

```commandline
>programmify --help
usage: programmify [-h] [--name NAME] [--dst DST] [--icon ICON] [--mode MODE] [--nocleanup] [--show_cmd] [--cmd CMD] [--hidden_imports [HIDDEN_IMPORTS ...]]
                   [--extra_files [EXTRA_FILES ...]] [--debug] [--args ...] [--desktop] [--version VERSION]
                   file

positional arguments:
  file                  File to build. If not specified, will try ... 
                            1. main.py in current working directory if found 
                            2. __main__.py 
                            3. the only .py file in the current working directory if only one is found (excluding __init__.py) 
                            4. if there is a src directory, will search in src and its subdirectories to find a single option 
                            5. if the above fails, will raise an error and you will need to specify the file to build.

options:
  -h, --help            show this help message and exit
  --name NAME           Program name. If not specified, the name of the either the file or its parent directory will be used.
  --dst DST             Destination directory for the built program
  --icon ICON           Path to a 16x16 .ico file. If not specified, will try to find favicon.ico or any other .ico or .png in the current working directory.
  --mode MODE           Program mode: window or widget
  --nocleanup           Cleanup build files
  --show_cmd            Show the command that will be run instead of running it
  --cmd CMD             Expert level: command to run instead of pyinstaller
  --hidden_imports [HIDDEN_IMPORTS ...]
                        Hidden imports
  --extra-files [EXTRA_FILES ...]
                        Extra files to include
  --debug               Does not run in windowed mode, instead shows the terminal and stdout
  --args ...            Additional arguments to pass to pyinstaller
  --desktop             Copy the file to the desktop
  --version VERSION     Adds the version string to the end of the program name. e.g. --version 1 => my_program v1
```

<hr/>

### Other Installed Scripts
* `png2ico` to convert a `.png` to a `.ico` file
  * see `png2ico --help` for usage

<hr/>

# Uses

#### Subprocess Widget

Run any subprocess command (bash) and display a live feed of stdout and stderr in a PyQT5 widget.

1. The program which gets called
```python
# count.py
import time
import sys

def count(start, stop, interval=1):
    for i in range(start, stop):
        print(i)
        sys.stdout.flush() # unfortunately, this is necessary to get the output to show up in the widget
        time.sleep(interval)
    sys.stderr.flush()
        
if __name__ == '__main__':
    start = int(sys.argv[1])
    stop = int(sys.argv[2])
    interval = int(sys.argv[3])
    count(start, stop, interval)
```

### BUG
IMPORTANT: `sys.stdout.flush()` is necessary to get the output to show up in the widget.
This is a bug I am working on fixing. It is not necessary when running main.py directly, only when running the executable.

2. The application which makes the widget and runs the subprocess command
```python
# main.py
from programmify import SubprocessWidget

if __name__ == '__main__':
    cmd = ["python", "count.py", '1000', '1010', '1']
    SubprocessWidget.run(cmd=cmd)
```

3. Build the executable
```commandline
programmify main.py --name count --extra-files count.py
```
* Note: `pyinstaller` doesn't see that we are depending on the `count.py` to be included as well, so we must specify

4. The output

![Subprocess Widget](https://raw.githubusercontent.com/modularizer/programmify/master/resources/count.gif)

            

Raw data

            {
    "_id": null,
    "home_page": "",
    "name": "programmify",
    "maintainer": "",
    "docs_url": null,
    "requires_python": ">=3.10",
    "maintainer_email": "",
    "keywords": "program,app,icon,system tray,pyqt5,windows,executable,pyinstaller",
    "author": "",
    "author_email": "Torin Halsted <modularizer@gmail.com>",
    "download_url": "https://files.pythonhosted.org/packages/87/00/4976fc5bf97b037ba054616f4955196263f7cab30ea0389c0ca89497db13/programmify-0.0.8.tar.gz",
    "platform": null,
    "description": "# Programmify\nQuickly make a windows executable with a system tray icon and an configurable (read empty) PyQT5 window\n\n![Sample Widget](https://raw.githubusercontent.com/modularizer/programmify/master/resources/full.png)\n\nTask Manager\n![Task Manager](https://raw.githubusercontent.com/modularizer/programmify/master/resources/task_manager.png)\n\n**Yes! You can use your own icon**\n\n### Features\n* [x] Use your own icon\n* [x] System tray icon (in task bar)\n* [x] Window title (in window title bar)\n* [x] Window icon (in window title bar)\n* [x] Executable name (in File Explorer & Task Manager)\n* [x] Executable file icon (in File Explorer & Task Manager)\n* [x] PyQT Widget OR PyQT Main Window\n* [x] executable with icon on desktop\n* [x] can be pinned to taskbar\n\n### Support\n* [x] Windows\n* [ ] Linux\n* [ ] Mac\n\n<hr/> \n\n# Quickstart\n\n1. Make a new python project folder, let's call it `myprogram`\n2. Make a virtual environment if you want, or just use your system python\n3. Install `programmify`\n    ```commandline\n    pip install programmify\n    ```\n3. Make a new file in `myprogram`, let's call it `myapp.py`\n4. import and use either `ProgrammifyWidget` or `ProgrammifyMainWindow` from `programmify` in your script\n    ```python\n    # myprogram/myapp.py\n    from PyQt5 import QtWidgets\n    \n    from programmify import ProgrammifyWidget\n    \n    \n    class MyWidget(ProgrammifyWidget):\n        def setupUI(self):\n            # Create a layout\n            layout = QtWidgets.QVBoxLayout(self)\n    \n            # Add a label\n            label = QtWidgets.QLabel(\"Hello, Programmify!\")\n            layout.addWidget(label)\n    \n            # Add a button\n            button = QtWidgets.QPushButton(\"Click Me\")\n            button.clicked.connect(self.on_button_clicked)  # Connect to a method to handle the click event\n            layout.addWidget(button)\n    \n            # Set the layout on the QWidget\n            self.setLayout(layout)\n    \n        def on_button_clicked(self):\n            QtWidgets.QMessageBox.information(self, \"Action\", \"Button was clicked!\")\n    \n    \n    if __name__ == '__main__':\n        MyWidget.run()\n    ```\n6. Build the executable\n\n    From command prompt in the project directory:\n    \n    **(venv) C:\\Users\\user\\myprogram>** `programmify --desktop`\n\nNOTES:\n* If you have ONLY one .py file in the current working directory you don't need to specify the file to build, otherwise you may need to specify `programmify myapp.py`\n* include a `favicon.ico` in your current working directory to use as the icon for the program\n* `--desktop` will copy the executable to your desktop\n\n8. Run\nAn executable should have been created at `myprogram/myapp.exe` and also copied to your desktop. Double click to run!\n\n\n<hr/> \n\n## Usage:\n```commandline\nprogrammify myapp.py --name testprogram --icon testicon.ico\n```\n\n### Advanced usage:\n* `programmify --help` to see all options\n* add `--show_cmd` to show the `pyinstaller` command that will be run instead of running it (useful for debugging)\n\n```commandline\n>programmify --help\nusage: programmify [-h] [--name NAME] [--dst DST] [--icon ICON] [--mode MODE] [--nocleanup] [--show_cmd] [--cmd CMD] [--hidden_imports [HIDDEN_IMPORTS ...]]\n                   [--extra_files [EXTRA_FILES ...]] [--debug] [--args ...] [--desktop] [--version VERSION]\n                   file\n\npositional arguments:\n  file                  File to build. If not specified, will try ... \n                            1. main.py in current working directory if found \n                            2. __main__.py \n                            3. the only .py file in the current working directory if only one is found (excluding __init__.py) \n                            4. if there is a src directory, will search in src and its subdirectories to find a single option \n                            5. if the above fails, will raise an error and you will need to specify the file to build.\n\noptions:\n  -h, --help            show this help message and exit\n  --name NAME           Program name. If not specified, the name of the either the file or its parent directory will be used.\n  --dst DST             Destination directory for the built program\n  --icon ICON           Path to a 16x16 .ico file. If not specified, will try to find favicon.ico or any other .ico or .png in the current working directory.\n  --mode MODE           Program mode: window or widget\n  --nocleanup           Cleanup build files\n  --show_cmd            Show the command that will be run instead of running it\n  --cmd CMD             Expert level: command to run instead of pyinstaller\n  --hidden_imports [HIDDEN_IMPORTS ...]\n                        Hidden imports\n  --extra-files [EXTRA_FILES ...]\n                        Extra files to include\n  --debug               Does not run in windowed mode, instead shows the terminal and stdout\n  --args ...            Additional arguments to pass to pyinstaller\n  --desktop             Copy the file to the desktop\n  --version VERSION     Adds the version string to the end of the program name. e.g. --version 1 => my_program v1\n```\n\n<hr/>\n\n### Other Installed Scripts\n* `png2ico` to convert a `.png` to a `.ico` file\n  * see `png2ico --help` for usage\n\n<hr/>\n\n# Uses\n\n#### Subprocess Widget\n\nRun any subprocess command (bash) and display a live feed of stdout and stderr in a PyQT5 widget.\n\n1. The program which gets called\n```python\n# count.py\nimport time\nimport sys\n\ndef count(start, stop, interval=1):\n    for i in range(start, stop):\n        print(i)\n        sys.stdout.flush() # unfortunately, this is necessary to get the output to show up in the widget\n        time.sleep(interval)\n    sys.stderr.flush()\n        \nif __name__ == '__main__':\n    start = int(sys.argv[1])\n    stop = int(sys.argv[2])\n    interval = int(sys.argv[3])\n    count(start, stop, interval)\n```\n\n### BUG\nIMPORTANT: `sys.stdout.flush()` is necessary to get the output to show up in the widget.\nThis is a bug I am working on fixing. It is not necessary when running main.py directly, only when running the executable.\n\n2. The application which makes the widget and runs the subprocess command\n```python\n# main.py\nfrom programmify import SubprocessWidget\n\nif __name__ == '__main__':\n    cmd = [\"python\", \"count.py\", '1000', '1010', '1']\n    SubprocessWidget.run(cmd=cmd)\n```\n\n3. Build the executable\n```commandline\nprogrammify main.py --name count --extra-files count.py\n```\n* Note: `pyinstaller` doesn't see that we are depending on the `count.py` to be included as well, so we must specify\n\n4. The output\n\n![Subprocess Widget](https://raw.githubusercontent.com/modularizer/programmify/master/resources/count.gif)\n",
    "bugtrack_url": null,
    "license": "This is free and unencumbered software released into the public domain.  Anyone is free to copy, modify, publish, use, compile, sell, or distribute this software, either in source code form or as a compiled binary, for any purpose, commercial or non-commercial, and by any means.  In jurisdictions that recognize copyright laws, the author or authors of this software dedicate any and all copyright interest in the software to the public domain. We make this dedication for the benefit of the public at large and to the detriment of our heirs and successors. We intend this dedication to be an overt act of relinquishment in perpetuity of all present and future rights to this software under copyright law.  THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.  For more information, please refer to <https://unlicense.org>",
    "summary": "Quickly make a windows executable with a system tray icon and an configurable (read empty) PyQT5 window",
    "version": "0.0.8",
    "project_urls": {
        "Homepage": "https://github.com/modularizer/programmify"
    },
    "split_keywords": [
        "program",
        "app",
        "icon",
        "system tray",
        "pyqt5",
        "windows",
        "executable",
        "pyinstaller"
    ],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "5da8d6ded55742e66c37d21eef01a5c146a945711bca3b33e3ed3788b08d1569",
                "md5": "81d59af4ac95e8893adcbeb05f5a1bf8",
                "sha256": "fe3cf77170f506b7e5dc12d383a4c504a734f46c69f6dae6fd155c1f7f9ee77c"
            },
            "downloads": -1,
            "filename": "programmify-0.0.8-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "81d59af4ac95e8893adcbeb05f5a1bf8",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": ">=3.10",
            "size": 15224,
            "upload_time": "2024-02-20T05:51:50",
            "upload_time_iso_8601": "2024-02-20T05:51:50.556966Z",
            "url": "https://files.pythonhosted.org/packages/5d/a8/d6ded55742e66c37d21eef01a5c146a945711bca3b33e3ed3788b08d1569/programmify-0.0.8-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "87004976fc5bf97b037ba054616f4955196263f7cab30ea0389c0ca89497db13",
                "md5": "f6c3521abcb509e0c01a1931d547759c",
                "sha256": "f8b066cdd389564544d4045d4fc398fbc256122766b2d1b88d11e8452e3010fb"
            },
            "downloads": -1,
            "filename": "programmify-0.0.8.tar.gz",
            "has_sig": false,
            "md5_digest": "f6c3521abcb509e0c01a1931d547759c",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": ">=3.10",
            "size": 1992393,
            "upload_time": "2024-02-20T05:51:52",
            "upload_time_iso_8601": "2024-02-20T05:51:52.919043Z",
            "url": "https://files.pythonhosted.org/packages/87/00/4976fc5bf97b037ba054616f4955196263f7cab30ea0389c0ca89497db13/programmify-0.0.8.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2024-02-20 05:51:52",
    "github": true,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "github_user": "modularizer",
    "github_project": "programmify",
    "travis_ci": false,
    "coveralls": false,
    "github_actions": true,
    "requirements": [],
    "lcname": "programmify"
}
        
Elapsed time: 0.19104s