Metadata-Version: 2.1
Name: watch_import
Version: 0.0.2
Summary: Watch target file/folder for changes in python files and import/reimport
Author: Daniel Sundberg
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 “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
Classifier: Programming Language :: Python :: 3
Classifier: License :: OSI Approved :: MIT License
Requires-Python: >=3.8
Description-Content-Type: text/markdown
License-File: LICENSE
Requires-Dist: watchfiles

# 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.
