Skip to main content

A python client for codegyan php compiler API

Project description

PHP Compiler Python Package

This Python package facilitates seamless compilation of PHP code through integration with the Codegyan API, streamlining the verification process and ensuring code correctness with minimal effort.

Installation

You can install the package via pip:

pip install php-compiler-py

Usage

Before using the Pakage, you need to obtain an API key and client ID from Codegyan. Follow these steps to get your API credentials:

  1. Sign Up/Login: If you don't have an account, sign up for a Codegyan account. If you already have an account, log in to your dashboard.

  2. Get Credentials: Once logged in, navigate to the Developer Console or API settings in your account dashboard. Here, you will find your API key and client ID. Copy these credentials and use them when initializing the Pakage in your code.

Here's an example of how to initialize the Pakage with your API key and client ID:

  • Import the compilePHP function from the package:
from php_compiler_py import compilePHP
  • Call the compilePHP function with your API key, client ID, and PHP code:
apiKey = 'your_api_key'
clientId = 'your_client_id'
code = '<?php echo "Hello, world!"; ?>'

result = compilePHP(apiKey, clientId, code)
print(result)

Replace 'your_api_key' and 'your_client_id' with your actual API key and client ID obtained from the Codegyan website. Replace with the code you want to compile.

The function will compile the provided PHP code using the Codegyan API and return the compilation result.

Features

  • PHP Code Compilation : The package provides a function compilePHP(apiKey, clientId, code) that allows users to compile PHP code using the Codegyan API. This feature enables developers to verify the correctness of their PHP code without the need for local PHP installations.

  • Simple Interface : With just a few lines of code, users can easily integrate the compilePHP function into their Python projects. The function takes API key, client ID, and PHP code as arguments, making it straightforward to use.

  • Error Handling : The package includes error handling to ensure robustness during compilation. If there are any issues with the compilation process, appropriate error messages are returned, allowing developers to identify and address problems effectively.

  • Customization Options : Users have the flexibility to customize the compilation process by providing their own API key and client ID. This customization ensures that developers can utilize their Codegyan account for PHP code compilation seamlessly.

  • License : The package is licensed under the MIT License, providing users with the freedom to use, modify, and distribute the code according to their requirements.

  • Compatibility : The package is compatible with both Python 2 and Python 3, ensuring that a wide range of Python environments can utilize its functionality without compatibility issues.

License

This project is licensed under the MIT License - see the License file for details.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

php_compiler_py-1.0.0.tar.gz (3.5 kB view hashes)

Uploaded Source

Built Distribution

php_compiler_py-1.0.0-py3-none-any.whl (4.0 kB view hashes)

Uploaded Python 3

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page