GithubHelp home page GithubHelp logo

tilltmk / automatic-documentation Goto Github PK

View Code? Open in Web Editor NEW
1.0 1.0 0.0 8 KB

๐Ÿ–Š๏ธ Automatically create documentations from files of a specific folder

License: MIT License

Python 100.00%

automatic-documentation's Introduction

Project Documentation Generator ๐Ÿ“„

This Python script automates the analysis and summarization of all files within a specified directory, leveraging the Ollama machine learning model to understand and process content efficiently. The output includes two types of documentation files:

  1. README.md - A user-friendly document enhanced with emojis to highlight key points.
  2. DOKU.md - A detailed, technical document for in-depth understanding.

Features ๐ŸŒŸ

  • Automated File Processing: Iterates through all files in a directory, extracting text for analysis.
  • Integration with Ollama: Uses advanced machine learning models to generate concise summaries.
  • Dual Documentation: Generates both a simple README and a comprehensive technical document.

Prerequisites ๐Ÿ“‹

  • Python 3.8 or higher
  • Access to the Ollama API
  • Required Python packages: json, os, sys, traceback, dotenv

Installation ๐Ÿ”ง

  1. Clone the repository or download the files into your working directory.
  2. Install the required Python packages:
    pip install ollama dotenv
  3. Set your Ollama API credentials in a .env file in the same directory as the script:
    PROJECT_PLANNER_MODEL=dolphin-mistral:latest
    CODER_MODEL=codellama:7b
    MARKDOWN_MAKER=vicuna:13b-16k
    TASKNAMER=stablelm2:1.6b-zephyr-fp16
    

Usage ๐Ÿš€

Run the script via the command line with the directory path as an argument:

python path_to_script.py path_to_directory

Example ๐Ÿ“–

python summarize_directory.py ./example_directory

This will process files in ./example_directory and generate README.md and DOKU.md in your working directory.

Error Handling ๐Ÿšจ

The script includes basic error handling to diagnose and report issues during execution. Check the console outputs and tracebacks to identify the causes of failures.

Security Notice ๐Ÿ”’

Ensure that you process trusted data, as the script does not perform comprehensive security checks on the content of the files.

automatic-documentation's People

Contributors

tilltmk avatar

Stargazers

 avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.