Metadata-Version: 2.4
Name: uscg-leetcode-validator
Version: 1.0.1
Summary: Used to validate restricted python code inputs against test cases.
Author: Jacob Elliott
Author-email: coachelliott@uscybergames.org
Classifier: Programming Language :: Python :: 3
Classifier: Operating System :: OS Independent
Requires-Python: >=3.6
Description-Content-Type: text/markdown
Dynamic: author
Dynamic: author-email
Dynamic: classifier
Dynamic: description
Dynamic: description-content-type
Dynamic: requires-python
Dynamic: summary

# USCG Leetcode Validator

A secure Python code validator for coding challenge platforms like LeetCode-style or CTF environments.

This package runs and validates submitted Python functions under strict constraints using Python's AST (Abstract Syntax Tree). It ensures that only allowed operations (like basic loops, arithmetic, and safe built-ins) are used. This is ideal for running untrusted user code in coding competitions, while preventing unsafe or unwanted behavior.

---

## 🚀 Features

- ✅ Accepts only a single top-level function in the submitted code
- ✅ Rejects all imports, lambdas, classes, and custom function definitions
- ✅ Optionally allows safe built-ins like `len()` and `range()`
- ✅ Enforces AST-level constraints before execution
- ✅ Runs submitted function against a list of test cases
- ✅ Outputs time taken and pass/fail result for each test case

---

## 📦 Installation

To install from PyPI:

```bash
pip install uscg_leetcode_validator
```
