No project description provided
Project description
KLARAVDN
Klaravdn is a python library, named after Klara Dan Von Neumann, the famous revolutionary computer scientist/computer programmer. The library is a wrapper around ollama and aims to automate writing unit tests for your python code.
Installation
Use
Install it in your development enviroment using pip: pip install klaradvn, with uv using: uv add klaradvn or with poetry using: poetry add klaradvn.
Install it in uvx using: uvx install klaradvn
Development
To run to code under development. Clone the repository to your local computer, navigate to the top level folder of the repo and install with poetry.
poetry install
Usage
Install OLLAMA
The klaravdn package depends on ollama. To install OLLAMA, follow this guide: https://markaicode.com/ollama-setup-guide-run-llms-locally/
CLI
Simply run klara <command>. For more information on all commands, run klara --help.
Please make sure you first create the model with the command: klara create-model
Python
from klaradvn.generate import create_model, generate_tests
from klaradvn.extract import extract_function_code
# Create custom ollama model
create_model()
# Extract python function
function = "another_function"
code, path = extract_function_code(Path(__file__).parent / 'test-package', function)
# Create and run tests
success, test_path = generate_tests(path, code, function)
if success:
pytest.main(["-x", test_path])
Development roadmap
Steps:
- Get it working with generic tests on function
- Get it working with generic tests on classes
- Extend functionality to make personalized tests
- Add feedback of SLM to test_xxx.py
- Improve SLM accuracy and performance
Contributing
Pull requests are welcome. For major changes, please open an issue first to discuss what you would like to change.
Please make sure to update tests as appropriate.
License
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 klaradvn-0.1.0.tar.gz.
File metadata
- Download URL: klaradvn-0.1.0.tar.gz
- Upload date:
- Size: 8.7 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: poetry/1.8.3 CPython/3.11.8 Linux/6.14.3-arch1-1
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
611e9a12df9606e0ab80a956816822155885912f7b3a33dd6f6b7068eac3ea03
|
|
| MD5 |
d42fb87d8a09f344af8279af08b921b4
|
|
| BLAKE2b-256 |
a7d68c37cdd431a6d66b5e8c6897188ee806729c2abbb3318e0daad5b047b49f
|
File details
Details for the file klaradvn-0.1.0-py3-none-any.whl.
File metadata
- Download URL: klaradvn-0.1.0-py3-none-any.whl
- Upload date:
- Size: 9.8 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: poetry/1.8.3 CPython/3.11.8 Linux/6.14.3-arch1-1
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
d9595637ca349efb35a4281ddeeaaf7dd1b1f4bda842e590295534aac4ea312c
|
|
| MD5 |
5cb2040324f31706a82ed115e45d7567
|
|
| BLAKE2b-256 |
79df6fa58369864db9f412bf76a9c2ab8d470c05b14728f0d10bf40334bfabc6
|