watch-import


Namewatch-import JSON
Version 0.0.2 PyPI version JSON
download
home_page
SummaryWatch target file/folder for changes in python files and import/reimport
upload_time2024-02-15 11:13:55
maintainer
docs_urlNone
authorDaniel Sundberg
requires_python>=3.8
licenseCopyright 2024 Daniel Sundberg Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the “Software”), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. 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 OR COPYRIGHT HOLDERS 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.
keywords import reimport save
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage No coveralls.
            # watch_import
Watch_import uses `watchfiles` to observe a file or folder. When a file is saved it will re/import that file into the watch_import context.


# Using as a file/folder watcher
```sh
> watch_import PATH/TO_PYTHON_FILES
```

# Using as an import
```python
from watch_import import watch_me

print('hello')
watch_me()
```

# Example use-case OCP CAD Viewer

```python
import cadquery as cq
from ocp_vscode import show
from watch_import import watch_me

body = cq.Workplane("XY").box(5, 10, 15)
show(body)

watch_me()
```

Run this file once and it will start watching and "re-run" once saved.

            

Raw data

            {
    "_id": null,
    "home_page": "",
    "name": "watch-import",
    "maintainer": "",
    "docs_url": null,
    "requires_python": ">=3.8",
    "maintainer_email": "",
    "keywords": "import,reimport,save",
    "author": "Daniel Sundberg",
    "author_email": "",
    "download_url": "https://files.pythonhosted.org/packages/2d/ec/241ee8d3b4b7a05af9575888e1691692504676a1f3ea5142e7e6f6e9e793/watch_import-0.0.2.tar.gz",
    "platform": null,
    "description": "# watch_import\nWatch_import uses `watchfiles` to observe a file or folder. When a file is saved it will re/import that file into the watch_import context.\n\n\n# Using as a file/folder watcher\n```sh\n> watch_import PATH/TO_PYTHON_FILES\n```\n\n# Using as an import\n```python\nfrom watch_import import watch_me\n\nprint('hello')\nwatch_me()\n```\n\n# Example use-case OCP CAD Viewer\n\n```python\nimport cadquery as cq\nfrom ocp_vscode import show\nfrom watch_import import watch_me\n\nbody = cq.Workplane(\"XY\").box(5, 10, 15)\nshow(body)\n\nwatch_me()\n```\n\nRun this file once and it will start watching and \"re-run\" once saved.\n",
    "bugtrack_url": null,
    "license": "Copyright 2024 Daniel Sundberg  Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the \u201cSoftware\u201d), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:  The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.  THE SOFTWARE IS PROVIDED \u201cAS IS\u201d, 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 OR COPYRIGHT HOLDERS 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.",
    "summary": "Watch target file/folder for changes in python files and import/reimport",
    "version": "0.0.2",
    "project_urls": null,
    "split_keywords": [
        "import",
        "reimport",
        "save"
    ],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "e21c699d816d7d4eaab247d417ebd45e2455cec39159f0dcec2e61ee606e4d36",
                "md5": "51aabc5999a43bb49d0d3a07b561953c",
                "sha256": "26a85e517b5117a35e1c4788e70a62b5410f469eea8f0c7b3df54f74544e06a1"
            },
            "downloads": -1,
            "filename": "watch_import-0.0.2-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "51aabc5999a43bb49d0d3a07b561953c",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": ">=3.8",
            "size": 4316,
            "upload_time": "2024-02-15T11:13:53",
            "upload_time_iso_8601": "2024-02-15T11:13:53.848719Z",
            "url": "https://files.pythonhosted.org/packages/e2/1c/699d816d7d4eaab247d417ebd45e2455cec39159f0dcec2e61ee606e4d36/watch_import-0.0.2-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "2dec241ee8d3b4b7a05af9575888e1691692504676a1f3ea5142e7e6f6e9e793",
                "md5": "533992eb0e6e664808c8f5fbc317b1a8",
                "sha256": "5349cb61ec23fc4643b8835e81423292a4245df71375ccf9b4f960954c9fcfb6"
            },
            "downloads": -1,
            "filename": "watch_import-0.0.2.tar.gz",
            "has_sig": false,
            "md5_digest": "533992eb0e6e664808c8f5fbc317b1a8",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": ">=3.8",
            "size": 3237,
            "upload_time": "2024-02-15T11:13:55",
            "upload_time_iso_8601": "2024-02-15T11:13:55.718537Z",
            "url": "https://files.pythonhosted.org/packages/2d/ec/241ee8d3b4b7a05af9575888e1691692504676a1f3ea5142e7e6f6e9e793/watch_import-0.0.2.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2024-02-15 11:13:55",
    "github": false,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "lcname": "watch-import"
}
        
Elapsed time: 3.39761s