{"id":15753716,"url":"https://github.com/marella/phython","last_synced_at":"2025-03-31T07:42:31.141Z","repository":{"id":66207402,"uuid":"76745760","full_name":"marella/phython","owner":"marella","description":"Call Python modules and functions from PHP.","archived":false,"fork":false,"pushed_at":"2016-12-20T15:25:47.000Z","size":20,"stargazers_count":2,"open_issues_count":0,"forks_count":0,"subscribers_count":3,"default_branch":"master","last_synced_at":"2025-02-06T12:15:57.623Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"PHP","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/marella.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":".github/CONTRIBUTING.md","funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2016-12-17T20:41:21.000Z","updated_at":"2020-10-24T18:34:57.000Z","dependencies_parsed_at":"2023-05-30T00:45:10.805Z","dependency_job_id":null,"html_url":"https://github.com/marella/phython","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/marella%2Fphython","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/marella%2Fphython/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/marella%2Fphython/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/marella%2Fphython/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/marella","download_url":"https://codeload.github.com/marella/phython/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":246436052,"owners_count":20776960,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-10-04T07:41:48.123Z","updated_at":"2025-03-31T07:42:31.121Z","avatar_url":"https://github.com/marella.png","language":"PHP","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Phython\n\n[![Coverage Status](https://coveralls.io/repos/github/marella/phython/badge.svg?branch=master)](https://coveralls.io/github/marella/phython?branch=master)\n[![Build Status](https://travis-ci.org/marella/phython.svg?branch=master)](https://travis-ci.org/marella/phython)\n[![StyleCI](https://styleci.io/repos/76745760/shield?style=flat)](https://styleci.io/repos/76745760)\n[![Latest Stable Version](https://poser.pugx.org/marella/phython/v/stable)](https://packagist.org/packages/marella/phython) [![Total Downloads](https://poser.pugx.org/marella/phython/downloads)](https://packagist.org/packages/marella/phython) [![Latest Unstable Version](https://poser.pugx.org/marella/phython/v/unstable)](https://packagist.org/packages/marella/phython) [![License](https://poser.pugx.org/marella/phython/license)](https://packagist.org/packages/marella/phython)\n\nCall Python modules and functions from PHP.\n\n### Quick Usage\n\n```sh\ncomposer require marella/phython\n```\n\n```php\n\u003c?php\n\nrequire 'vendor/autoload.php';\n\nuse Phython\\Python;\n\n// Example: sort an array using python\n$array = [5, 3, 1, 2, 4];\n\n// setup\n$python = new Python('/path/to/your/python/modules/directory');\n$sort = $python-\u003efrom('array')-\u003eimport('sort');\n\n// call python function and get its return value\n$sorted = $sort($array); // [1, 2, 3, 4, 5]\n\n// multiple arguments\n$reversed = $sort($array, /* reverse */ true); // [5, 4, 3, 2, 1]\n\n// asynchronous call\n$process = $sort-\u003easync($array); // background python process object\n// do other stuff\n$sorted = $process-\u003eoutput(); // [1, 2, 3, 4, 5] (waits till python function returns)\n```\n\nwhere `array.py` contains `sort` function:\n```py\ndef sort(array, reverse=False):\n    array.sort()\n    if reverse:\n        array.reverse()\n    return array\n```\n\n### Documentation\nSee the **[wiki]** for more details and documentation.\n\n### Contributing\nSee [contributing guidelines] before creating issues or pull requests.\n\n### License\nOpen-source software released under [the MIT license][license].\n\n[wiki]: https://github.com/marella/phython/wiki\n[contributing guidelines]: /.github/CONTRIBUTING.md\n[license]: /LICENSE\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmarella%2Fphython","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmarella%2Fphython","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmarella%2Fphython/lists"}