Metadata-Version: 2.4
Name: pyxfile
Version: 0.1.7
Summary: Common file operations for Python — simple, strict, stdlib-only.
Author: xfile contributors
License-Expression: MIT
License-File: LICENSE
Keywords: file,filesystem,io,path
Classifier: Development Status :: 3 - Alpha
Classifier: Intended Audience :: Developers
Classifier: License :: OSI Approved :: MIT License
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.9
Classifier: Programming Language :: Python :: 3.10
Classifier: Programming Language :: Python :: 3.11
Classifier: Programming Language :: Python :: 3.12
Classifier: Typing :: Typed
Requires-Python: >=3.9
Provides-Extra: dev
Requires-Dist: pytest>=7.0; extra == 'dev'
Provides-Extra: publish
Requires-Dist: build>=1.0; extra == 'publish'
Requires-Dist: hatchling; extra == 'publish'
Requires-Dist: twine>=5.0; extra == 'publish'
Description-Content-Type: text/markdown

# xfile

Common file operations for Python — simple, strict, stdlib-only.

## Install

```bash
pip install pyxfile
```

Then:

```python
import xfile
```

## Usage

```python
import xfile

xfile.ensure_dir("data")
xfile.write_text("data/hello.txt", "hi")
print(xfile.read_text("data/hello.txt"))

xfile.write_json("data/config.json", {"debug": True})
xfile.copy("data/config.json", "data/config.bak.json")

for path in xfile.list_dir("data", pattern="*.json"):
    print(path.name)
```

## Behavior

- Strict errors: missing paths and type mismatches raise standard exceptions
- `write_*` does **not** create parent directories — call `ensure_dir` first
- `copy` / `move` refuse to overwrite unless `overwrite=True`
- `remove` deletes directories recursively; use `missing_ok=True` to ignore missing paths
- Zero third-party runtime dependencies (Python stdlib only)

## Publish

Credentials come from `~/.pypirc` (`[pypi]` / `[testpypi]`). `TWINE_*` env vars override if set.

```bash
./scripts/publish.sh test   # TestPyPI
./scripts/publish.sh prod   # PyPI (asks for confirmation)

DRY_RUN=1 ./scripts/publish.sh test   # build + check only
```

## License

MIT
