🎉 Welcome to ReadCraft - The README Generator 🎉
ReadCraft automates the process of creating professional README.md files based on your code using the Groq API. This tool is perfect for saving time and ensuring consistent, engaging documentation for your projects!
📑 Table of Contents
- Overview
- Features
- Installation
- Configuration
- Usage
- Example Output
- Contributing
- Troubleshooting
- License
🌟 Overview
ReadCraft takes in your code and generates a well-structured, user-friendly README file. It also allows you to track token usage, output results in JSON format, and process directories of files at once!
✨ Features
- 🗂 Multiple File Processing: Generate READMEs for individual files or entire directories.
- 🔑 Flexible Configuration: Set up your API key with
.envor pass it via command line. - 🌊 Real-Time Streaming: Stream output as it’s generated with the
--streamflag. - 📄 JSON Output: Save your README as a JSON file with the
--jsonoption.
📥 Installation
Prerequisites
- Python 3.7+ 🐍
- pip for package management
Installing via PyPI
Install ReadCraft directly from PyPI:
pip install readcraft
⚙ Configuration
ReadCraft retrieves configuration details from various sources:
-
Environment Variables: Create a
.envfile and add your API key:GROQ_API_KEY=YOUR_API_KEY
-
Command Line Flag: Use the
--api-keyflag to provide the API key when running the tool:readcraft file.py --api-key YOUR_API_KEY
-
TOML Config File: Store configuration in a TOML file named
.your-toolname-config.tomlin your home directory:api_key = "your_api_key_here" model = "your_model_here"
📈 Usage
After installing readcraft, follow these steps to generate a README.md for your files.
-
Locate the ReadCraft Installation:
- Run:
pip show readcraft
- Find the
Locationfield in the output, which points to where ReadCraft is installed.
- Run:
-
Add the File(s):
-
Place the file(s) you want to generate a README for into an accessible directory or just write:
cd ~ touch file_name.py nano file_name.py #In here you can copy the content of the file you want readme for and to save just press ctrl+O and exit by ctrl+X! readcraft file_name.py --output-dir ./outputdir --api-key Your-API-Key --json --stream
-
Alternatively, provide the full path to the file when running the command.
-
-
Run the Tool:
- Process a single file:
readcraft /path/to/your/file.py --output-dir ./output
- Process an entire directory:
readcraft /path/to/your/directory --output-dir ./output
- Process a single file:
-
Verify the Output:
- The generated
README.mdwill appear in the specified output directory.
- The generated
📝 Example Output
Sample README Output
When you run the script, ReadCraft generates a README.md file based on the contents of your code:
Example README.md:
# Sample Project 🚀
This project is designed to [describe key functionalities of the project here]. It’s structured to make your life easier!
## Features
- **Easy to Use**: Simple commands for quick results.
- **High Performance**: Optimized for performance with real-time streaming.
Sample JSON Output
If you use the --json flag, an output JSON file is also created:
{
"file": "path/to/your/file.py",
"readme_content": "# Sample Project...",
"status": "success"
}
🤝 Contributing
We welcome contributions! Follow these steps to set up your environment:
- Fork the repository and clone it.
- Install dependencies listed in
requirements.txt. - Run Pre-Commit Hooks: Set up pre-commit hooks to automatically format and lint your code:
chmod +x .git/hooks/pre-commit
For more details, see CONTRIBUTING.md.
🛠 Troubleshooting
Common Issues:
- No API Key Provided: Ensure your API key is set in a
.envfile (GROQ_API_KEY=your_api_key) or passed via--api-key. - Installation Errors: Use Python 3.7+ and ensure
pipis up to date. If issues persist, use a virtual environment. - Timeouts or Connection Errors: Check your internet connection or retry after a short delay.
- Missing Output: Verify the input file path and ensure the
--output-dirdirectory exists. - Configuration Conflicts: Command-line arguments override
.envand TOML settings. Use one method consistently. - Outdated Dependencies: Upgrade critical packages (e.g.,
requests) if you encounter compatibility issues with Python 3.12+.
📜 License
This project is licensed under the MIT License - see the LICENSE file for details.
Metadata
Release files for readcraft 0.1.6
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| readcraft-0.1.6.tar.gz | 10.8 kB | Without provenance | Details for readcraft-0.1.6.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| readcraft-0.1.6-py3-none-any.whl | Python 3 | none | any | Details for readcraft-0.1.6-py3-none-any.whl |
Total release size: 18.9 kB
Release files / readcraft-0.1.6.tar.gz
| Download URL | readcraft-0.1.6.tar.gz |
|---|---|
| Size | 10.8 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
9e60f3182fc226ead591997b1a0b0e4828ae8232cb72f74f15d9329a2ed3292f
|
|
BLAKE2b-256 checksum How to use checksums |
ac6b8ac7a088ac25498843d4c5a1dc6234f8667061eba5e1dc1052cdf72105bf
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/5.1.1 CPython/3.12.1
|
Release files / readcraft-0.1.6-py3-none-any.whl
| Download URL | readcraft-0.1.6-py3-none-any.whl |
|---|---|
| Size | 8.0 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
66dbcac6429c700ea4ddcd6289dc0064970f54915a14fde7ab4b54abd1496348
|
|
BLAKE2b-256 checksum How to use checksums |
4e4a3bf907ef8bff6b43fc99e23dbff1643cb772743df92a6c4c6087f6501eff
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/5.1.1 CPython/3.12.1
|
Security for readcraft 0.1.6
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.