code-annotator


Namecode-annotator JSON
Version 0.0.1 PyPI version JSON
download
home_pagehttps://github.com/chigwell/code_annotator
SummaryA tool to annotate code using the Mistral API
upload_time2024-01-25 21:21:45
maintainer
docs_urlNone
authorEugene Evstafev
requires_python>=3.6
license
keywords
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage No coveralls.
            [![PyPI version](https://badge.fury.io/py/code_annotator.svg)](https://badge.fury.io/py/code_annotator)
[![License: MIT](https://img.shields.io/badge/License-MIT-green.svg)](https://opensource.org/licenses/MIT)
[![Downloads](https://static.pepy.tech/badge/code_annotator)](https://pepy.tech/project/code_annotator)

# 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:

```bash
pip install code_annotator
```

## Usage

### As a Command Line Tool

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

Example:

```bash
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:

```python
# 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](https://github.com/chigwell/code_annotator/issues).

## License

[MIT](https://choosealicense.com/licenses/mit/)



            

Raw data

            {
    "_id": null,
    "home_page": "https://github.com/chigwell/code_annotator",
    "name": "code-annotator",
    "maintainer": "",
    "docs_url": null,
    "requires_python": ">=3.6",
    "maintainer_email": "",
    "keywords": "",
    "author": "Eugene Evstafev",
    "author_email": "chigwel@gmail.com",
    "download_url": "https://files.pythonhosted.org/packages/55/9c/ee95d0c4706e47561ca7303231b8f9c3bab9b64354450e3d92882599355d/code_annotator-0.0.1.tar.gz",
    "platform": null,
    "description": "[![PyPI version](https://badge.fury.io/py/code_annotator.svg)](https://badge.fury.io/py/code_annotator)\n[![License: MIT](https://img.shields.io/badge/License-MIT-green.svg)](https://opensource.org/licenses/MIT)\n[![Downloads](https://static.pepy.tech/badge/code_annotator)](https://pepy.tech/project/code_annotator)\n\n# Code Annotator\n\n`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.\n\n## Installation\n\nTo install `Code Annotator`, you can use pip:\n\n```bash\npip install code_annotator\n```\n\n## Usage\n\n### As a Command Line Tool\n\nAfter installation, `Code Annotator` can be used directly from the command line.\n\nExample:\n\n```bash\ncode-annotator <api_token> <model_name> <file_path> [--temperature] [--top_p] [--max_tokens]\n```\n\n- `api_token`: Your Mistral API token.\n- `model_name`: The name of the Mistral model to use.\n- `file_path`: The path to the source code file you want to annotate.\n- `temperature` (optional): The temperature parameter for the AI model.\n- `top_p` (optional): The top_p parameter for the AI model.\n- `max_tokens` (optional): The maximum number of tokens for the AI model to generate.\n\n### Customizing Your Annotations\n\nYou 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.\n\n## Output Example\n\nWhen 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:\n\n```python\n# Example of annotated code\ndef example_function(param1, param2):\n    # This function performs a calculation using param1 and param2\n    result = param1 + param2\n    return result\n```\n\n## Contributing\n\nContributions, issues, and feature requests are welcome! Feel free to check [issues page](https://github.com/chigwell/code_annotator/issues).\n\n## License\n\n[MIT](https://choosealicense.com/licenses/mit/)\n\n\n",
    "bugtrack_url": null,
    "license": "",
    "summary": "A tool to annotate code using the Mistral API",
    "version": "0.0.1",
    "project_urls": {
        "Homepage": "https://github.com/chigwell/code_annotator"
    },
    "split_keywords": [],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "9486c35611bc02a430136c5ca32273cc3f8020f6bdfc5d4963a08c24178359d1",
                "md5": "1cd14d902df1177501632bb2b4b944e1",
                "sha256": "c0cddfbad5a6214874897f3ccb6e59f8e7b4f06a19d3f37e0b36e01dd7a6a0a0"
            },
            "downloads": -1,
            "filename": "code_annotator-0.0.1-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "1cd14d902df1177501632bb2b4b944e1",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": ">=3.6",
            "size": 4725,
            "upload_time": "2024-01-25T21:21:43",
            "upload_time_iso_8601": "2024-01-25T21:21:43.805995Z",
            "url": "https://files.pythonhosted.org/packages/94/86/c35611bc02a430136c5ca32273cc3f8020f6bdfc5d4963a08c24178359d1/code_annotator-0.0.1-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "559cee95d0c4706e47561ca7303231b8f9c3bab9b64354450e3d92882599355d",
                "md5": "1cc183061253f96b9cd20b21c1ad01ca",
                "sha256": "5ef180a80bc0900e61b65668b57f1ca4f578e050f87b2b7323da67b2c96eb65c"
            },
            "downloads": -1,
            "filename": "code_annotator-0.0.1.tar.gz",
            "has_sig": false,
            "md5_digest": "1cc183061253f96b9cd20b21c1ad01ca",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": ">=3.6",
            "size": 3587,
            "upload_time": "2024-01-25T21:21:45",
            "upload_time_iso_8601": "2024-01-25T21:21:45.739463Z",
            "url": "https://files.pythonhosted.org/packages/55/9c/ee95d0c4706e47561ca7303231b8f9c3bab9b64354450e3d92882599355d/code_annotator-0.0.1.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2024-01-25 21:21:45",
    "github": true,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "github_user": "chigwell",
    "github_project": "code_annotator",
    "travis_ci": false,
    "coveralls": false,
    "github_actions": false,
    "lcname": "code-annotator"
}
        
Elapsed time: 1.03437s