Skip to main content

The sweet way to catch outdated docstrings

Project description

Dolce

Because broken docs leave a bitter taste.

Dolce is a tool designed to help you maintain high-quality docstrings in your Python code. It leverages Large Language Models (LLMs) to ensure that your docstrings are consistent with your code.

Installation

pip install pydolce

Usage

dolce check # Check docstrings in all python files in the current directory and subdirectories
dolce check src # Check in specific directory
dolce check src/myproject/main.py # Check in specific file

Configure

By default dolce will try to run locally codestral model via ollama provider. If you want to use a different LLM or provider you can configure the default options in the pyproject.toml:

[tool.dolce]
url = "http://localhost:11434"
model = "codestral"
provider = "ollama"
api_key = "YOUR_API_KEY_ENVIROMENT_VAR"

To be implemented

  • Add cache system to avoid re-checking unchanged code
  • Integrate third-party tools to check docstrings style, parameters, etc.
  • Support for ignoring specific code segments, files, directories, etc
  • Support parallel requests ... much more!

📦 For Developers

Make sure you have the following tools installed before working with the project:

  • uv → Python project and environment management
  • make → run common project tasks via the Makefile

Getting Started

Install dependencies into a local virtual environment:

uv sync --all-groups

This will create a .venv folder and install everything declared in pyproject.toml.

Then, you can activate the environment manually depending on your shell/OS:

  • Linux / macOS (bash/zsh):

    source .venv/bin/activate
    
  • Windows (PowerShell):

    .venv\Scripts\Activate.ps1
    
  • Windows (cmd.exe):

    .venv\Scripts\activate.bat
    

Running

uv run dolce check path/to/your/code

Linting, Formatting, and Type Checking

make qa

Runs Ruff for linting and formatting, and Mypy for type checking.

Running Unit Tests

Before running tests, override any required environment variables in the .env.test file.

make test

Executes the test suite using Pytest.

Building the Project

make build

Generates a distribution package inside the dist/ directory.

Cleaning Up

make clean

Removes build artifacts, caches, and temporary files to keep your project directory clean.

Building docs

make docs

Generates the project documentation inside the dist/docs folder.

When building the project (make build) the docs will also be generated automatically and included in the distribution package.

🤝 Contributing

Contributions are welcome! Please ensure all QA checks and tests pass before opening a pull request.


🚀 Project starter provided by Cookie Pyrate

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

pydolce-0.1.1.tar.gz (11.7 kB view details)

Uploaded Source

Built Distribution

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

pydolce-0.1.1-py3-none-any.whl (10.6 kB view details)

Uploaded Python 3

File details

Details for the file pydolce-0.1.1.tar.gz.

File metadata

  • Download URL: pydolce-0.1.1.tar.gz
  • Upload date:
  • Size: 11.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.8.17

File hashes

Hashes for pydolce-0.1.1.tar.gz
Algorithm Hash digest
SHA256 84252534329595b9aaf8bb976938342b1ecaa071f597a8d600254277fa6fa210
MD5 5458c6534e654b82bf56ba0b0520b7da
BLAKE2b-256 a3a6dadf471191c4630558805d33ef075f11dac4b1dc1da8670f83d7d6b11353

See more details on using hashes here.

File details

Details for the file pydolce-0.1.1-py3-none-any.whl.

File metadata

  • Download URL: pydolce-0.1.1-py3-none-any.whl
  • Upload date:
  • Size: 10.6 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.8.17

File hashes

Hashes for pydolce-0.1.1-py3-none-any.whl
Algorithm Hash digest
SHA256 5e67b3dfc63206a38eeacfa0a2c1d88ea36b376f348b67ffd1497631eb78cc50
MD5 04d15aebc8f4fac234f7f1e9e6984702
BLAKE2b-256 4c4414b6e4d75faa7d7035350e1eec48b122cdef4691c1fa0f3400c3fc1fa119

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