Skip to main content

Your personal Python skill forge — scans your code, finds gaps, generates challenges, and schedules reviews using spaced repetition.

Project description

CodeCraft

   ______          __        ___________      _________
  / ____/___  ____/ /__     / ____/ ___/     / ____/   |  ____  ____
 / /   / __ \/ __  / _ \   / /    \__ \____ / /_  / /| | / __ \/ __ \
/ /___/ /_/ / /_/ /  __/  / /___ ___/ /___/ __/ / ___ |/ /_/ / /_/ /
\____/\____/\__,_/\___/   \____//____/     /_/   /_/ |_/ .___/ .___/
                                                        /_/   /_/

Your personal Python skill forge — scans your code, finds learning gaps, generates transfer exercises, and schedules spaced repetition reviews — all from patterns in your own code.

pip install codecraft-cli

Quick Start

# Scan your codebase
codecraft scan ~/my-project

# See what you need to learn
codecraft remix gaps

# Start practicing
codecraft practice path beginner

# Review with spaced repetition
codecraft schedule queue
codecraft scan ~/Desktop/Python
codecraft remix generate --new-domain cricket
codecraft practice path beginner
codecraft schedule queue

Setup Guide

Prerequisites

  • Python 3.10+ — check with python --version
  • pip — comes with Python
  • Git — to clone and contribute

Step 1: Clone

git clone https://github.com/rudrakhairnar16-bit/codecraft.git
cd codecraft

Step 2: Install

# Basic install
pip install -e .

# With dev dependencies (tests, linting)
pip install -e ".[dev]"

Step 3: Verify

codecraft --help

You should see available commands: scan, debt, remix, schedule, dashboard, practice, progress, suggest, learn, stats, export, init, start, vacuum, precommit, sync, profile, status.

Step 4: Scan your first code

codecraft scan path/to/your/python/project

Step 5: Explore

# Show your learning debt
codecraft debt report

# Find concept gaps
codecraft remix gaps

# Start beginner path
codecraft practice path beginner

Features

Code Scanner

  • AST-based analysis reads your .py files without executing them
  • Detects 130+ concepts across 4 tiers (basics → advanced)
  • Identifies 17 anti-patterns (bare except, magic numbers, mutable defaults, etc.)
  • Computes cyclomatic complexity and import dependency graphs

Debt Tracker

  • Aggregates debt items by pattern across your codebase
  • Scores resolution rate (0–100%)
  • Generates refactor challenges from your own code

Remix Engine

  • Finds concept gaps (< 3 exposures in your scanned code)
  • Picks an unused domain from 20 available
  • Generates transfer exercises with real-world context and starter code

Spaced Repetition Scheduler

  • SM-2 adaptation with exponential decay
  • Per-concept strength from last-use timestamps
  • Builds urgency-sorted review queue

Practice Mode

  • Inline terminal coding — type code, type submit to finish
  • Live timer with extend for +2 minutes
  • Full solution analysis: parse check, concept detection, complexity, score (0–100), strengths/issues, suggestion

Beginner Path

Step-by-step curriculum:

  1. print_functioninput_functionvariable_assignmentbasic_types
  2. string_methodsf_stringsarithmetic
  3. comparisonsif_else
  4. for_loopwhile_looplist_opsdict_ops
  5. function_defreturn_value

CLI Reference

scan — Analyze code

codecraft scan <path>              # Scan a directory or file

debt — Learning debt management

codecraft debt report              # Show summary of all debt
codecraft debt list                # List individual debt items
codecraft debt challenge           # Generate refactor challenge

remix — Transfer exercises

codecraft remix gaps               # Find concept gaps
codecraft remix generate           # Generate an exercise for gap concepts
codecraft remix domains            # List all domains with coverage
codecraft remix review <domain>    # Show exercises for a domain

practice — Inline coding practice

codecraft practice start <concept>          # Start practice with timer
codecraft practice list                     # List all available concepts
codecraft practice path                     # Show available learning paths
codecraft practice path beginner            # Show beginner path steps
codecraft practice path beginner --step 3   # Start from step 3

schedule — Spaced repetition

codecraft schedule queue           # Show pending review items
codecraft schedule due             # Show items due now
codecraft schedule review          # Do a review session
codecraft schedule decay <days>    # Set decay constant (default: 7)

dashboard — Visualize progress

codecraft dashboard summary        # Overall stats
codecraft dashboard heatmap        # Concept mastery heatmap
codecraft dashboard trends         # Learning trends over time

Domains (20 total)

Domain Context
finance Stocks, transactions, ledgers
bioinfo DNA sequences, gene analysis
sysadmin Logs, configs, system monitoring
gaming Player stats, game mechanics
iot Sensor data, device monitoring
web_scraping HTML parsing, data extraction
nlp Text processing, sentiment analysis
cli_tools CLI argument parsing, file utils
data_viz Charts, plots, data visualization
simulation Monte Carlo, physics sims
audio Sound processing, waveforms
image Pixel manipulation, filters
compilers AST, parsing, code gen
networking Sockets, HTTP, protocols
crypto Hashing, encryption, signing
science Experiments, lab data, formulas
sports_cricket 🏏 Scoring, stats, matches
travel Trip planning, distances, budget
education Grades, quizzes, student records
health Fitness, BMI, diet tracking

Project Structure

codecraft/
├── src/codecraft/
│   ├── cli/              # Typer CLI commands
│   ├── db/               # DuckDB connection & migrations
│   ├── domains/          # 20 domain contexts with recipes
│   ├── engines/          # Debt, Remix, Scheduler, Templates
│   ├── models/           # Pydantic data models
│   ├── scanner/          # AST parser, concept extractor, debt detector
│   └── utils/            # Colors, helpers
├── tests/                # Pytest test suite (553+ tests)
├── pyproject.toml        # Project config & dependencies
└── README.md

Running Tests

# Run all tests
pytest

# With coverage
pytest --cov=codecraft --cov-report=term

# Run specific test file
pytest tests/test_scanner/test_concept_extractor.py -v

License

MIT

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

codecraft_cli-0.2.0.tar.gz (80.9 kB view details)

Uploaded Source

Built Distribution

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

codecraft_cli-0.2.0-py3-none-any.whl (112.3 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: codecraft_cli-0.2.0.tar.gz
  • Upload date:
  • Size: 80.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.12.4

File hashes

Hashes for codecraft_cli-0.2.0.tar.gz
Algorithm Hash digest
SHA256 00ec21cb19f0aecc9e62675acc3ce758d0f116eeab00dd5461f598ea2160b415
MD5 21e8de7e23f7377d9f76ddb126133210
BLAKE2b-256 17453ab914d4501f276b93c909d88dc661be540c8474b5168183a294e101ea89

See more details on using hashes here.

File details

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

File metadata

  • Download URL: codecraft_cli-0.2.0-py3-none-any.whl
  • Upload date:
  • Size: 112.3 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.12.4

File hashes

Hashes for codecraft_cli-0.2.0-py3-none-any.whl
Algorithm Hash digest
SHA256 3490a2356d83b35762d4e9247c90459a419cce66f64101378737c175a533a1c1
MD5 db5cda32af01bf55c79fb80c04763e04
BLAKE2b-256 aff620c57b96a7a5131dc24e2b7f16b164993a4cf7ca939fbf46a4353f3b5e48

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