Skip to main content

A semantic DSA execution engine.

Project description

๐Ÿš€ PyDSA Engine v0.2.0

PyPI Version Python Build License

A Semantic AI-Powered Data Structures & Algorithms Execution Engine

Search. Execute. Trace. Benchmark. Learn.


๐ŸŽ‰ What's New in v0.2.0

๐ŸŽ๏ธ Benchmark Engine

PyDSA Engine now includes a powerful benchmarking system.

Benchmark any supported algorithm directly from your terminal:

pydsa benchmark "two sum"

Get:

  • Average Runtime
  • Fastest Execution
  • Slowest Execution
  • Execution Statistics
  • Performance Insights

Perfect for:

  • Competitive Programmers
  • Interview Preparation
  • Performance Analysis
  • DSA Learning

๐ŸŒŸ Overview

PyDSA Engine is a next-generation Data Structures & Algorithms execution environment built for developers, students, educators, researchers, and AI applications.

Instead of remembering exact problem names, simply describe what you're looking for and let the AI-powered routing engine find the correct algorithm instantly.

PyDSA Engine combines:

  • AI Semantic Search
  • Dynamic Execution
  • Algorithm Benchmarking
  • Visual Debugging
  • FastAPI Integration
  • Complexity Analysis

into a single developer-friendly package.


โœจ Features

๐Ÿง  AI Semantic Search

Find algorithms using natural language.

Example:

pydsa search "water container"

Automatically finds:

Container With Most Water

โšก Dynamic Algorithm Execution

Execute algorithms directly from the terminal.

Supports:

  • Arrays
  • Strings
  • Integers
  • Matrices
  • Graphs
  • Trees

Example:

pydsa solve "two sum" "[2,7,11,15]" "9"

๐Ÿ” Visual X-Ray Tracer

Watch your algorithm execute line-by-line.

Example:

pydsa solve "two sum" "[2,7,11,15]" "9" --trace

Features:

  • Variable Tracking
  • Execution Flow
  • Step-by-Step Debugging
  • Educational Learning Mode

๐ŸŽ๏ธ Benchmark Engine

Benchmark algorithm performance instantly.

Example:

pydsa benchmark "two sum"

Sample Output:

โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”
โ”‚ Benchmark Results           โ”‚
โ”œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ค
โ”‚ Problem: Two Sum            โ”‚
โ”‚ Runs: 1000                  โ”‚
โ”‚ Avg Runtime: 0.000031 sec   โ”‚
โ”‚ Best Runtime: 0.000019 sec  โ”‚
โ”‚ Worst Runtime: 0.000064 sec โ”‚
โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜

Perfect for:

  • Comparing solutions
  • Optimization analysis
  • Performance profiling
  • Learning complexity behavior

๐Ÿ“‹ Clipboard Integration

Copy optimal solutions directly into your clipboard.

Example:

pydsa solve "two sum" --copy

Requirements:

pip install pyperclip

๐ŸŒ Built-in FastAPI Server

Turn PyDSA into a backend microservice instantly.

Powered by:

  • FastAPI
  • OpenAPI
  • Swagger UI

๐Ÿ“ˆ Complexity Analysis

Every execution automatically displays:

  • Time Complexity
  • Space Complexity
  • Difficulty
  • Category

๐Ÿ“š Massive Algorithm Database

Includes:

  • 3900+ Problems
  • LeetCode Problems
  • Design Problems
  • Graph Problems
  • Dynamic Programming
  • Trees
  • Linked Lists
  • Advanced Data Structures

๐Ÿ“ฆ Installation

Install from PyPI:

pip install pydsa-engine

Verify Installation:

pydsa --help

๐Ÿ’ป CLI Usage

1๏ธโƒฃ Search Problems

Use natural language to find algorithms.

pydsa search "water container"

Example:

Found:
Container With Most Water

Difficulty: Medium
Category: Two Pointers

2๏ธโƒฃ View Source Code

Display the optimal implementation.

pydsa solve "max water" --show-code

3๏ธโƒฃ Copy Source Code

Copy directly into your IDE.

pydsa solve "two sum" --copy

4๏ธโƒฃ Execute Algorithms

Run algorithms with actual inputs.

pydsa solve "two sum" "[2,7,11,15]" "9"

Output:

Result:
[0,1]

Time Complexity:
O(n)

Space Complexity:
O(n)

5๏ธโƒฃ X-Ray Trace Execution

Visual debugging mode.

pydsa solve "two sum" "[2,7,11,15]" "9" --trace

Example:

Line 12:
num = 2
target = 9

Line 13:
lookup = {2: 0}

6๏ธโƒฃ Benchmark Algorithms

Analyze algorithm performance.

pydsa benchmark "two sum"

Other examples:

pydsa benchmark "container with most water"

pydsa benchmark "merge intervals"

