CodeEvals
A Python package for code evaluation and analysis.
Installation
pip install codeevals
Usage
Python API
from typing import List
from codeevals.core import Evaluate
from codeevals.metrics.logic_relevancy import LogicRelevancy
from codeevals.inputs.llm_input import LLMInput
from codeevals.metrics.syntax_relevancy import SyntaxRelevancy
from codeevals.results.base_result import BaseResult
code_relevancy = LogicRelevancy()
syntax_relevancy = SyntaxRelevancy()
evals = Evaluate(metrics=[code_relevancy, syntax_relevancy], model="self-hosted/meta-llama/Meta-Llama-3.1-8B-Instruct",
base_url="https://9styblyjb29d54-8003.proxy.runpod.net/v1")
input_1 = LLMInput(ground_truth = "def sum(a,b):\n\treturn a+b",
actual_response = "def summation(number_1,number_2):\n\tif number_1 is not 0 and number_2 is not 0:\n\t\treturn number_1+number_2")
results: List[BaseResult] = evals.evaluate(llm_input=[input_1])
for result in results.results:
print(f"eval: {result.eval_name}, score: {result.score}, reason: {result.reason}")
Development
Setting up the development environment
# Clone the repository
git clone https://github.com/yourusername/codevals.git
cd codevals
# Create a virtual environment
python -m venv venv
source venv/bin/activate # On Windows: venv\Scripts\activate
# Install development dependencies
pip install -e ".[dev]"
License
This project is licensed under the terms of the Apache2.0 license.
Metadata
Release files for codeevals 0.0.2
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 | |
|---|---|---|---|---|
| codeevals-0.0.2.tar.gz | 11.6 kB | Without provenance | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| codeevals-0.0.2-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 32.4 kB
Release files / codeevals-0.0.2.tar.gz
| Download URL | codeevals-0.0.2.tar.gz |
|---|---|
| Size | 11.6 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
b8fb2ef60e2805b988c2a00d20785b43ced994a493089fe5aa218e5d139f9423
|
|
BLAKE2b-256 checksum How to use checksums |
dddf06ec7565585f32a60fb6d26b62fc1c5650687e64cb07dbfb0ba8cbc83c9d
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.1.0 CPython/3.12.9
|
Release files / codeevals-0.0.2-py3-none-any.whl
| Download URL | codeevals-0.0.2-py3-none-any.whl |
|---|---|
| Size | 20.8 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
d0ab693cd3d1045651901171a9c920bf647ae72fbe5496a54274fcb47b31e903
|
|
BLAKE2b-256 checksum How to use checksums |
b61f092a11870caab3a46768fbba3f893f7a9bcf055be6c1b70f4fc49b0bd921
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.1.0 CPython/3.12.9
|
Security for codeevals 0.0.2
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.