Metadata-Version: 2.4
Name: PyCodeTools
Version: 0.2.0
Summary: Run Python scripts with extra scripting helpers, and package them into .exe files from a simple GUI.
Author: Your Name
License: MIT
Project-URL: Homepage, https://github.com/yourname/pycodetools
Keywords: cli,scripting,pyinstaller,tkinter,build tools
Classifier: Programming Language :: Python :: 3
Classifier: License :: OSI Approved :: MIT License
Classifier: Operating System :: OS Independent
Classifier: Environment :: Console
Classifier: Topic :: Software Development :: Build Tools
Requires-Python: >=3.8
Description-Content-Type: text/markdown
Provides-Extra: build
Requires-Dist: pyinstaller>=6.0; extra == "build"

# PyCodeTools (PCT)

Run Python scripts with a few extra scripting helpers, and package them
into standalone `.exe` files from a simple Tkinter GUI — all from the
command line.

## Install

```bash
pip install PyCodeTools
```

This gives you two equivalent commands: `pycodetools` and `pct`.

## Enabling PCT in a script

Add this as the **first line** of your `.py` file:

```python
pycodetools = enabled
print("pycodetools")
```

That first line is what PCT looks for. Run the file through `pct` and
it detects the line, prints a confirmation, and unlocks the extra
helpers below. Run it with plain `python file.py` instead and it will
raise `NameError: name 'enabled' is not defined` — always launch
PCT-enabled scripts with `pct`, not `python`.

## Running a script

```bash
pct myscript.py
# or explicitly:
pct run myscript.py
# or the long form:
pycodetools myscript.py
```

If the enable line is found, you'll see:

```
pycodetools = enabled
PyCodeTools is now enabled for this run.
Running: py myscript.py
----------------------------------------
pycodetools
```

## Extra helpers in your script

Once enabled, your script can use the extra helper functions by
importing the package:

```python
pycodetools = enabled
import pycodetools as pct

if pct.enabled:
    pct.title("My App")
    pct.banner("Welcome!")
    print(pct.color("This is red text", "red"))
    pct.timer(3)
    if pct.confirm("Keep going?"):
        print("Continuing...")
    pct.pause()
```

Available helpers:

| Function | What it does |
|---|---|
| `pct.title(text)` | Sets the terminal window title |
| `pct.clear()` | Clears the terminal |
| `pct.pause(msg=...)` | "Press Enter to continue..." prompt |
| `pct.banner(text)` | Prints a boxed banner |
| `pct.color(text, name)` | Returns ANSI-colored text |
| `pct.timer(seconds)` | Countdown timer |
| `pct.confirm(prompt)` | Yes/No prompt, returns bool |
| `pct.enabled` | `True` if the enable line was detected |

## Config / Build GUI

```bash
pct config myscript.py
```

Opens a Tkinter window with two tabs:

- **Dependencies** — pick from a preset list of common packages (or type
  a custom one) and install them with pip.
- **Build .exe** — compile the script into a standalone executable using
  [PyInstaller](https://pyinstaller.org/), with options for one-file
  builds, hiding the console window, and naming the output.

Building `.exe` files requires PyInstaller:

```bash
pip install PyCodeTools[build]
```

## License

MIT
