{"id":22092540,"url":"https://github.com/nicholassynovic/tool_neural-docstrings-generator","last_synced_at":"2026-05-01T01:32:17.146Z","repository":{"id":234560149,"uuid":"789142022","full_name":"NicholasSynovic/tool_neural-docstrings-generator","owner":"NicholasSynovic","description":"Code to write docstrings for functions and classes using LLMs","archived":false,"fork":false,"pushed_at":"2024-07-06T01:54:58.000Z","size":272,"stargazers_count":1,"open_issues_count":3,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-03-23T23:46:51.151Z","etag":null,"topics":["docstrings","llms","ollama","tool"],"latest_commit_sha":null,"homepage":"https://nicholassynovic.github.io/tool_neural-docstrings-generator/","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"agpl-3.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/NicholasSynovic.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2024-04-19T19:33:37.000Z","updated_at":"2024-04-21T04:26:36.000Z","dependencies_parsed_at":"2024-04-19T23:23:59.622Z","dependency_job_id":"6ac9c32f-6ad0-4372-9c14-a2b050b79ef1","html_url":"https://github.com/NicholasSynovic/tool_neural-docstrings-generator","commit_stats":null,"previous_names":["nicholassynovic/neural-docstrings","nicholassynovic/tool_neural-docstrings-generator"],"tags_count":0,"template":false,"template_full_name":"NicholasSynovic/template-repo","purl":"pkg:github/NicholasSynovic/tool_neural-docstrings-generator","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/NicholasSynovic%2Ftool_neural-docstrings-generator","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/NicholasSynovic%2Ftool_neural-docstrings-generator/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/NicholasSynovic%2Ftool_neural-docstrings-generator/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/NicholasSynovic%2Ftool_neural-docstrings-generator/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/NicholasSynovic","download_url":"https://codeload.github.com/NicholasSynovic/tool_neural-docstrings-generator/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/NicholasSynovic%2Ftool_neural-docstrings-generator/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":32482460,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-04-30T13:12:12.517Z","status":"ssl_error","status_checked_at":"2026-04-30T13:12:06.837Z","response_time":57,"last_error":"SSL_read: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["docstrings","llms","ollama","tool"],"created_at":"2024-12-01T03:09:47.315Z","updated_at":"2026-05-01T01:32:17.130Z","avatar_url":"https://github.com/NicholasSynovic.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Neural Docstring Generator (`ndg`)\n\n\u003e A small program to generate docstrings using Ollama-compatible LLMs\n\n## Table of Contents\n\n- [Neural Docstring Generator (`ndg`)](#neural-docstring-generator-ndg)\n  - [Table of Contents](#table-of-contents)\n  - [About](#about)\n  - [How to Install](#how-to-install)\n    - [Dependencies](#dependencies)\n    - [Installation Instructions](#installation-instructions)\n  - [How to Run](#how-to-run)\n  - [Default LLM](#default-llm)\n  - [Default System Prompt](#default-system-prompt)\n\n## About\n\nI don't like writing docstrings.\n\nLarge language models (LLMs) don't complain about writing docstrings.\n\nTherefore, if I can get LLMs to write docstrings for me, then I'll be happy and\nfree!\n\nThis tool (neural docstring generator, or `ndg`) is meant to provide a proof of\nconcept on how to:\n\n- Read in source code files\n- Extract functions and their supporting code from the source file\n- Inference with LLMs self-hosted via Ollama with LangChain\n\n## How to Install\n\n`ndg` was tested to work on x86-64 Linux computers running `Python3.10`.\n\nIt is assumed that you have a working `ollama` instance on your computer. To\nlearn more, see the\n[Ollama GitHub repository](https://github.com/ollama/ollama).\n\n### Dependencies\n\nThe following dependencies are required:\n\n- `python3.10`\n- `poetry`\n- `langchain`\n- `progress`\n- `click`\n- [`pyfs`](https://github.com/NicholasSynovic/python-fs-utils%22)\n\n### Installation Instructions\n\nTo install:\n\n1. `git clone` this repository\n1. `cd` into this repository\n1. Install dependencies with `pip install -r requirments \u0026\u0026 poetry install`\n1. Build and install the `ndg` tool with `make`\n\n## How to Run\n\n```shell\nUsage: ndg [OPTIONS]\n\nOptions:\n  -i, --input PATH   Source file to generate docstrings for  [required]\n  -m, --model TEXT   LLM used to generate docstrings. NOTE: Must be\n                     recognizable by Ollama\n  -s, --system TEXT  The system prompt to use\n  -o, --output PATH  File to output docstrings to  [required]\n  --help             Show this message and exit.\n```\n\nIf your `input` and `output` are equivalent, then a new file will be created in\nthe same directory as `input`, but with the `.ndg` file extension appended to\navoid overwriting content between the two files.\n\n## Default LLM\n\nBy default,\n[Ollama's default CodeGemma model (`codegemma`)](https://ollama.com/library/codegemma)\nis used for this tool.\n\n## Default System Prompt\n\nHere is the default system prompt.\n\n```text\nThis file contains code for counting lines of code of software projects.\nGenerate suitable docstring for these Python functions in Google's style.\nDo not explain the result.\nOnly return the docstring and function declaration.\nReturn as raw text.\n```\n\nThis can be adjusted with `ndg --system`\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnicholassynovic%2Ftool_neural-docstrings-generator","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fnicholassynovic%2Ftool_neural-docstrings-generator","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnicholassynovic%2Ftool_neural-docstrings-generator/lists"}