Skip to main content

This package contains implementation of a code translator with Gemini Pro integrated into it.

Project description

gemini-pro-code-translator

Ever wondered about translating code from one programming language to another quickly? Gemini Pro Code Translator is the tool to do so.

Source Code

The source code of the application Gemini Pro Code Translator is available in Source Code.

Installation

pip install gemini-pro-code-translator

How to Use the Application?

Pre-requisites:

  1. Python installed in your device.
  2. .env file in the same directory as <GEMINI_PRO_CODE_TRANSLATOR_DIRECTORY> and has the value of GEMINI_API_KEY.

First, open a Terminal or Command Prompt window and run the following command.

cd <GEMINI_PRO_CODE_TRANSLATOR_DIRECTORY>
python3 main.py

Note: Replace <GEMINI_PRO_CODE_TRANSLATOR_DIRECTORY> with the path to the directory of the application Gemini Pro Code Translator.

Then, the application will start with something looking like in the screenshot below.

Application

You will then be asked to input the following values.

  1. Temperature - between 0 and 1 inclusive
  2. Top P - between 0 and 1 inclusive
  3. Top K - at least 1
  4. Max output tokens - at least 1

The following screenshot shows what is displayed after inputting the mentioned values.

Code Translator

You will be required to input the following pieces of information.

  1. The name of the programming language you want to translate code from.
  2. The path of the file containing the code to be translated.
  3. The name of the programming language you want to translate code to (must be different from the one in step 1).
  4. The name of the file you want the translated code to be placed in (without the extension).

Once you enter the values mentioned above, the file containing the code will be created inside "codes" directory. Then, you will be asked whether you still want to continue unit testing or not. If you enter 'Y', you will be redirected to an application window like in screenshot above. Else, you will exit the application.

Code Translator End

Below demonstrates how the file containing the translated code looks like.

Translated Code

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

gemini-pro-code-translator-1.1.tar.gz (3.0 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

gemini_pro_code_translator-1.1-py3-none-any.whl (3.4 kB view details)

Uploaded Python 3

File details

Details for the file gemini-pro-code-translator-1.1.tar.gz.

File metadata

  • Download URL: gemini-pro-code-translator-1.1.tar.gz
  • Upload date:
  • Size: 3.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.7.1 importlib_metadata/4.10.0 pkginfo/1.8.2 requests/2.31.0 requests-toolbelt/0.9.1 tqdm/4.62.3 CPython/3.9.4

File hashes

Hashes for gemini-pro-code-translator-1.1.tar.gz
Algorithm Hash digest
SHA256 a7b0a67cf831fc5347e05a3314d3c5d97630a8f31d216f9d1aff6795f1574254
MD5 13dc512437cebc0e0e9eb04c9296da14
BLAKE2b-256 d6345f8784661c35dd5d43228462a017b73da6d205945c3681ab9ae8eaf2c11e

See more details on using hashes here.

File details

Details for the file gemini_pro_code_translator-1.1-py3-none-any.whl.

File metadata

  • Download URL: gemini_pro_code_translator-1.1-py3-none-any.whl
  • Upload date:
  • Size: 3.4 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.7.1 importlib_metadata/4.10.0 pkginfo/1.8.2 requests/2.31.0 requests-toolbelt/0.9.1 tqdm/4.62.3 CPython/3.9.4

File hashes

Hashes for gemini_pro_code_translator-1.1-py3-none-any.whl
Algorithm Hash digest
SHA256 c38c4caf2b359cea1ba159c16d9f9d4c12ba14f81a76d1ec2cebe9b00613e46d
MD5 8cc26582e18311b248577d2e9b5731fa
BLAKE2b-256 8cb1f2c6124e7dc276c95928821a90f17faa88618d8f2b9fe140837df4d86e43

See more details on using hashes here.

Supported by

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