kauffinger/pyman 问题修复 & 功能扩展

解决BUG、新增功能、兼容多环境部署,快速响应你的开发需求

邮箱:yvsm@zunyunkeji.com | QQ:316430983 | 微信:yvsm316

kauffinger/pyman

最新稳定版本:v0.0.3

Composer 安装命令:

composer require kauffinger/pyman

包简介

A skeleton repository for my packages

README 文档

README

Latest Version on Packagist Linting Tests Total Downloads

Pyman is a PHP package that simplifies the management of Python dependencies in PHP applications. It's designed to help you seamlessly integrate Python scripts and libraries into your PHP projects by handling virtual environment setup and dependency management.

Features

  • Automatic Python virtual environment creation
  • Python dependency management via requirements.txt
  • Easy integration with Laravel's Process handling
  • Robust error handling for common Python-related issues

Requirements

  • PHP 8.3+
  • Python 3.x
  • pip3

On Debian-based distros you might need python3.12-venv

Installation

You can install the package via composer:

composer require kauffinger/pyman

Usage

use Kauffinger\Pyman\PythonEnvironmentManager; use Illuminate\Process\Factory; // Initialize the manager with a base path for your Python environment $manager = new PythonEnvironmentManager('/path/to/python/environment', new Factory()); // Set up the environment (creates venv and installs dependencies) try { $manager->setup(); } catch (PymanException $e) { // Handle any setup errors echo $e->getMessage(); }

Requirements File

Create a requirements.txt file in your specified Python environment directory:

requests==2.31.0 # Add other Python dependencies as needed

Error Handling

The package throws PymanException in the following cases:

  • Python3 or pip3 is not installed
  • Failed to create the Python directory
  • Missing requirements.txt file
  • Failed to install Python dependencies
  • Failed to create virtual environment

Testing

composer test

Contributing

Please see CONTRIBUTING for details.

Security Vulnerabilities

Please review our security policy on how to report security vulnerabilities.

Credits

License

The MIT License (MIT). Please see License File for more information.

统计信息

  • 总下载量: 6.27k
  • 月度下载量: 0
  • 日度下载量: 0
  • 收藏数: 1
  • 点击次数: 1
  • 依赖项目数: 1
  • 推荐数: 0

GitHub 信息

  • Stars: 1
  • Watchers: 1
  • Forks: 0
  • 开发语言: PHP

其他信息

  • 授权协议: MIT
  • 更新时间: 2026-01-04

承接程序开发

PHP开发

VUE

Vue开发

前端开发

小程序开发

公众号开发

系统定制

数据库设计

云部署

网站建设

安全加固