https://github.com/erdogant/pyperl
Python package to run Perl scripts using Python
https://github.com/erdogant/pyperl
perl python
Last synced: 23 days ago
JSON representation
Python package to run Perl scripts using Python
- Host: GitHub
- URL: https://github.com/erdogant/pyperl
- Owner: erdogant
- License: mit
- Created: 2026-03-17T19:39:21.000Z (3 months ago)
- Default Branch: main
- Last Pushed: 2026-03-17T21:59:12.000Z (3 months ago)
- Last Synced: 2026-03-18T11:14:35.399Z (3 months ago)
- Topics: perl, python
- Language: Python
- Homepage:
- Size: 26 MB
- Stars: 0
- Watchers: 0
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.rst
- Funding: .github/FUNDING.yml
- License: LICENSE
Awesome Lists containing this project
README

[](https://github.com/erdogant/pyperl/blob/main/LICENSE)
[](https://github.com/erdogant/pyperl/network)
[](https://github.com/erdogant/pyperl/issues)
[](http://www.repostatus.org/#active)
[](https://erdogant.github.io/pyperl/)
[](https://erdogant.medium.com)

[](https://erdogant.github.io/pyperl/pages/html/Documentation.html#)
###
pyperl is a Python library that automatically installs and manages Perl, and provides a clean interface for running Perl scripts from Python, with zero manual Perl setup required.
Navigate to https://erdogant.github.io/pyperl for more detailed information. ⭐️ Star it if you like it ⭐️
---
### Key Features
| Feature | Description |
|--------|-------------|
| **Auto Perl Install** | Detects system Perl or installs a portable version automatically (Strawberry Perl on Windows, CPAN source on Linux/Mac). |
| **Cross-Platform** | Works on Windows, Linux, and macOS — handles the platform differences for you. |
| **Run Perl Scripts** | Execute any `.pl` script with arbitrary arguments directly from Python. |
| **Portable & Bundled** | Ships with bundled Perl archives so it works in offline or restricted environments. |
| **Logging Control** | Configurable verbosity from `"silent"` to `"debug"`. |
---
### Installation
##### Install from PyPI
```bash
pip install pyperl
```
##### Install from GitHub source
```bash
pip install git+https://github.com/erdogant/pyperl
```
---
### Quick Start
```python
from pyperl import pyperl
# Initialize — auto-detects or installs Perl
perl = pyperl()
# Run a Perl script
result = perl.run(script="my_script.pl")
print(result["stdout"])
```
##### Run a script with arguments
```python
from pyperl import pyperl
perl = pyperl(script="perl_scripts/convert_audio.pl")
audiofile = perl.import_example()
result = perl.run(audiofile, "c:\output.mp3")
print(result["stdout"])
print(result["returncode"]) # 0 = success
```
##### Use a custom installation directory
```python
from pyperl import pyperl
perl = pyperl(installation_dir="/opt/my_perl", set_to_path=True)
```
##### Force reinstall portable Perl
```python
from pyperl import pyperl
perl = pyperl(force_install=True)
```
---
### How It Works
On initialization, `pyperl` follows this resolution order:
1. **Check system PATH** — if `perl` is already available, use it.
2. **Search common directories** — checks `/usr/bin`, `/usr/local/bin`, `/opt/homebrew/bin`, and common Windows paths.
3. **Install portable Perl** — if no Perl is found, downloads and extracts a portable Perl package:
- **Windows**: [Strawberry Perl](https://strawberryperl.com/) portable ZIP
- **Linux/Mac**: Perl source from CPAN (tar.gz)
---
### Maintainer
* Erdogan Taskesen, github: [erdogant](https://github.com/erdogant)
* Contributions are welcome.
* Yes! This library is entirely **free** but it runs on coffee! :) Feel free to support with a Coffee.
[](https://www.buymeacoffee.com/erdogant)