Skip to main content

A Python library to interact with the Codegyan API

Project description

Codegyan Python Library

A Python library to interact with the Codegyan API.

Language PyPI - Downloads PyPI - License GitHub Downloads (all assets, all releases)

Installation

pip install codegyan

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 npm pakage with your API key and Client ID:

from codegyan import Codegyan

# Define your API credentials
api_key = "YOUR API KEY"
client_id = "YOUR CLIENT ID"

# Initialize the Codegyan client
client = Codegyan(api_key, client_id)

# Define the language and code to be compiled
lang = "python"
code = 'print("Hello, World!")'

# Use the Compiler API to compile the code
result = client.compilerApiClient.compile(lang, code)
print(result)

Replace YOUR_API_KEY and YOUR_CLIENT_ID with your actual API key and Client ID provided by Codegyan. Pass the code you want to compile to the compile function.

Tests

To run the unit tests, use the following command:

python -m unittest discover tests

Make sure to replace tests with the actual path to your test directory if it's different.

Contributing

Contributions are welcome! Please open an issue or submit a pull request on GitHub.

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

codegyan-1.0.0.tar.gz (8.0 kB view hashes)

Uploaded Source

Built Distribution

codegyan-1.0.0-py3-none-any.whl (8.4 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