Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
38 changes: 38 additions & 0 deletions CODE_OF_CONDUCT.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
# Contributor Code of Conduct

## Our Pledge

We are committed to providing a friendly, safe, and welcoming environment for all contributors and learners, regardless of background, experience level, identity, or perspective.

---

## Standards

Contributors are expected to uphold the following standards:

- Demonstrate empathy and kindness toward other members of the community.
- Respect differing viewpoints, approaches, and constructive feedback.
- Focus on what is best for the overall learning community.
- Gracefully accept constructive criticism and suggestions.
- Write clean, well-documented code that benefits others.

---

## Unacceptable Behavior

The following behaviors are considered unacceptable:

- Harassment, trolling, derogatory comments, or personal attacks.
- Disrespectful or exclusionary conduct in issues, pull requests, or discussions.
- Publishing private information of others without explicit permission.
- Any conduct that could reasonably be considered inappropriate in a professional or educational setting.

---

## Enforcement and Reporting

Project maintainers are responsible for clarifying and enforcing standards of acceptable behavior. Instances of abusive, harassing, or otherwise unacceptable behavior can be reported to the repository maintainer at:

`chandio.saqib.m@gmail.com`

All complaints will be reviewed and investigated promptly and fairly.
84 changes: 84 additions & 0 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,84 @@
# Contributing Guidelines

Thank you for considering contributing to Fluent Python. Contributions help keep this repository a valuable learning resource for everyone.

Direct pushes to the `main` branch are blocked. All contributions must go through a fork, branch, and Pull Request workflow.

---

## Contribution Workflow

Follow these steps to contribute code, notebooks, or documentation:

### 1. Fork and Clone

Fork the repository to your own GitHub account, then clone it locally:

```bash
git clone https://github.com/<your-username>/fluent-python.git
cd fluent-python
```

Add the upstream remote to stay in sync with changes:

```bash
git remote add upstream https://github.com/saqibbedar/fluent-python.git
```

### 2. Create a Topic Branch

Always create a dedicated branch off `main` for your work. Never work directly on `main`:

```bash
git checkout -b feature/topic-name
```

Use descriptive branch names, such as `feature/generator-expressions` or `fix/pathlib-typo`.

### 3. Guidelines on File Types and Naming

- **Jupyter Notebooks (`.ipynb`)**: Strongly recommended for thorough, step-by-step explanations, conceptual walkthroughs, and learning modules. Keep them organized and clear.
- **Python Scripts (`.py`)**: Recommended for standalone scripts, modules, or larger application setups (e.g. `fastapi-projects/`, custom utilities).
- **Markdown Files (`.md`)**: Accepted for documentation, theoretical summaries, and reference material.
- **File Naming**: Names must clearly communicate contents (e.g., `list_comprehensions.ipynb` instead of `temp.ipynb` or `test.py`).

> **Note on Structure Reorganization:** This repository is actively expanding and undergoing continuous normalization. The maintainers reserve the right to shuffle, relocate, or refactor contributed files and directories as the repository grows.

### 4. Run Code Quality Checks Locally

Before committing or pushing, verify that your code conforms to the project's formatting and linting standards:

```bash
just code_quality
```

This runs Ruff checks and formatting on all modified and untracked files, writing results to `.logs/ruff.txt`.

- Inspect `.logs/ruff.txt` to confirm that all checks pass.
- Fix any syntax or lint errors before proceeding.

### 5. Continuous Integration (GitHub Actions)

An automated GitHub Actions workflow runs the same Ruff lint and format verification on every Pull Request. If local checks are skipped and the CI workflow fails, your PR cannot be merged until all issues are resolved.

### 6. Commit and Push

Stage and commit your changes:

```bash
git add .
git commit -m "feat(comprehensions): add set comprehension examples"
```

Push the branch to your fork:

```bash
git push origin feature/topic-name
```

### 7. Open a Pull Request

1. Navigate to the original repository: `https://github.com/saqibbedar/fluent-python`.
2. Click **New Pull Request** and select your branch.
3. Fill out the provided Pull Request template completely.
4. Submit the PR for review and address any reviewer comments or suggestions.
4 changes: 4 additions & 0 deletions Justfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
# Justfile for automatic scripts

code_quality:
uv run --project kernel python scripts/code_quality.py
67 changes: 53 additions & 14 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,32 +1,71 @@
# Fluent Python

