Skip to main content

DocMint: A professional tool for generating comprehensive README and documentation files effortlessly.

Project description

DocMint CLI: Your Professional README Generator ✨

Hey there! 👋 DocMint CLI is your go-to command-line tool for generating professional README files without breaking a sweat. Whether you're on Windows, macOS, or Linux, this tool has got you covered. It dives deep into your project, figures out what it's all about, and whips up a comprehensive README.md file that'll make your project shine. ✨

Table of Contents

Features ✨

  • Automated README Generation: Say goodbye to README-writing headaches! DocMint CLI analyzes your project files and generates a detailed README in minutes. 🚀
  • Project Type Detection: It's like magic! DocMint automatically detects your project type (Python, JavaScript, Java, you name it!). 🧙‍♀️
  • Customizable: Need a README with a specific focus? Use custom prompts and project types to tailor the output. 🎨
  • Configuration: Tweak the tool to fit your needs. Configure the backend URL, excluded directories, and more. ⚙️
  • Cross-Platform: Works seamlessly on Windows, macOS, and Linux. No compatibility nightmares! 💻
  • Contributing Guidelines: Easily include or exclude a contributing section to encourage community involvement. 🤝
  • Network Check: Always know if you're connected to the DocMint backend. 🌐
  • File Analysis: Scans and processes project files, providing a summary of analyzed files. 🔍
  • Colorized Output: Enjoy informative and visually appealing terminal output. Makes everything easier on the eyes! 🌈

Technologies Used 🛠️

  • Python: The heart and soul of DocMint CLI. 🐍
  • requests: Making HTTP requests to the DocMint backend like a pro. 🌐
  • argparse: Parsing command-line arguments so you can customize your experience. ⚙️
  • pathlib: Handling file paths with grace and ease. 🗂️
  • mimetypes: Determining file types to better understand your project. 📄
  • colorama: Adding color support in Windows terminals. 🎨

Python requests argparse

