Learn by Example
Explore our tutorials to learn how to use Graph-sitter for various code transformation tasks.
Featured Tutorials
Generate interactive visualizations of your codebase's structure, dependencies, and relationships.
Mine Training DataCreate high-quality training data for LLM pre-training similar to word2vec or node2vec
Delete Dead CodeRemove unused imports, functions, and variables with confidence.
API Migrations
Update API calls, handle breaking changes, and manage bulk updates across your codebase.
SQLAlchemy 1.4 to 2.0Update SQLAlchemy code to use the new 2.0-style query interface and patterns.
Flask to FastAPIConvert Flask applications to FastAPI, updating routes and dependencies.
Python 2 to 3Migrate Python 2 code to Python 3, updating syntax and modernizing APIs.
Code Organization
Restructure files, enforce naming conventions, and improve project layout.
Improve ModularitySplit large files, extract shared logic, and manage dependencies.
Manage TypeScript ExportsOrganize and optimize TypeScript module exports.
Convert Default ExportsConvert between default and named exports in TypeScript/JavaScript.
Testing & Types
Convert unittest test suites to pytest's modern testing style.
Increase Type CoverageAdd TypeScript types, infer types from usage, and improve type safety.
Documentation & AI
Generate JSDoc comments, README files, and API documentation.
Prepare for AIGenerate system prompts, create hierarchical documentation, and optimize for AI assistance.
Each tutorial includes practical examples, code snippets, and best practices. Follow them in order or jump to the ones most relevant to your needs.