PHPackages                             nikaia/php-python-bridge - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Utility &amp; Helpers](/categories/utility)
4. /
5. nikaia/php-python-bridge

ActiveLibrary[Utility &amp; Helpers](/categories/utility)

nikaia/php-python-bridge
========================

Call your NodeJS scripts from Php

v1.0.0(3y ago)3104MITPHPPHP ^8.0

Since Nov 16Pushed 3y ago1 watchersCompare

[ Source](https://github.com/nikaia/php-python-bridge)[ Packagist](https://packagist.org/packages/nikaia/php-python-bridge)[ Docs](https://github.com/nikaia/php-python-bridge)[ RSS](/packages/nikaia-php-python-bridge/feed)WikiDiscussions main Synced 1mo ago

READMEChangelogDependencies (5)Versions (2)Used By (0)

PHP Python Bridge
=================

[](#php-python-bridge)

[![Latest Version on Packagist](https://camo.githubusercontent.com/d9aadccabb0051348697844fd8aa86ca3a29b01d10c24254f2c68b82eeb4df17/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f6e696b6169612f7068702d707974686f6e2d6272696467652e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/nikaia/php-python-bridge)[![Tests](https://github.com/nikaia/php-python-bridge/actions/workflows/tests.yml/badge.svg?branch=main)](https://github.com/nikaia/php-python-bridge/actions/workflows/tests.yml)

Call your Python scripts from Php

Installation
------------

[](#installation)

You can install the package via composer:

```
composer require nikaia/php-python-bridge
```

Usage
-----

[](#usage)

The bridge work by executing a python script that accept piped json arbitary data, and returns json response.

> check [tests/\_fixtures/ok.script.py](tests/_fixtures/ok.script.py) for a working example.

```
use Nikaia\PythonBridge\Bridge;

try {
    $response = Bridge::create()
        ->setPython('/usr/local/bin/python')        // the path to the node (You can omit if in system path)
        ->setScript('/path/to/your/script.py')  // the path to your script
        ->pipe(['foo' => 'bar'])                // the data to pipe to the script
        ->run();
}
catch (BridgeException $e) {
    echo $e->getMessage();
}

var_dump($response->json());   // ['foo' => 'bar']
var_dump($response->output()); // the raw output of the script {"foo":"bar"}
```

Changelog
---------

[](#changelog)

Please see [CHANGELOG](CHANGELOG.md) for more information on what has changed recently.

Releases
--------

[](#releases)

This package use [semver](https://semver.org/) releases. Releases are managed using [standard-version](https://github.com/conventional-changelog/standard-version) node package, and requires adhering to [conventionalcommit](https://conventionalcommits.org) commit styles.

1. Implement a feature or a fix etc.
2. Use commit message like `fix: Fix an issue` or `feat: Implement a feature ...`
3. Or rewrite the commit message while squashing/closing the PR!!
4. Update your local project, checkout `main` branch
5. Run : `composer release` to generate changelog, and to tag to new release.
6. Check everything is okay.
7. Push the tag using `git push --follow-tags origin main`

> This repository is using [Semantic Pull Request bot](https://github.com/zeke/semantic-pull-requests) to enforce conventional commit message and PR titles

Credits
-------

[](#credits)

- [Nassif Bourguig](https://github.com/nbourguig)
- [All Contributors](../../contributors)

License
-------

[](#license)

The MIT License (MIT). Please see [License File](LICENSE.md) for more information.

###  Health Score

25

—

LowBetter than 37% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity13

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity51

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 100% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Unknown

Total

1

Last Release

1279d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/2357415d73716a023601d0bc95812c5160ff977f17da9d43fbdc40b047a05c50?d=identicon)[nbourguig](/maintainers/nbourguig)

---

Top Contributors

[![nbourguig](https://avatars.githubusercontent.com/u/276832?v=4)](https://github.com/nbourguig "nbourguig (9 commits)")

---

Tags

php python bridgeNikaia

###  Code Quality

TestsPHPUnit

Static AnalysisPHPStan

Code StylePHP CS Fixer

Type Coverage Yes

### Embed Badge

![Health badge](/badges/nikaia-php-python-bridge/health.svg)

```
[![Health](https://phpackages.com/badges/nikaia-php-python-bridge/health.svg)](https://phpackages.com/packages/nikaia-php-python-bridge)
```

###  Alternatives

[spatie/typescript-transformer

This is my package typescript-transformer

3706.5M16](/packages/spatie-typescript-transformer)[civicrm/civicrm-core

Open source constituent relationship management for non-profits, NGOs and advocacy organizations.

728272.9k20](/packages/civicrm-civicrm-core)[shivas/versioning-bundle

Symfony application versioning, simple console command to manage version (with providers e.g. git tag) of your application using Semantic Versioning 2.0.0 recommendations

1121.2M1](/packages/shivas-versioning-bundle)[eclipxe/cfdiutils

PHP Common utilities for Mexican CFDI 3.2, 3.3 &amp; 4.0

141129.9k6](/packages/eclipxe-cfdiutils)[shyim/danger-php

Port of danger to PHP

8544.9k](/packages/shyim-danger-php)[vaimo/composer-changelogs

Provide information about package changes based on changelog files that are bundled with releases; provide tools for generating documentation files from changelog sources

11150.5k10](/packages/vaimo-composer-changelogs)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
