Metadata-Version: 2.4
Name: pycorebox
Version: 0.1.0
Summary: A friendly interactive sandbox to learn and execute core algorithms from scratch.
Requires-Python: >=3.14
Description-Content-Type: text/markdown

# 📦 PyCoreBox

> The ultimate interactive Python library that takes you from absolute beginner (School-level basics) to advanced Developer (FAANG-level DSA).
> Stop searching for code snippets. Start learning directly in your terminal!

---

## The Problem vs. The PyCoreBox Solution

### ❌ Way 1: The Old Way (Time Wasting)

You are a student learning Python. You forget how to write the code for a **Fibonacci sequence**, an **Armstrong number**, or a **Merge Sort**.
You open Google, search AI prompts, read through 5 different blogs, copy the code to VSCode, and try to piece together the explanation and time complexity. You write it in a physical notebook and lose it later.

### ✅ Way 2: The PyCoreBox Way (Instant Learning)

You open your Python terminal or script. You import PyCoreBox.
You type `Learn.fibonacci_sequence()`.
Instantly, the complete, pristine source code is printed to your screen, along with a detailed explanation and its Time/Space complexity.

No context switching. No Googling. Just pure, immediate learning.

---

## Installation

You can install PyCoreBox directly from the source:

```bash
git clone [https://github.com/Abhisek-Dash-Official/pycorebox.git](https://github.com/Abhisek-Dash-Official/pycorebox.git)
cd pycorebox
pip install -e .
```

_Note: Requires Python 3.12+_

---

## How It Works: The Two Pillars

PyCoreBox is unified under two powerful interfaces: **`Learn`** (for students) and **`Run`** (for developers).

### 1. The `Learn` Interface (Your Interactive Textbook)

Just want to see how an algorithm is written from scratch? Use the `Learn` class.

```python
from pycorebox import Learn

# Forgot school-level basics?
Learn.swap_variables()
Learn.check_armstrong_num()
Learn.factorial()

# Need to practice printing patterns?
Learn.butterfly()
Learn.hollow_square()

# Preparing for Data Structures & Algorithms?
Learn.binary_search()
Learn.avl_tree_operations()
Learn.dijkstra_algorithm()
```

_Output will cleanly display the Title, Source Code, Detailed Explanation, and Time/Space Complexity right in your console!_

### 2. The `Run` Interface (Your Developer Toolkit)

Want to actually execute these algorithms on your own data without rewriting the boilerplate? Use the `Run` class.

```python
from pycorebox import Run

# Example: Execute optimal Graph Traversal using PyCoreBox Generators
graph = {'A': ['B', 'C'], 'B': ['D'], 'C': [], 'D': []}
for node in Run.dfs(graph, 'A'):
    print(node)
```

---

## What's Inside? (The Curriculum)

PyCoreBox covers a massive surface area of Computer Science, structured perfectly from Level 1 to Level 4.

### Level 1: The Absolute Basics & Patterns

- **Basics:** `fibonacci_sequence`, `check_armstrong_num`, `check_palindrome_num`, `swap_variables`, `find_gcd`, `check_leap_year`, `find_first_max`, etc.
- **Patterns:** `solid_square`, `half_pyramid`, `diamond`, `butterfly`, `number_palindromic_triangle`, `alphabet_half_pyramid`, etc.

### Level 2: Intermediate Concepts

- **Searching:** `linear_search`, `binary_search`, `jump_search`, `ternary_search`, `linked_list_search`, etc.
- **Sorting:** `bubble_sort`, `selection_sort`, `insertion_sort`, `merge_sort`, `quick_sort`, `heap_sort`, and Linked List variants.
- **Recursion:** `factorial_recursive`, `fibonacci_recursive`, `tower_of_hanoi_recursive`, `generate_subsets_recursive`, etc.
- **Regex:** `regex_basics`, `validate_email`, `extract_urls`, `validate_password`, `sanitize_text`, etc.

### Level 3: Core Data Structures

- **Linear DS:** `array_operations`, `stack_operations`, `queue_operations`, `deque_operations`, `linked_list_operations`.
- **Trees & Graphs:** `binary_tree_operations`, `bst_operations`, `avl_tree_operations`, `trie_operations`, `graph_operations`.
- **Advanced DS:** `segment_tree_operations`, `heap_operations`, `lru_cache_operations`, `disjoint_set_union`.

### Level 4: Advanced Algorithms (FAANG Level)

- **Graph Algos:** `dijkstra_algorithm`, `bellman_ford_algorithm`, `floyd_warshall_algorithm`, `prims_algorithm`, `kruskals_algorithm`, `kosarajus_algorithm`.
- **String & Array Algos:** `kmp_algorithm`, `rabin_karp_algorithm`, `quickselect_algorithm`.
- **Tree Algos:** `morris_traversal`.

---

## Project Architecture

PyCoreBox is strictly typed, OOP-driven, and highly modular.

```text
pycorebox/
├── src/
│   └── pycorebox/
│       ├── algorithms/      # Dijkstra, KMP, Kruskal's...
│       ├── basics/          # Fibonacci, Armstrong, Swap...
│       ├── data_structures/ # Trees, Graphs, Hash Maps...
│       ├── matrix/          # 2D arrays, Rotations...
│       ├── patterns/        # Pyramids, Diamonds, Butterfly...
│       ├── recursion/       # Tower of Hanoi, Subsets...
│       ├── regex/           # Validation, Extraction...
│       ├── searching/       # Binary, Ternary, Jump...
│       ├── sorting/         # Merge, Quick, Heap...
│       ├── utils.py         # Code printer engine
│       └── __init__.py      # Unified Learn and Run exports
└── main.py
```

---

## Contributing

Contributions are welcome! Whether you are a student fixing a typo or a developer optimizing a `Run` utility:

1. Fork the repository.
2. Create your feature branch (`git checkout -b feature/NewAlgorithm`).
3. Commit your changes (`git commit -m ```feat: add new algorithm````).
4. Push to the branch (`git push origin feature/NewAlgorithm`).
5. Open a Pull Request.

Happy Coding!
