Metadata-Version: 2.4
Name: pydatau
Version: 1.0.2
Summary: Expandable module of statistical data utilities
Author-email: The Economist <29724411+econcz@users.noreply.github.com>
License-Expression: MIT
Project-URL: Homepage, https://github.com/econcz/pydatau
Project-URL: Bug Tracker, https://github.com/econcz/pydatau/issues
Keywords: data-science,ipython,R,stata,gams,ampl,matlab,octave
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.10
Classifier: Programming Language :: Python :: 3.11
Classifier: Programming Language :: Python :: 3.12
Classifier: Operating System :: OS Independent
Classifier: Topic :: Scientific/Engineering :: Information Analysis
Requires-Python: >=3.10
Description-Content-Type: text/markdown
License-File: LICENSE
Requires-Dist: papermill
Requires-Dist: rpy2
Requires-Dist: stata_kernel
Requires-Dist: oct2py
Provides-Extra: matlab
Requires-Dist: matlabengineforpython; extra == "matlab"
Dynamic: license-file

# DATAU - Batch Statistical Data Utilities

Cross-platform batch runner for statistical and numerical files.

## Installation

```bash
pip install pydatau
```

## Quick example
python:  
```python
from datau import autorun

autorun(path_data="my_project/data", pattern='master', log_limit=1)
```
bash:  
```bash
datau --path "my_project/data" --pattern "master" --log-limit 1
```

## Supported Extensions and Execution Method

| Extension | Language/Tool    | Method                      |
|-----------|------------------|-----------------------------|
| `.ipynb`  | Jupyter Notebook | `papermill`                 |
| `.R`      | R                | `rpy2.robjects`             |
| `.do`     | Stata            | Stata batch mode            |
| `.jl`     | Julia            | `julia` (must be in PATH)   |
| `.gms`    | GAMS             | `gams` (must be in PATH)    |
| `.run`    | AMPL             | `ampl` (must be in PATH)    |
| `.m`      | MATLAB/Octave    | `matlab.engine` or `Oct2Py` |

## User Reference

```python
autorun(path_data='...', pattern='...', *args, **kwargs)
```

Automatically runs matching statistical scripts in the given directory. Generates a number of `.log` files with outputs for each executed file.

**Parameters:**  

`path_data` : *str*, default = *current working directory*  
Path to the directory with input files.

`pattern` : *str*, optional  
Regex pattern to match filenames (not paths), such as *'master'*. Case-insensitive.

`date_fmt` : *str*, default = *'%Y%m%d_%H%M%S'*  
Datetime format for *.log* filenames.

`log_limit` : *int*, optional  
If set, limits the number of log files per script. Older logs beyond this limit will be deleted. Please note that you can turn off logging by setting `log_limit` to *0*.

`use_powershell` : *bool*, default = *False*  
If *True*, redirects via PowerShell on Windows. Ignored on POSIX.

## License

MIT License — see the [LICENSE](LICENSE) file.
