{ "info": { "author": "Addison Elliott", "author_email": "addison.elliott@gmail.com", "bugtrack_url": null, "classifiers": [ "License :: OSI Approved :: MIT License", "Programming Language :: Python", "Programming Language :: Python :: 3", "Programming Language :: Python :: 3.4", "Programming Language :: Python :: 3.5", "Programming Language :: Python :: 3.6", "Topic :: Scientific/Engineering" ], "description": "\n[![PyPI - Python Version](https://img.shields.io/pypi/pyversions/pyqt5ac.svg)](https://pypi.org/project/pyqt5ac/)\n[![PyPI](https://img.shields.io/pypi/v/pyqt5ac.svg)](https://pypi.org/project/pyqt5ac/)\n[![PyPI - License](https://img.shields.io/pypi/l/pyqt5ac.svg)](https://github.com/addisonElliott/pyqt5ac/blob/master/LICENSE)\n\nPyQt5 Auto Compiler (pyqt5ac)\n=============================\npyqt5ac is a Python package for automatically compiling Qt's UI and QRC files into Python files.\n\nIn PyQt5, [Qt Designer](https://www.qt.io/) is the application used to create a GUI using a drag-and-drop interface. This interface is stored in a *.ui* file and any resources such as images or icons are stored in a *.qrc* file.\n\nThese two filetypes must be compiled into Python files before they can be used in your Python program. There are a few ways to go about this currently:\n1. Manually compile the files using the command line and pyuic5 for *.ui* files and pyrcc5 for *.qrc* files.\n2. Compile the files each time the application is started up by calling pyuic5 and pyrcc5 within your Python script\n\nThe downside to the first method is that it can be a tedious endeavor to compile the files, especially when one is faced with a larger project with many of these files that need to be compiled. Although the second method eliminates the tediousness of compilation, these files are compiled **every** time you run your script, regardless of if anything has been changed. This can cause a hit in performance and take longer to startup your script.\n\n### Enter **pyqt5ac**!\npyqt5ac provides a command-line interface (CLI) that searches through your files and automatically compiles any *.ui* or *.qrc* files. In addition, pyqt5ac can be called from your Python script. In both instances, **ui and resource files are only compiled if they have been updated**.\n\nInstalling\n==========\npyqt5ac is currently available on [PyPi](https://pypi.python.org/pypi/pyqt5ac/). The simplest way to\ninstall alone is using ``pip`` at a command line\n\n pip install pyqt5ac\n\nwhich installs the latest release. To install the latest code from the repository (usually stable, but may have\nundocumented changes or bugs)\n\n pip install git+https://github.com/addisonElliott/pyqt5ac.git\n\nFor developers, you can clone the pyqt5ac repository and run the ``setup.py`` file. Use the following commands to get\na copy from GitHub and install all dependencies\n\n git clone https://github.com/addisonElliott/pyqt5ac.git\n cd pyqt5ac\n pip install .\n\nor, for the last line, instead use\n\n pip install -e .\n\nto install in 'develop' or 'editable' mode, where changes can be made to the local working code and Python will use\nthe updated polarTransform code.\n\nGetting Started\n===============\n\nRunning from Command Line\n-------------------------\nIf pyqt5ac is installed via pip, the command line interface can be called like any Unix based program in the terminal\n\n pyqt5ac [OPTIONS] [IOPATHS]...\n\nIn the interface, the options have slightly different names so reference the help file of the interface for more information. The largest difference is that the ioPaths argument is instead a list of space delineated paths where the even items are the source file expression and the odd items are the destination file expression.\n\nThe help file of the interface can be run as\n\n pyqt5ac --help\n\nRunning from Python Script\n--------------------------\nThe following snippet of code below demonstrates how to call pyqt5ac from your Python script\n\n```python\nimport pyqt5ac\n\nif debug:\n pyqt5ac.main(rccOptions='', uicOptions='--from-imports', force=False, config='',\n ioPaths=[['gui/*.ui', 'generated/%%FILENAME%%_ui.py'],\n ['resources/*.qrc', 'generated/%%FILENAME%%_rc.py']])\n```\n\nConfiguration Options\n=====================\nAll of the options that can be specified to pyqt5ac can also be placed in a configuration file (JSON or YAML). My recommendation is to use a configuration file to allow easy compilation of your software. For testing purposes, I would use the options in the command line interface to make get everything working and then transcribe that into a configuration file for repeated use.\n\nWhether running via the command line or from a script, the arguments and options that can be given are the same. The valid options are:\n* **rccOptions** - Additional options to pass to the resource compiler. See the man page of pyrcc5 for more information on options. An example of a valid option would be \"-compress 1\". Default is to pass no options.\n* **uicOptions** - Additional options to pass to the UI compiler. See the man page of pyuic5 for more information on options. An example of a valid option would be '--from-imports'. Default is to pass no options.\n* **force** - Specifies whether to force compile all of the files found. The default is false meaning only outdated files will be compiled.\n* **config** - JSON or YAML configuration file that contains information about these parameters.\n* **ioPaths** - This is a 2D list containing information about what source files to compile and where to place the source files. The first column is the source file global expression (meaning you can use wildcards, ** for recursive folder search, ? for options, etc to match filenames) and the second column is the destination file expression. The destination file expression recognizes 'special' variables that will be replaced with information from the source filename:\n * %%FILENAME%% - Filename of the source file without the extension\n * %%EXT%% - Extension excluding the period of the file (e.g. ui or qrc)\n * %%DIRNAME%% - Directory of the source file\n\nExample\n=======\nTake the following file structure as an example project where any UI and QRC files need to be compiled. Assume that pyuic5 and pyrcc5 are located in /usr/bin and that '--from-imports' is desired for the UIC compiler.\n\n```\n|-- gui\n| |-- mainWindow.ui\n| |-- addDataDialog.ui\n| `-- saveDataDialog.ui\n|-- resources\n| |-- images\n| |-- stylesheets\n| |-- app.qrc\n| `-- style.qrc\n|-- modules\n| |-- welcome\n| |-- module.ui\n| `-- resources\n| |-- images\n| `-- module.qrc\n| `-- dataProbe\n| |-- module.ui\n| `-- resources\n| |-- images\n| `-- module.qrc\n```\n\nThe sections below demonstrate how to setup pyqt5ac to compile the necssary files given the file structure above.\n\nOption 1: YAML Config File (Recommended)\n---------------------------------------\n```YAML\nioPaths:\n -\n - \"gui/*.ui\"\n - \"generated/%%FILENAME%%_ui.py\"\n -\n - \"resources/*.qrc\"\n - \"generated/%%FILENAME_%%EXT%%.py\"\n -\n - \"modules/*/*.ui\"\n - \"%%DIRNAME%%/generated/%%FILENAME_ui.py\"\n -\n - \"modules/*/resources/*.qrc\"\n - \"%%DIRNAME%%/generated/%%FILENAME%%_rc.py\"\n\nuic_options: --from-imports\nforce: False\n```\n\nNow run pyqt5ac from the command line or Python script using your config file:\n```bash\npyqt5ac --config config.yml\n```\n\nor\n```python\nimport pyqt5ac\n\npyqt5ac.main(config='config.yml')\n```\n\nOption 2: JSON Config File (Recommended)\n---------------------------------------\n```JSON\n{\n \"ioPaths\": [\n [\"gui/*.ui\", \"generated/%%FILENAME%%_ui.py\"],\n [\"resources/*.qrc\", \"generated/%%FILENAME%%_rc.py\"],\n [\"modules/*/*.ui\", \"%%DIRNAME%%/generated/%%FILENAME%%_ui.py\"],\n [\"modules/*/resources/*.qrc\", \"%%DIRNAME%%/generated/%%FILENAME%%_rc.py\"]\n ],\n \"rcc_options\": \"\",\n \"uic_options\": \"--from-imports\",\n \"force\": false\n}\n```\n\nNow run pyqt5ac from the command line or Python script using your config file:\n```bash\npyqt5ac --config config.yml\n```\n\nor\n```python\nimport pyqt5ac\n\npyqt5ac.main(config='config.yml')\n```\n\nOption 3: Python Script\n-----------------------\n```python\nimport pyqt5ac\n\npyqt5ac.main(uicOptions='--from-imports', force=False, ioPaths=[\n ['gui/*.ui', 'generated/%%FILENAME%%_ui.py'],\n ['resources/*.qrc', 'generated/%%FILENAME%%_rc.py'],\n ['modules/*/*.ui', '%%DIRNAME%%/generated/%%FILENAME%%_ui.py'],\n ['modules/*/resources/*.qrc', '%%DIRNAME%%/generated/%%FILENAME%%_rc.py']\n ])\n```\n\nOption 4: Command Line\n----------------------\n```bash\npyqt5ac --uic_options \"--from-imports\" gui/*.ui generated/%%FILENAME%%_ui.py resources/*.qrc generated/%%FILENAME%%_rc.py modules/*/*.ui %%DIRNAME%%/generated/%%FILENAME%%_ui.py modules/*/resources/*.qrc %%DIRNAME%%/generated/%%FILENAME%%_rc.py\n```\n\nResulting File Structure\n------------------------\n```\n|-- gui\n| |-- mainWindow.ui\n| |-- addDataDialog.ui\n| `-- saveDataDialog.ui\n|-- resources\n| |-- images\n| |-- stylesheets\n| |-- app.qrc\n| `-- style.qrc\n|-- generated\n| |-- mainWindow_ui.py\n| |-- addDataDialog_ui.py\n| |-- saveDataDialog_ui.py\n| |-- app_rc.py\n| `-- style_rc.py\n|-- modules\n| |-- welcome\n| |-- module.ui\n| |-- resources\n| |-- images\n| `-- module.qrc\n| `-- generated\n| |-- module_ui.py\n| `-- module_rc.py\n| `-- dataProbe\n| |-- module.ui\n| |-- resources\n| |-- images\n| `-- module.qrc\n| `-- generated\n| |-- module_ui.py\n| `-- module_rc.py\n```\n\nSupport\n=======\nIssues and pull requests are encouraged! \n\nBugs can be submitted through the [issue tracker](https://github.com/addisonElliott/pyqt5ac/issues).\n\nPull requests are welcome too!\n\nLicense\n=================\npyqt5ac has an [MIT-based license](https://github.com/addisonElliott/pyqt5ac/blob/master/LICENSE).\n\n\n", "description_content_type": "text/markdown", "docs_url": null, "download_url": "", "downloads": { "last_day": -1, "last_month": -1, "last_week": -1 }, "home_page": "https://github.com/addisonElliott/pyqt5ac", "keywords": "pyqt pyqt5 qt qt5 qt auto compile generate ui rc pyuic5 pyrcc5 resource designer creator automatic", "license": "MIT License", "maintainer": "", "maintainer_email": "", "name": "pyqt5ac", "package_url": "https://pypi.org/project/pyqt5ac/", "platform": "", "project_url": "https://pypi.org/project/pyqt5ac/", "project_urls": { "Homepage": "https://github.com/addisonElliott/pyqt5ac", "Source": "https://github.com/addisonElliott/pyqt5ac", "Tracker": "https://github.com/addisonElliott/pyqt5ac/issues" }, "release_url": "https://pypi.org/project/pyqt5ac/1.0.3/", "requires_dist": [ "click", "pyyaml" ], "requires_python": ">=3", "summary": "Python module to automatically compile UI and RC files in PyQt5 to Python files", "version": "1.0.3" }, "last_serial": 4468440, "releases": { "1.0.0": [ { "comment_text": "", "digests": { "md5": "9cdeb5f6bbc06f60880ea5e4aba9be79", "sha256": "5195eb5096984089102c0c2b84beae2e5dd8282bd020991a3e805dea6c3eefc7" }, "downloads": -1, "filename": "pyqt5ac-1.0.0-py3-none-any.whl", "has_sig": false, "md5_digest": "9cdeb5f6bbc06f60880ea5e4aba9be79", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": ">=3", "size": 8601, "upload_time": "2018-10-31T18:21:37", "url": "https://files.pythonhosted.org/packages/a0/76/d84b22ee4dd37843ed9a16b3b60d79ad5194eea18b864dbd98f21083c99e/pyqt5ac-1.0.0-py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "4a4f9dce569fb828396bcfa3f2aaa3a7", "sha256": "d317008eed9d7ffb165eaebed9c6dc2b8c914324df44f0a8d342638281a48a91" }, "downloads": -1, "filename": "pyqt5ac-1.0.0.tar.gz", "has_sig": false, "md5_digest": "4a4f9dce569fb828396bcfa3f2aaa3a7", "packagetype": "sdist", "python_version": "source", "requires_python": ">=3", "size": 8965, "upload_time": "2018-10-31T18:21:38", "url": "https://files.pythonhosted.org/packages/3b/fd/b0263458f06b2ef3e8fa0f2fe7d07b1701454e5e68c5da128a718f550556/pyqt5ac-1.0.0.tar.gz" } ], "1.0.1": [ { "comment_text": "", "digests": { "md5": "9b251e8ad57df4f912eb1cd42ae9f109", "sha256": "70420cc1e5ec5cf65658148c90f7acfd5e73102a77629858014f9873f914c1db" }, "downloads": -1, "filename": "pyqt5ac-1.0.1-py3-none-any.whl", "has_sig": false, "md5_digest": "9b251e8ad57df4f912eb1cd42ae9f109", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": ">=3", "size": 8622, "upload_time": "2018-10-31T18:38:51", "url": "https://files.pythonhosted.org/packages/d6/39/74b7d4973b30bbcba5f4a3bfa04eae9095583a34299130af0184f9406337/pyqt5ac-1.0.1-py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "0011c7d104a387418d1bc66d699523a8", "sha256": "2b3f27306dd6f5041e2bc1e9b8fd86f1f72e1abe460762cc0b82275b5d0ffeda" }, "downloads": -1, "filename": "pyqt5ac-1.0.1.tar.gz", "has_sig": false, "md5_digest": "0011c7d104a387418d1bc66d699523a8", "packagetype": "sdist", "python_version": "source", "requires_python": ">=3", "size": 8938, "upload_time": "2018-10-31T18:38:52", "url": "https://files.pythonhosted.org/packages/9a/db/57f033e814d67116a2ed374c93778cc2a59ab33a72b3fb2edb7a7a28b61c/pyqt5ac-1.0.1.tar.gz" } ], "1.0.2": [ { "comment_text": "", "digests": { "md5": "cb85ed5db1dd513774fd4b5c7bcfc7e0", "sha256": "68b019833a2a19aed9946420cd9fc2c613cfabfa8752181c6ecd4fc07dd42ce3" }, "downloads": -1, "filename": "pyqt5ac-1.0.2-py3-none-any.whl", "has_sig": false, "md5_digest": "cb85ed5db1dd513774fd4b5c7bcfc7e0", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": ">=3", "size": 8842, "upload_time": "2018-11-06T17:02:14", "url": "https://files.pythonhosted.org/packages/40/1c/cfd644f7f2c6451d268964c39e21152a3ccbe4f3ab4205c925827d35a6b1/pyqt5ac-1.0.2-py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "b3bc7add4e15d1a1a775efc13fb99cff", "sha256": "c3839ee40c024d6d23519653bc3cb74ea4c793c9d77afe5533769d5c150f15b5" }, "downloads": -1, "filename": "pyqt5ac-1.0.2.tar.gz", "has_sig": false, "md5_digest": "b3bc7add4e15d1a1a775efc13fb99cff", "packagetype": "sdist", "python_version": "source", "requires_python": ">=3", "size": 9138, "upload_time": "2018-11-06T17:02:16", "url": "https://files.pythonhosted.org/packages/9e/98/91992518847bb290739a2e82cb025e7c9f083b5f588027e26b21e862808d/pyqt5ac-1.0.2.tar.gz" } ], "1.0.3": [ { "comment_text": "", "digests": { "md5": "32f4cfd8ce3db2dec2b1edf9a99d7e2f", "sha256": "dcbf8c40b7362d4d58188a79d13d6ce5cc8676a42b37603e8f88178d47e783a5" }, "downloads": -1, "filename": "pyqt5ac-1.0.3-py3-none-any.whl", "has_sig": false, "md5_digest": "32f4cfd8ce3db2dec2b1edf9a99d7e2f", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": ">=3", "size": 7795, "upload_time": "2018-11-09T07:15:21", "url": "https://files.pythonhosted.org/packages/6e/39/1ba41c3ed1cd83f49b5b540cd67dfa30cb83e97c3562ff1f339516a24505/pyqt5ac-1.0.3-py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "df97ee13acadd5f289e345b809ca9cf8", "sha256": "cec8237124c9face516a1ff5bf86446d0d0fe947da461ad0b33357cf0d15e284" }, "downloads": -1, "filename": "pyqt5ac-1.0.3.tar.gz", "has_sig": false, "md5_digest": "df97ee13acadd5f289e345b809ca9cf8", "packagetype": "sdist", "python_version": "source", "requires_python": ">=3", "size": 8788, "upload_time": "2018-11-09T07:15:23", "url": "https://files.pythonhosted.org/packages/a1/2e/ede8dd206ea4b439c951bb8466d24af59302acab13616037b2d479b3755e/pyqt5ac-1.0.3.tar.gz" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "32f4cfd8ce3db2dec2b1edf9a99d7e2f", "sha256": "dcbf8c40b7362d4d58188a79d13d6ce5cc8676a42b37603e8f88178d47e783a5" }, "downloads": -1, "filename": "pyqt5ac-1.0.3-py3-none-any.whl", "has_sig": false, "md5_digest": "32f4cfd8ce3db2dec2b1edf9a99d7e2f", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": ">=3", "size": 7795, "upload_time": "2018-11-09T07:15:21", "url": "https://files.pythonhosted.org/packages/6e/39/1ba41c3ed1cd83f49b5b540cd67dfa30cb83e97c3562ff1f339516a24505/pyqt5ac-1.0.3-py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "df97ee13acadd5f289e345b809ca9cf8", "sha256": "cec8237124c9face516a1ff5bf86446d0d0fe947da461ad0b33357cf0d15e284" }, "downloads": -1, "filename": "pyqt5ac-1.0.3.tar.gz", "has_sig": false, "md5_digest": "df97ee13acadd5f289e345b809ca9cf8", "packagetype": "sdist", "python_version": "source", "requires_python": ">=3", "size": 8788, "upload_time": "2018-11-09T07:15:23", "url": "https://files.pythonhosted.org/packages/a1/2e/ede8dd206ea4b439c951bb8466d24af59302acab13616037b2d479b3755e/pyqt5ac-1.0.3.tar.gz" } ] }