All Projects → danleyb2 → php2python

danleyb2 / php2python

Licence: MIT license
No description or website provided.

Programming Languages

python
139335 projects - #7 most used programming language
PHP
23972 projects - #3 most used programming language

Labels

Projects that are alternatives of or similar to php2python

mathconverter
Converts from AsciiMath, LaTeX, MathML to LaTeX, MathML
Stars: ✭ 35 (+84.21%)
Mutual labels:  converts
ng-html-to-pdf-save
Save HTML as pdf file on the browser with angularjs .
Stars: ✭ 29 (+52.63%)
Mutual labels:  converts
Picture-To-Ascii
Converts a picture to Ascii.
Stars: ✭ 18 (-5.26%)
Mutual labels:  converts
colors-convert
🦚 A simple colors library
Stars: ✭ 15 (-21.05%)
Mutual labels:  converts
SwiftyIllustrator
A tool for quickly converting Adobe Illustrator shapes into SwiftUI code.
Stars: ✭ 26 (+36.84%)
Mutual labels:  converts
gedcom
👪 A Go library and CLI tools for encoding, decoding, traversing, merging, comparing, querying and publishing GEDCOM files.
Stars: ✭ 55 (+189.47%)
Mutual labels:  converts
color
A library of well-tested helper methods for working with colors.
Stars: ✭ 13 (-31.58%)
Mutual labels:  converts
md2gemini
File converter from Markdown to Gemini.
Stars: ✭ 128 (+573.68%)
Mutual labels:  converts
srcset.sh
A command line script that generates multiple responsive versions of an image at width breakpoints -- 320,480,640,768,960,1024,1280,1440 pixels wide -- that match common Mobile and widescreen desktop/laptop viewports using Imagemagick's convert utility and outputs the needed <img/> tag
Stars: ✭ 20 (+5.26%)
Mutual labels:  converts
FileConvert
Converts between file formats such as CSV and Parquet
Stars: ✭ 14 (-26.32%)
Mutual labels:  converts
alfred-string-operations
Perform string operations to clipboard content
Stars: ✭ 70 (+268.42%)
Mutual labels:  converts
EscherConverter
A standalone program that reads files created with the graphical network editor Escher and converts them to files in community standard formats.
Stars: ✭ 14 (-26.32%)
Mutual labels:  converts
lambda2js
Converts a C# expression tree (from Linq namespace) to a syntatically correct javascript code.
Stars: ✭ 51 (+168.42%)
Mutual labels:  converts

PHP to PYTHON

A python script to convert simple php code to python, It just converts the basic syntax It is the one i use in the conversion mpg25/Instagram-API in PHP to danleyb2/Instagram-API in PYTHON

Installation

    
    pip install convert2php

usage

    $ python php2python.py -h
   
    usage: php2python.py [-h] -s SCRIPT [-o]
    
    PHP to PYTHON syntax converter.
    
    optional arguments:
      -h, --help            show this help message and exit
      -s SCRIPT, --script SCRIPT
                            Path to PHP script
      -o, --overwrite       Overwrite Python script if exists


    $ python php2python.py -s test_scripts/Caption.php
    
    Converting: test_scripts/Caption.php. Output file will be: test_scripts/Caption.py
    # Remove opening and closing <?php
    # convert $this-> to self.
    # convert :: to .
    # delete all }
    # delete namespace|require_once|include_once
    # convert protected $var to self.var = None then move into __init__
    # convert public|protected function to def
    # add `self` to function signatures
    # classes not children to extend `object`
    # convert $ to ''
    # convert ; to ''
    # convert new to ''
    Converted: test_scripts/Caption.php. to: test_scripts/Caption.py. { Go on, Proof Check :) }

    
    $ python php2python.py -s test_scripts/Caption.php
    Sorry, A python Script test_scripts/Caption.py already exist, use -o to overwrite.
    
Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].