🐍 pycefrl

Identify Python3 Code Level Using the CEFR Framework as Inspiration

Analyze code complexity and skill levels in Python projects, repositories, and snippets

What is pycefrl?

pycefrl is a powerful tool that evaluates Python code using a framework inspired by the Common European Framework of Reference for Languages (CEFR). It assigns complexity levels (A1 to C2) to code elements, helping developers understand and improve code quality.

📊

Multi-Source Analysis

Analyze local directories, GitHub repositories, individual users, or code snippets with ease.

🎯

CEFR-Inspired Levels

Code elements are categorized from A1 (basic) to C2 (advanced), providing clear complexity insights.

📈

Rich Visualizations

Interactive dashboards with charts, heatmaps, and detailed reports in JSON and CSV formats.

Easy to Use

Simple command-line interface and Streamlit web app for real-time analysis and visualization.

🔍

Detailed Breakdown

Get file-by-file, class-by-class analysis with line numbers and displacement information.

🚀

Open Source

Free and open source under MIT license. Contribute and customize to your needs.

Quick Start

Get started with pycefrl in just a few steps:

1. Install Dependencies

pip3 install -r requirements.txt

2. Generate Level Dictionary

python3 dict.py

3. Run Analysis

# Analyze a directory
python3 pycerfl.py directory /path/to/code

# Analyze a GitHub repository
python3 pycerfl.py repo https://github.com/user/repo

# Analyze a GitHub user
python3 pycerfl.py user username

4. View Results

Results are saved as data.json and data.csv. Use our interactive dashboard to visualize them!

Open Dashboard

Code Level Examples

A1

Basic Elements

Simple lists, tuples, assignments, print statements

A2

Elementary

File operations, simple loops, function calls, imports

B1

Intermediate

Functions with arguments, classes, exception handling

B2

Upper Intermediate

Advanced functions, decorators, class inheritance

C1

Advanced

Comprehensions, generators, metaclasses, descriptors

C2

Proficient

Complex comprehensions, advanced OOP patterns

Streamlit Web Interface

Launch the interactive Streamlit application for real-time analysis with beautiful visualizations:

python3 -m streamlit run app.py

Features:

  • Real-time execution logs and system statistics
  • Interactive visualizations: Bubble Charts, Heatmaps, Treemaps
  • Download reports in JSON and CSV formats
  • Select analysis mode: Directory, GitHub Repository, or GitHub User

Ready to Get Started?

Explore the documentation to learn more about pycefrl's capabilities