Skip to main content

A CLI tool to auto-generate professional README.md files using Google Gemini API.

Project description

My Project

Folder Structure

.
├── main.py
├── secret
└── setup.py

Description

No description provided.

How to Use

No usage instructions provided. Refer to main.py and setup.py for potential execution details.

Technologies Used

  • Python

Architecture or Code Overview

No architecture or code overview provided. Requires inspection of source files main.py, secret, and setup.py.

Known Issues / Improvements

  • No issues or improvements are provided.

Additional Notes or References

  • Authors: Anonymous
  • Keywords: # README

cli.py

Folder Structure

.
├── cli.py
└── docs

Description

This Python script automatically generates README.md documentation for a project by parsing the source code and folder structure. It utilizes the Google Gemini API to generate the documentation content and organizes the output within a specified directory.

How to Use

  1. Install Dependencies:

    • Ensure you have Python and pip installed.
    • Install the required packages: pip install google-genai
  2. Get a Google Gemini API Key:

    • Obtain an API key from Google AI Studio.
  3. Run the Script:

    • Navigate to the project directory in your terminal.
    • Execute the script using: python cli.py [OPTIONS]
    • When prompted, paste your Google Gemini API Key.

    CLI Options:

    • -p or --path: Root path to scan (default: ., current directory)
    • --name: Project name to include in README (default: My Project)
    • --description: Short description of the project (default: No description provided.)
    • --authors: Comma-separated list of author names (default: Anonymous)
    • --keywords: Comma-separated keywords (e.g., cli, docs, auto) (default: None)
    • --overwrite: Overwrite existing README files (default: False)
    • --output: Output directory where docs will be stored (default: docs)
    • --exclude: Folders, files, extensions to exclude (e.g., docs, ext, setting, config)
    • --include: Folders, files, extensions to include (e.g., docs, ext, setting, config)

    Example:

    python cli.py --path . --name "My Awesome Project" --description "A brief description of the project" --authors "Gantavya Bansal" --keywords "cli, documentation" --overwrite --output docs
    

Technologies Used

  • Python: Programming language.
  • google-genai: Google Generative AI library.
  • argparse: Parsing command-line arguments.
  • os: File system operations.
  • logging: Logging errors and information.

Architecture or Code Overview

The script operates as follows:

  1. Initialization: Sets up logging and imports necessary modules.
  2. Argument Parsing: Uses argparse to handle command-line arguments.
  3. File System Traversal:
    • d(): Recursively traverses the directory structure, excluding and including files based on user-defined filters.
    • b(): Generates a tree view of the project's folder structure.
  4. File Reading:
    • u(): Reads the content of a code file.
    • K(): Reads an existing README file.
  5. Documentation Generation:
    • s(): Interacts with the Google Gemini API, passing the filename, code, and existing README to generate the Markdown documentation.
  6. README Writing:
    • c(): Writes the generated documentation to a README.md file.
  7. Main Execution: The x() function handles the main workflow: parses arguments, sets up the Gemini API client, traverses the file structure, and generates the documentation.

Known Issues / Improvements

  • Error handling for API failures is basic. Implement more robust retry mechanisms.
  • Improve the exclusion and inclusion logic to support more complex patterns.
  • Enhance the prompt sent to the Gemini API for more accurate and detailed documentation.
  • Add support for different output formats (e.g., other than Markdown).

Additional Notes or References

  • This script utilizes the Google Gemini API. Ensure you have a valid API key.
  • The generated documentation is based on the provided context and the Gemini API's output.
  • Consider licensing your project with a license file.

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

devdocs-0.1.0.tar.gz (6.6 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

devdocs-0.1.0-py3-none-any.whl (6.7 kB view details)

Uploaded Python 3

File details

Details for the file devdocs-0.1.0.tar.gz.

File metadata

  • Download URL: devdocs-0.1.0.tar.gz
  • Upload date:
  • Size: 6.6 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.12.4

File hashes

Hashes for devdocs-0.1.0.tar.gz
Algorithm Hash digest
SHA256 7f37f39f00d7658f9f72514cd3dbe493cb92013d053be922d5df96de97bcec1b
MD5 c3f5c6353afe93e38975a6022946e031
BLAKE2b-256 48a3c386e6bfbbb21c120689c1084b509b0f986e3097d12963b34ba348ec3010

See more details on using hashes here.

File details

Details for the file devdocs-0.1.0-py3-none-any.whl.

File metadata

  • Download URL: devdocs-0.1.0-py3-none-any.whl
  • Upload date:
  • Size: 6.7 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.12.4

File hashes

Hashes for devdocs-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 937bc851651a6db345e4c087772e821f503d34f14a8e45eb0fa8640a30a3be11
MD5 73d0f661381f00134adde77825937e53
BLAKE2b-256 9b905661cb3a3d5b47fbff22ede4f13e1d0dcf0eeb66848879e24e953a11bed5

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page