This repository covers massive Python topics, organized in proper folder structure. Anyone interested in learning Python can find this helpful. Constantly, it is being updated with highly documented notebooks that makes it so easy for you to learn Python's any topic.
A comprehensive, hands-on repository dedicated to learning and mastering modern Python. This repository provides structured code examples, deep dives, and documented Jupyter notebooks across core language constructs, design patterns, standard library modules, and practical applications.

> ⚠️ Important Note: As repository is continuously updating, so contents will be restructured on fly. Any discrepancy will subject to removal. Current folder structure is not fixed—with daily changes the things can go here and there for absolute optimized repository for learning Python.
> **Work in Progress (WIP):** This repository is under active development and continuously expanding. File paths, folder structure, and topics may be shuffled or refactored as the repository is normalized.

# Ultimate Goal
---

After the work is finished, this repository will serve a quick learning hub for any body who wants to master the Python, its design patterns through properly documented notebooks. And, final conversion will be a website that will make it even more easy for you to learn anything about Python systematically and steptistically.
## Scope and Covered Topics

# Folder structure
The repository is organized modularly by concept and domain:

Currently, folder structure is a bit weird as I have `0x_` prefix which will be refactored once all major topics are covered and and organized orderly.
- **Language Fundamentals**: Basics, functions, exceptions, and file handling.
- **Data Structures**: Detailed coverage of built-in types (strings, bytes, bytearrays, lists, dicts, sets, tuples) and advanced collections.
- **Pythonic Patterns**: Comprehensions, iterators, generators, and closures.
- **Object-Oriented Programming (OOP)**: Classes, inheritance, polymorphism, and special dunder methods.
- **Standard Library & Core Modules**: Modules such as `pathlib`, `datetime`, `subprocess`, and locale management.
- **Projects & Frameworks**: Practical applications including FastAPI projects.
- **Tooling & Automation**: Maintenance scripts, local quality runners, and CI checks.

# Getting Started
---

You can start exploring the repository locally, or you can add your programs, too, in `/contributors` directory. If not exist then do create it and push your code inside it. This will help us to maintain the main code and contributors code easily and inject any topic to any directory on purpose.
## Getting Started

Here is how to clone and get started fully on your local machine.
### Prerequisites

- Python 3.12+ (Python 3.14 used in kernel environment)
- [`uv`](https://docs.astral.sh/uv/) for package and tool management
- [`just`](https://github.com/casey/just) command runner

### Setup

1. Clone the repository:
```bash
git clone https://github.com/saqibbedar/fluent-python.git
cd fluent-python
```

2. Open the project in your editor of choice (e.g., VS Code, PyCharm, or JupyterLab).

---

## Code Quality

All Python scripts and notebooks are checked and formatted using [Ruff](https://docs.astral.sh/ruff/).

To run linting, formatting, and auto-fixes across all modified and untracked files:

```bash
git clone https://github.com/saqibbedar/fluent-python.git
cd fluent-python && code . # && code . is vs code command, if you don't use it to then skip it and open folder manually or use IDE of your choice, i.e., PyCharm etc.
just code_quality
```

# Contributions
Logs are generated in `.logs/ruff.txt`. Code quality checks run automatically on every pull request via GitHub Actions.

---

## Contributing

Contributions are welcome. Before submitting any changes, please review:

- [CONTRIBUTING.md](./CONTRIBUTING.md) for branch workflow, file naming conventions, and PR requirements.
- [CODE_OF_CONDUCT.md](./CODE_OF_CONDUCT.md) for community standards.

Direct pushes to `main` are restricted; all contributions must be submitted through pull requests.

As like always, contributions are heart of any repository. So, you are invited and welcomed, even help in documentation is a big contribution and any flaw you find in existing code or anything you have to share fell free to add on. You are superbly welcomed.
---

# LICENSE
## License

This project is licensed under the [MIT License](./LICENSE).
See [LICENSE](./LICENSE).
2 changes: 2 additions & 0 deletions kernel/pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,10 @@ authors = [
]
requires-python = ">=3.14"
dependencies = [
"gitpython>=3.2.0",
"numpy>=2.5.3",
"pandas>=3.0.6",
"yachalk>=0.1.8",
]

[dependency-groups]
Expand Down
68 changes: 68 additions & 0 deletions kernel/uv.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading
Loading