Skip to main content

A tool to annotate code using the Mistral API

Project description

PyPI version License: MIT Downloads

Code Annotator

Code Annotator is a Python package designed to automatically add comments to source code using the Mistral AI API. It enables users to quickly obtain comprehensive, context-aware comments throughout their code, facilitating better understanding and readability.

Installation

To install Code Annotator, you can use pip:

pip install code_annotator

Usage

As a Command Line Tool

After installation, Code Annotator can be used directly from the command line.

Example:

code-annotator <api_token> <model_name> <file_path> [--temperature] [--top_p] [--max_tokens]
  • api_token: Your Mistral API token.
  • model_name: The name of the Mistral model to use.
  • file_path: The path to the source code file you want to annotate.
  • temperature (optional): The temperature parameter for the AI model.
  • top_p (optional): The top_p parameter for the AI model.
  • max_tokens (optional): The maximum number of tokens for the AI model to generate.

Customizing Your Annotations

You can customize the behavior of Code Annotator by adjusting the optional command-line parameters, such as the temperature, top_p, max_tokens, etc., to fit the specific needs of your code or to tweak the behavior of the Mistral model.

Output Example

When you run Code Annotator, it processes your source code file and adds insightful, context-aware comments to the code. Here is an example of the annotated code output:

# Example of annotated code
def example_function(param1, param2):
    # This function performs a calculation using param1 and param2
    result = param1 + param2
    return result

Contributing

Contributions, issues, and feature requests are welcome! Feel free to check issues page.

License

MIT

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

code_annotator-0.0.1.tar.gz (3.6 kB view details)

Uploaded Source

Built Distribution

code_annotator-0.0.1-py3-none-any.whl (4.7 kB view details)

Uploaded Python 3

File details

Details for the file code_annotator-0.0.1.tar.gz.

File metadata

  • Download URL: code_annotator-0.0.1.tar.gz
  • Upload date:
  • Size: 3.6 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.8.3

File hashes

Hashes for code_annotator-0.0.1.tar.gz
Algorithm Hash digest
SHA256 5ef180a80bc0900e61b65668b57f1ca4f578e050f87b2b7323da67b2c96eb65c
MD5 1cc183061253f96b9cd20b21c1ad01ca
BLAKE2b-256 559cee95d0c4706e47561ca7303231b8f9c3bab9b64354450e3d92882599355d

See more details on using hashes here.

File details

Details for the file code_annotator-0.0.1-py3-none-any.whl.

File metadata

File hashes

Hashes for code_annotator-0.0.1-py3-none-any.whl
Algorithm Hash digest
SHA256 c0cddfbad5a6214874897f3ccb6e59f8e7b4f06a19d3f37e0b36e01dd7a6a0a0
MD5 1cd14d902df1177501632bb2b4b944e1
BLAKE2b-256 9486c35611bc02a430136c5ca32273cc3f8020f6bdfc5d4963a08c24178359d1

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