A decorator to mark functions as vibe-coded in their docstrings
Project description
vibe-coded-decorator
A Python decorator that marks functions as "vibe-coded" by adding a notice to their docstrings. This notice will appear in automatic documentation tools like FastAPI's interactive docs.
Installation
pip install vibe-coded-decorator
Or install from source:
pip install .
Usage
Simply add the @vibe_coded decorator to any function:
from vibe_coded_decorator import vibe_coded
@vibe_coded
def my_function():
"""This is my function."""
return "Hello, world!"
The decorator will modify the function's docstring to include a notice at the beginning:
print(my_function.__doc__)
# Output: **THIS FUNCTION HAS BEEN VIBE CODED**
#
# This is my function.
With FastAPI
The decorator works seamlessly with FastAPI, and the notice will appear in the automatic API documentation:
from fastapi import FastAPI
from vibe_coded_decorator import vibe_coded
app = FastAPI()
@app.get("/hello")
@vibe_coded
def hello_world():
"""Returns a greeting message."""
return {"message": "Hello, world!"}
When you visit the FastAPI docs at /docs, you'll see "THIS FUNCTION HAS BEEN VIBE CODED" at the top of the function's description.
Functions Without Docstrings
The decorator also works with functions that don't have docstrings:
@vibe_coded
def no_docstring():
pass
print(no_docstring.__doc__)
# Output: **THIS FUNCTION HAS BEEN VIBE CODED**
Development
To install in development mode:
pip install -e .
License
MIT
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file vibe_coded_decorator-0.1.1.tar.gz.
File metadata
- Download URL: vibe_coded_decorator-0.1.1.tar.gz
- Upload date:
- Size: 3.9 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.12.10
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
3ec96e00d1db60710df5c42e88cb9cd5e3436304b468811034784084eec2bba8
|
|
| MD5 |
147bf72879936869a4dec30e9599c156
|
|
| BLAKE2b-256 |
0c8f6468449d616df10b41eb110239593756882cb0e92ef7468078c01ecb75e9
|
File details
Details for the file vibe_coded_decorator-0.1.1-py3-none-any.whl.
File metadata
- Download URL: vibe_coded_decorator-0.1.1-py3-none-any.whl
- Upload date:
- Size: 2.8 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.12.10
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
7c4bda9cd250c2365403b801ccd701e61ac89afd1886824f773d4a3929fc3f64
|
|
| MD5 |
0ce83a35c6aa3beb7db6eaed99436ec8
|
|
| BLAKE2b-256 |
026b0b203dd36829e498267b969514a8e17c3de4b084ec713dbc7c509ad61410
|