A package for solving coding problems with automatic problem fetching and comments injection
Project description
Local DSA
local_dsa is a Python package designed to streamline coding problem-solving.
It automatically fetches related problem suggestions from a local database,
inserts automated comments into your code, and allows you to run solution tests
easily just from a single .py file
Features
- Global
questionobject
Easily set and access:from local_dsa import question question.name = "Sum of Two Numbers" question.id = 1
- Automatic problem suggestions
Finds similar problems and inserts comments directly after yourquestion.nameline. - Problem statement injection
Adds the problem statement afterquestion.idline. - Solution testing & storage
test_problem()→ runs test cases without storing codesolve_problem()→ runs test cases and stores your solution in the database.
Installation
Install using pip:
pip install local-dsa
Quick Start
Example usage:
from local_dsa import question, test_problem
# Set question details
question.name = "Sum of Two Numbers"
question.id = 1
class SumTwoNumbers:
def solve(self, a, b):
return a + b
# Test the solution
test_problem(question, SumTwoNumbers)
Expected auto-comments in your file after saving & running:
question.name = "Sum of Two Numbers"
## Problem found here: [ID: 1] Sum of Two Numbers
question.id = 1
## Attempting problem: Sum of Two Numbers
## Given two integers, return their sum.
Command Overview
solve_problem(question, solver_class)
Runs test cases and stores the function code.test_problem(question, solver_class)
Runs test cases without storing.
Project Structure
local_dsa/
├── __init__.py
├── question.py
├── main.py
├── check_solutions.py
├── code_storage.py
Contributing
Pull requests are welcome! For major changes, please open an issue first to discuss what you’d like to change.
License
This project is licensed under the MIT License - see the LICENSE file for details.
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 local_dsa-0.1.2.tar.gz.
File metadata
- Download URL: local_dsa-0.1.2.tar.gz
- Upload date:
- Size: 4.9 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.13.2
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
43e6a2bbd3ee4004b85411bd1b0b350ec26a224f7d170dc1854f866840e62132
|
|
| MD5 |
1fb86748284eacf16acf76abcbb9c035
|
|
| BLAKE2b-256 |
fc245469f4c63d96ef353210bc47e1a98a9efb8ed4fbf4b840e0b8d9677b725b
|
File details
Details for the file local_dsa-0.1.2-py3-none-any.whl.
File metadata
- Download URL: local_dsa-0.1.2-py3-none-any.whl
- Upload date:
- Size: 6.2 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.13.2
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
d2705db9bb28e1254ba71f1c08489ca926b50bde3a2cc71b3bd29e9a021e64cb
|
|
| MD5 |
848e1f57e3e4a6c607448da550483bc0
|
|
| BLAKE2b-256 |
d5109f22ab7723e192136152c2c610eb8f4b2050a35eddefcba813efb15cd064
|