pydsa benchmark "longest substring without repeating characters"

๐ŸŒ REST API Server

Launch FastAPI Server:

pydsa serve --port 8000

Server:

http://127.0.0.1:8000

Swagger UI:

http://127.0.0.1:8000/docs

Redoc:

http://127.0.0.1:8000/redoc

Example API Request

Endpoint

POST /solve

Request

{
  "query": "two sum",
  "inputs": [
    [2,7,11,15],
    9
  ],
  "trace": true
}

Response

{
  "result": [0,1],
  "time_complexity": "O(n)",
  "space_complexity": "O(n)"
}

๐Ÿ“š Supported Categories

Current Categories:

  • Arrays
  • Strings
  • Linked Lists
  • Trees
  • Binary Trees
  • Binary Search Trees
  • Graphs
  • Dynamic Programming
  • Greedy Algorithms
  • Backtracking
  • Recursion
  • Sliding Window
  • Two Pointers
  • Hash Tables
  • Heaps
  • Queues
  • Stacks
  • Tries
  • Design Problems
  • Math
  • Bit Manipulation

and many more...


๐Ÿ— Architecture

PyDSA Engine
โ”‚
โ”œโ”€โ”€ CLI Interface
โ”œโ”€โ”€ AI Semantic Search
โ”œโ”€โ”€ Vector Search Engine
โ”œโ”€โ”€ Dynamic Execution Engine
โ”œโ”€โ”€ Visual X-Ray Tracer
โ”œโ”€โ”€ Benchmark Engine
โ”œโ”€โ”€ Clipboard Manager
โ”œโ”€โ”€ FastAPI Server
โ”œโ”€โ”€ Complexity Analyzer
โ””โ”€โ”€ Algorithm Database (3900+)

๐Ÿ›  Development Setup

Clone Repository:

git clone https://github.com/Abhi112ss/pydsa.git

Move into Project:

cd pydsa

Install Editable Mode:

pip install -e .

Install Development Dependencies:

pip install pytest

โœ… Testing

Run Tests:

pytest

Run Coverage:

pytest --cov=pydsa

๐Ÿค Contributing

Contributions are welcome.

Ways to contribute:

  • Add Algorithms
  • Improve Documentation
  • Improve Search Accuracy
  • Add New CLI Features
  • Optimize Benchmark Engine
  • Improve Tracing System
  • Performance Improvements

Workflow:

fork โ†’ feature branch โ†’ commit โ†’ pull request

๐Ÿ›ฃ Roadmap

โœ… v0.2.0

  • AI Semantic Search
  • Dynamic Execution Engine
  • Visual X-Ray Tracer
  • Benchmark Engine
  • FastAPI REST Server
  • Clipboard Integration
  • Complexity Analysis

๐Ÿš€ Upcoming

  • Visual Graph Explorer
  • Interactive Tree Visualizer
  • Algorithm Playground
  • AI Tutor Mode
  • LeetCode Sync
  • Competitive Programming Assistant
  • Web Dashboard
  • Performance Charts

๐Ÿ“„ License

Licensed under the MIT License.

MIT License

See the LICENSE file for details.


Built with โค๏ธ for the Python & DSA Community

PyDSA Engine โ€” Search. Execute. Trace. Benchmark. Learn.

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

pydsa_engine-0.2.0.tar.gz (8.7 MB view details)

Uploaded Source

Built Distribution

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

pydsa_engine-0.2.0-py3-none-any.whl (10.8 MB view details)

Uploaded Python 3

File details

Details for the file pydsa_engine-0.2.0.tar.gz.

File metadata

  • Download URL: pydsa_engine-0.2.0.tar.gz
  • Upload date:
  • Size: 8.7 MB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.11.0

File hashes

Hashes for pydsa_engine-0.2.0.tar.gz
Algorithm Hash digest
SHA256 16ceec0222c17439a18f2b1eac906059bbbfc4387d83e637e7ce4ccb93813ffe
MD5 d641af8e862a74271312f844b5ed3792
BLAKE2b-256 93a9a0b013e984bb88449efa419c73e9f341c9beb7737e442f2a6e6cda529a2b

See more details on using hashes here.

File details

Details for the file pydsa_engine-0.2.0-py3-none-any.whl.

File metadata

  • Download URL: pydsa_engine-0.2.0-py3-none-any.whl
  • Upload date:
  • Size: 10.8 MB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.11.0

File hashes

Hashes for pydsa_engine-0.2.0-py3-none-any.whl
Algorithm Hash digest
SHA256 cdd7254ec0872022d9c54d23e28d3d1ca68f8c3440b286b5e3209d3e91941217
MD5 71ca47af8abc6a13ca82fee48f7026a2
BLAKE2b-256 a006f8d37e6f42e20ef349f2a1ccfce721f5de7e17beff98be6d4492f9faa892

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