Skip to main content

A package to generate Python code from given topics and description

Project description


PyCoder is a tool to generate python code out of a few given topics and a description. It uses GPT-2 language model as its engine. Pycoder poses writing Python code as a conditional-Causal Language Modelling(c-CLM). It has been trained on millions of lines of Python code written by all of us. At the current stage and state of training, it produces sensible code with few lines of description, but the scope of improvement for the model is limitless.

Pycoder has been developed as a Command-Line tool (CLI), an API endpoint, as well as a python package (yet to be deployed to PyPI). This repository acts as a framework for anyone who either wants to try to build Pycoder from scratch or turn Pycoder into maybe a CPPCoder or JSCoder 😃. A blog post about the development of the project will be released soon.

To use Pycoder as a CLI utility, clone the repository as normal, and install the package with:

foo@bar:❯ pip install pycoder

After this the package could be verified and accessed as either a native CLI tool or a python package with:

foo@bar:❯ python -m pycoder --version

Or directly as:

foo@bar:❯ pycoder --version

On installation the CLI can be used directly, such as:

foo@bar:❯ pycoder -t pytorch -t torch -d "a trainer class to train vision model" -ml 120

The API endpoint is deployed using FastAPI. Once all the requirements have been installed for the project, the API can be accessed with:

foo@bar:❯ pycoder --endpoint PORT_NUMBER

Or

foo@bar:❯ pycoder -e PORT_NUMBER

Tech Stack

Python PyTorch Transformers Docker FastAPI

Tested Platforms

Linux Windows 10

BibTeX

If you want to cite the framework feel free to use this:

@article{dutta2021pycoder,
  title={Pycoder},
  author={Dutta, H},
  journal={GitHub. Note: https://github.com/himanshu-dutta/pycoder},
  year={2021}
}

MIT License

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

pycoder-1.2.4.tar.gz (17.0 kB view details)

Uploaded Source

Built Distribution

pycoder-1.2.4-py3-none-any.whl (21.5 kB view details)

Uploaded Python 3

File details

Details for the file pycoder-1.2.4.tar.gz.

File metadata

  • Download URL: pycoder-1.2.4.tar.gz
  • Upload date:
  • Size: 17.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.4.1 importlib_metadata/4.6.1 pkginfo/1.7.0 requests/2.25.1 requests-toolbelt/0.9.1 tqdm/4.61.2 CPython/3.8.10

File hashes

Hashes for pycoder-1.2.4.tar.gz
Algorithm Hash digest
SHA256 0a2bd1bfcc7c7f5044353bf8d3689d6ccc7f43f9953c71563ca3cabb25983666
MD5 17654fff1de9f0e47e260b4c8c2f9c80
BLAKE2b-256 eaa599cb6ec9c3ec1f02af8812cf0d813abb211610e74078e7478555427dbba1

See more details on using hashes here.

File details

Details for the file pycoder-1.2.4-py3-none-any.whl.

File metadata

  • Download URL: pycoder-1.2.4-py3-none-any.whl
  • Upload date:
  • Size: 21.5 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.4.1 importlib_metadata/4.6.1 pkginfo/1.7.0 requests/2.25.1 requests-toolbelt/0.9.1 tqdm/4.61.2 CPython/3.8.10

File hashes

Hashes for pycoder-1.2.4-py3-none-any.whl
Algorithm Hash digest
SHA256 10575d63e51475b3a90109a4f27805d7c16e24a26d6b037d8aa982dd62ece1b8
MD5 aaae69d76e76ff47ac745b16fad6e0c4
BLAKE2b-256 bc8ba6fb7d03785541a462ac6c039113c054416b1dbede62dd029672a4721934

See more details on using hashes here.

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