Installation ⬇️

  1. Prerequisites:

    • Python 3.6 or higher (because who doesn't love the latest features?).
    • pip package installer (your best friend for Python packages).
  2. Install DocMint CLI: First, make sure you have requests installed:

    pip install requests
    
  3. Clone the Repository: Grab the DocMint CLI repository from GitHub:

    git clone <repository_url>
    cd docmint_cli
    
  4. Install Dependencies: (Optional, but highly recommended) Set up a virtual environment to keep your project dependencies tidy:

    python3 -m venv venv
    source venv/bin/activate  # On Windows, use `venv\\Scripts\\activate`
    pip install -r requirements.txt  # If you have a requirements.txt
    

Usage 💻

Basic Usage

To generate a README for your project in the current directory, just run:

python cli.py

Specifying a Directory

Want to analyze a specific directory? Use the -d or --directory option:

python cli.py -d /path/to/your/project

Using a Text Prompt

Generate a README from a text prompt with the -p or --prompt option:

python cli.py -p "My awesome project is a web application built with Flask and React."

Specifying Project Type and Output File

Specify the project type and output file name using the -t or --type and -o or --output options:

python cli.py -t Python -o MyREADME.md

Excluding Contributing Section

Skip the contributing section with the --no-contributing option:

python cli.py --no-contributing

Using a Custom Backend URL

For those who like to tinker, use a custom backend URL with the --url option:

python cli.py --url http://localhost:8000

Skipping the Banner

Skip the fancy banner display with the --no-banner option:

python cli.py --no-banner

Configuration ⚙️

DocMint CLI uses a configuration file to store settings like the backend URL and excluded directories.

Configuration File

The configuration file is located at ~/.docmint/config.json.

Default Configuration

Here’s what the default configuration looks like:

{
    "backend_url": "https://docmint.onrender.com",
    "default_project_type": "auto",
    "include_contributing": true,
    "max_file_size": 104857600,
    "max_files": 150,
    "excluded_dirs": [
        "node_modules",
        ".git",
        "__pycache__",
        ".pytest_cache",
        "venv",
        "env",
        ".env",
        "dist",
        "build",
        ".next",
        "target",
        "bin",
        "obj",
        ".gradle",
        "vendor"
    ],
    "supported_extensions": [
        ".py",
        ".js",
        ".ts",
        ".jsx",
        ".tsx",
        ".java",
        ".cpp",
        ".c",
        ".cs",
        ".php",
        ".rb",
        ".go",
        ".rs",
        ".swift",
        ".kt",
        ".scala",
        ".html",
        ".css",
        ".scss",
        ".sass",
        ".less",
        ".vue",
        ".svelte",
        ".md",
        ".txt",
        ".json",
        ".xml",
        ".yaml",
        ".yml",
        ".toml",
        ".ini",
        ".cfg",
        ".conf",
        ".sh",
        ".bash",
        ".zsh",
        ".ps1",
        ".psm1",
        ".sql",
        ".pl",
        ".pyx",
        ".r",
        ".dart",
        ".lua",
        ".groovy",
        ".kotlin",
        ".h",
        ".hpp",
        ".cxx",
        ".m",
        ".t",
        ".swift",
        ".pl",
        ".pm"
    ]
}

Modifying Configuration

Feel free to tweak the configuration file to your liking. For instance, to change the backend URL, just edit the backend_url field in the config.json file.

API Documentation 📒

DocMint CLI interacts with a backend server to generate those awesome README files. Here’s a peek at the API endpoints it uses:

Health Check

  • Endpoint: /api/health/
  • Method: GET
  • Description: Checks if the backend server is reachable.
  • Response:
    • Status Code: 200 OK if the backend is healthy.

Generate README from Prompt

  • Endpoint: /api/generate/
  • Method: POST
  • Description: Generates a README file based on a text prompt.
  • Request Body:
{
  "message": "Your project description here"
}
  • Response:
{
  "answer": "# Your Generated README Content Here"
}

Generate README from Files

  • Endpoint: /api/generate-from-files/

  • Method: POST

  • Description: Generates a README file based on the project files.

  • Request Body:

    • files: List of project files.
    • projectType: Type of the project (e.g., "Python", "JavaScript").
    • contribution: Boolean indicating whether to include a contributing section.
  • Example Request (using requests library):

import requests

url = "https://docmint.onrender.com/api/generate-from-files/"
files = [
    ('files', ('file1.py', open('file1.py', 'rb'), 'text/plain')),
    ('files', ('file2.js', open('file2.js', 'rb'), 'text/javascript'))
]
data = {
    'projectType': 'Python',
    'contribution': 'true'
}

response = requests.post(url, files=files, data=data)
print(response.json())
  • Response:
{
  "result": {
    "answer": "# Your Generated README Content Here"
  }
}

Deployment 🚀

Deployment instructions can vary based on your project's specifics. Here are some general tips:

  • Web Applications: Deploy to platforms like Netlify, Vercel, or AWS.
  • Python Packages: Package your code and upload to PyPI.
  • Docker Containers: Containerize your application using Docker and deploy to container orchestration platforms like Kubernetes.

Contributing 🤝

We'd love for you to contribute to DocMint CLI! Here's how:

  1. Fork the repository.
  2. Create a new branch for your feature or bug fix.
  3. Write tests for your changes.
  4. Submit a pull request.

License 📄

This project is licensed under the MIT License.

Acknowledgments 🙏

  • Thanks to all the contributors who've helped make DocMint CLI better.
  • Special thanks to the open-source community for the awesome tools and libraries.

Troubleshooting 💡

Connection Issues

If you're having trouble connecting to the DocMint backend, check these:

  • Verify your internet connection.
  • Make sure the backend URL is correct.
  • Confirm that the DocMint backend is up and running.

File Encoding Errors

If you run into file encoding errors, try these:

  • Ensure your files are encoded in UTF-8.
  • Use the --encoding option to specify the file encoding.

Large Project Issues

For performance issues with large projects:

  • Exclude unnecessary directories and files from analysis.
  • Increase the timeout value for API requests.

Built with DocMint

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

docmint-0.1.3.tar.gz (16.2 kB view details)

Uploaded Source

Built Distribution

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

docmint-0.1.3-py3-none-any.whl (12.8 kB view details)

Uploaded Python 3

File details

Details for the file docmint-0.1.3.tar.gz.

File metadata

  • Download URL: docmint-0.1.3.tar.gz
  • Upload date:
  • Size: 16.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.13.2

File hashes

Hashes for docmint-0.1.3.tar.gz
Algorithm Hash digest
SHA256 9e668686b7475e2b106da6c62f0d5cacb564686362fc8a04a13b9ad4426fa600
MD5 e8eff9bcfff14ff7c898307268ad0074
BLAKE2b-256 210d25b8df70490ddc59594c8eb958bffc0f8e61cac0d58c4eac67b164094c3b

See more details on using hashes here.

File details

Details for the file docmint-0.1.3-py3-none-any.whl.

File metadata

  • Download URL: docmint-0.1.3-py3-none-any.whl
  • Upload date:
  • Size: 12.8 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.13.2

File hashes

Hashes for docmint-0.1.3-py3-none-any.whl
Algorithm Hash digest
SHA256 16ab3169b07d505715707a134e15ff5ee8d685e4dc777d00655f3d125f903df3
MD5 531fa2cf45fafa16272f689919991dde
BLAKE2b-256 7876595526c6214197b711bb2ddc0243568eadc4c8057f2c295fa796a1d71691

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