pythondaily | Education

Telegram-канал pythondaily - Python Daily

1102

Daily Python News Question, Tips and Tricks, Best Practices on Python Programming Language Find more reddit channels over at @r_channels

Subscribe to a channel

Python Daily

pyreqwest: An extremely fast, GIL-free, feature-rich HTTP client for Python, fully written in Rust

**What My Project Does**

I am sharing [pyreqwest](https://github.com/MarkusSintonen/pyreqwest), a high-performance HTTP client for Python based on the robust Rust `reqwest` crate.

I built this because I wanted the fluent, extensible interface design of `reqwest` available in Python, but with the performance benefits of a compiled language. It is designed to be a "batteries-included" solution that doesn't compromise on speed or developer ergonomics.

**Key Features:**

* **Performance:** It allows for Python free-threading (GIL-free) and includes automatic zstd/gzip/brotli/deflate decompression.
* **Dual Interface:** Provides both Asynchronous and Synchronous clients with nearly identical interfaces.
* **Modern Python:** Fully type-safe with complete type hints.
* **Safety:** Full test coverage, no `unsafe` Rust code, and zero Python-side dependencies.
* **Customization:** Highly customizable via middleware and custom JSON serializers.
* **Testing:** Built-in mocking utilities and support for connecting directly to ASGI apps.

**All standard HTTP features are supported:**

* HTTP/1.1 and HTTP/2
* TLS/HTTPS via `rustls`
* Connection pooling, streaming, and multipart forms
* Cookie management, proxies, redirects, and timeouts
* Automatic charset detection and decoding

**Target Audience**

* Developers working in high-concurrency scenarios who need maximum throughput and low latency.
* Teams looking for a single, type-safe library that handles both sync and async use cases.
* Rust developers working in Python who miss the ergonomics of `reqwest`.

**Comparison**

I have benchmarked `pyreqwest` against the most popular Python HTTP clients. You can view the full benchmarks [here](https://github.com/MarkusSintonen/pyreqwest/blob/main/docs/benchmarks.md).

* **vs Httpx:** While `httpx` is the standard for modern async Python, `pyreqwest` aims

/r/Python
https://redd.it/1pswh1o

Читать полностью…

Python Daily

problem with Properties in Templates

Hello,

I added some properties (with Python's u/property decorator) to one of my model classes. Unfortunately, when I try to use them in templates ( {{ my_instance.my_property }}) I get no output. Any idea what's going wrong here?

TIA


/r/django
https://redd.it/1psddhw

Читать полностью…

Python Daily

Monday Daily Thread: Project ideas!

# Weekly Thread: Project Ideas 💡

Welcome to our weekly Project Ideas thread! Whether you're a newbie looking for a first project or an expert seeking a new challenge, this is the place for you.

## How it Works:

1. **Suggest a Project**: Comment your project idea—be it beginner-friendly or advanced.
2. **Build & Share**: If you complete a project, reply to the original comment, share your experience, and attach your source code.
3. **Explore**: Looking for ideas? Check out Al Sweigart's ["The Big Book of Small Python Projects"](https://www.amazon.com/Big-Book-Small-Python-Programming/dp/1718501242) for inspiration.

## Guidelines:

* Clearly state the difficulty level.
* Provide a brief description and, if possible, outline the tech stack.
* Feel free to link to tutorials or resources that might help.

# Example Submissions:

## Project Idea: Chatbot

**Difficulty**: Intermediate

**Tech Stack**: Python, NLP, Flask/FastAPI/Litestar

**Description**: Create a chatbot that can answer FAQs for a website.

**Resources**: [Building a Chatbot with Python](https://www.youtube.com/watch?v=a37BL0stIuM)

# Project Idea: Weather Dashboard

**Difficulty**: Beginner

**Tech Stack**: HTML, CSS, JavaScript, API

**Description**: Build a dashboard that displays real-time weather information using a weather API.

**Resources**: [Weather API Tutorial](https://www.youtube.com/watch?v=9P5MY_2i7K8)

## Project Idea: File Organizer

**Difficulty**: Beginner

**Tech Stack**: Python, File I/O

**Description**: Create a script that organizes files in a directory into sub-folders based on file type.

**Resources**: [Automate the Boring Stuff: Organizing Files](https://automatetheboringstuff.com/2e/chapter9/)

Let's help each other grow. Happy

/r/Python
https://redd.it/1pskzo4

Читать полностью…

Python Daily

Stinkiest code you've ever written?

Hi, I was going through my github just for fun looking at like OLD projects of mine and I found this absolute gem from when I started and didn't know what a Class was.

essentially I was trying to build a clicker game using FreeSimpleGUI (why????) and I needed to display various things on the windows/handle clicks etc etc and found this absolute unit. A 400 line createmainwindow() function with like 5 other nested sub functions that handle events on the other windows 😭😭

Anyone else have any examples of complete buffoonery from lack of experience?

/r/Python
https://redd.it/1psekfi

Читать полностью…

Python Daily

Trending Django Projects in 2025
https://django.wtf/trending/?trending=365

/r/django
https://redd.it/1pqyf7v

Читать полностью…

Python Daily

Sunday Daily Thread: What's everyone working on this week?

# Weekly Thread: What's Everyone Working On This Week? 🛠️

Hello /r/Python! It's time to share what you've been working on! Whether it's a work-in-progress, a completed masterpiece, or just a rough idea, let us know what you're up to!

## How it Works:

1. Show & Tell: Share your current projects, completed works, or future ideas.
2. Discuss: Get feedback, find collaborators, or just chat about your project.
3. Inspire: Your project might inspire someone else, just as you might get inspired here.

## Guidelines:

Feel free to include as many details as you'd like. Code snippets, screenshots, and links are all welcome.
Whether it's your job, your hobby, or your passion project, all Python-related work is welcome here.

## Example Shares:

1. Machine Learning Model: Working on a ML model to predict stock prices. Just cracked a 90% accuracy rate!
2. Web Scraping: Built a script to scrape and analyze news articles. It's helped me understand media bias better.
3. Automation: Automated my home lighting with Python and Raspberry Pi. My life has never been easier!

Let's build and grow together! Share your journey and learn from others. Happy coding! 🌟

/r/Python
https://redd.it/1prshdx

Читать полностью…

Python Daily

Confused About Django Project Structure: Traditional vs Service–Repository — Which One Should I Use?

Hi everyone,
I’m working on a Django project and I’m confused about which project structure is best to follow.
I see multiple approaches:
Traditional Django structure (models, views, urls, etc.)
Service + Repository pattern
Controller-based or layered structure
I want to understand:
When should I stick with the traditional Django approach?
At what point does using services and repositories make sense?
Is it over-engineering for small or medium projects?
I’d really appreciate advice from people who’ve worked on real-world Django projects.

/r/django
https://redd.it/1prgz0j

Читать полностью…

Python Daily

[Project] Pyrium – A Server-Side Meta-Loader & VM: Script your server in Python

I wanted to share a project I’ve been developing called **Pyrium**. It’s a server-side meta-loader designed to bring the ease of Python to Minecraft server modding, but with a focus on performance and safety that you usually don't see in scripting solutions.

# 🚀 "Wait, isn't Python slow?"

That’s the first question everyone asks. Pyrium does **not** run a slow CPython interpreter inside your server. Instead, it uses a custom **Ahead-of-Time (AOT) Compiler** that translates Python code into a specialized instruction set called **PyBC (Pyrium Bytecode)**.

This bytecode is then executed by a highly optimized, Java-based **Virtual Machine** running inside the JVM. This means you get Python’s clean syntax but with execution speeds much closer to native Java/Lua, without the overhead of heavy inter-process communication.

# 🛡️ Why use a VM-based approach?

Most server-side scripts (like Skript or Denizen) or raw Java mods can bring down your entire server if they hit an infinite loop or a memory leak.

* **Sandboxing:** Every Pyrium mod runs in its own isolated VM instance.
* **Determinism:** The VM can monitor instruction counts. If a mod starts "misbehaving," the VM can halt it without affecting the main server thread.
* **Stability:** Mods are isolated from the JVM and each other.

# 🎨 Automatic Asset Management (The ResourcePackBuilder)

One of the biggest pains in server-side modding

/r/Python
https://redd.it/1prasf0

Читать полностью…

Python Daily

Would you use this instead of Electron for a real project? (Python desktop GUI)

I’ve tried building small desktop apps in Python multiple times. Every time it ended the same way: frameworks felt heavy and awkward, like Electron felt exrteamly overkill. Even when things worked, apps were big and startup was slow (most of them). so I started experimenting with a different approach and created my own, I tried to focus on performance and on making the developer experience as simple as possible. It's a desktop framework that lets you build fast native apps using Python as a backend (with optional React/Vite, python or just html/js/css for the UI)

I’m actively collecting early feedback. Would you try taupy in a real project?

Why or why not? I just really need your honest opinion and any advice you might have

git - https://github.com/S1avv/taupy

small demo - https://github.com/S1avv/taupy-focus

Even a short answer helps. Critical feedback is very welcome.

/r/Python
https://redd.it/1pqu2wu

Читать полностью…

Python Daily

uv update recommendations

After adopting astral's uv last August, I did my first check for updates and found astral releases \-- pretty much non-stop.

What are other folks' experiences with updates? Is updating to the latest and greatest a good strategy, or is letting others "jump in the water" first prudent?

/r/Python
https://redd.it/1pqyzse

Читать полностью…

Python Daily

Switching themes on the fly in Flask-Admin

This might be more of a general Python question, but: in Flask-Admin, according to the Introduction to Flask-Admin docs, you can use different themes by initializing the app with:


admin = Admin(app, name='microblog', theme=Bootstrap4Theme(swatch='cerulean'))

This isn't really documented; the entire docs for "theme" just say "theme – Base theme. Defaults to Bootstrap4Theme().", with nothing about what other themes might exist, how to find and install them, etc.

Regardless, the main question is: Is there an easy way to switch themes on the fly, e.g. on a per-user basis? "Click here for dark mode", or letting users configure it in a personalization step, that kind of thing? Or can this only be done for the entire app at the initialization stage?



/r/flask
https://redd.it/1pqsd5x

Читать полностью…

Python Daily

Accelerating Tree-Based Models in SQL with Orbital

I recently worked on improving the performance of tree-based models compiled to pure SQL in Orbital, an open-source tool that converts Scikit-Learn pipelines into executable SQL.

In the latest release (0.3), we changed how decision trees are translated, reducing generated SQL size by \~7x (from \~2M to \~300k characters) and getting up to \~300% speedups in real database workloads.

This blog post goes into the technical details of what changed and why it matters if you care about running ML inference directly inside databases without shipping models or Python runtimes.

Blog post:
https://posit.co/blog/orbital-0-3-0/

Learn about Orbital:
https://posit-dev.github.io/orbital/

Happy to answer questions or discuss tradeoffs

/r/Python
https://redd.it/1pqnxm5

Читать полностью…

Python Daily

Django 6.0 Feature Friday: Template Partials!

It's Feature Friday again. This time featuring Template partials!

New in Django 6.0, this extension to Django's template language makes it easy to reuse fragments in templates: Great for cutting down the overhead of creating files for small pieces of isolated logic!

First, defining partials:

The new {% partialdef %} tag lets you do this. You give your template a unique name, and then anything you put inside will be the contents of the template.

{% partialdef user-info %}
<div id="user-info-{{ user.username }}">
<h3>{{ user.name }}</h3>
<p>{{ user.bio }}</p>
</div>
{% endpartialdef %}

Next up, rendering:

This can be done with the {% partial %} tag. Give it the name of a partial template and the contents of that template will be rendered at that location in the template. This works exactly like {% include %} would on a template file.

{% block content %}
<h2>Authors</h2>


/r/django
https://redd.it/1pqjl11

Читать полностью…

Python Daily

My Django-powered Quiz App running in Japanese (Hiragana) mode. Handling dynamic content & scoring logic. 🐍🇯🇵

/r/django
https://redd.it/1ppquhi

Читать полностью…

Python Daily

Friday Daily Thread: r/Python Meta and Free-Talk Fridays

# Weekly Thread: Meta Discussions and Free Talk Friday 🎙️

Welcome to Free Talk Friday on /r/Python! This is the place to discuss the r/Python community (meta discussions), Python news, projects, or anything else Python-related!

## How it Works:

1. Open Mic: Share your thoughts, questions, or anything you'd like related to Python or the community.
2. Community Pulse: Discuss what you feel is working well or what could be improved in the /r/python community.
3. News & Updates: Keep up-to-date with the latest in Python and share any news you find interesting.

## Guidelines:

All topics should be related to Python or the /r/python community.
Be respectful and follow Reddit's Code of Conduct.

## Example Topics:

1. New Python Release: What do you think about the new features in Python 3.11?
2. Community Events: Any Python meetups or webinars coming up?
3. Learning Resources: Found a great Python tutorial? Share it here!
4. Job Market: How has Python impacted your career?
5. Hot Takes: Got a controversial Python opinion? Let's hear it!
6. Community Ideas: Something you'd like to see us do? tell us.

Let's keep the conversation going. Happy discussing! 🌟

/r/Python
https://redd.it/1pq6egw

Читать полностью…

Python Daily

This new Django welcome page is really cool, had been a little while since I started a new project, nice surprise
https://i.imgur.com/mPBrIja.png

/r/django
https://redd.it/1pqzq7g

Читать полностью…

Python Daily

aiologic & culsans: a way to make multithreaded asyncio safe

Hello to everyone reading this. In this post, while it is still 2025, I will tell you about two of my libraries that you probably do not know about - aiologic & culsans. The irony here is that even though they are both over a year old, I keep coming across discussions in which my solutions are considered non-existent (at least, they are not mentioned, and the problems discussed remain unsolved). That is why I wrote this post - to introduce you to my libraries and the tasks they are able to solve, in order to try once again to make them more recognizable.

# What My Projects Do

Both libraries provide synchronization/communication primitives (such as locks, queues, capacity limiters) that are both async-aware and thread-aware/thread-safe, and can work in different environments within a single process. Whether it is regular threads, asyncio tasks, or even gevent greenlets. For example, with aiologic.Lock, you can synchronize access to a shared resource for different asyncio event loops running in different threads, without blocking the event loop (which may be relevant for free-threading):

#!/usr/bin/env python3

import asyncio

from concurrent.futures

/r/Python
https://redd.it/1psjsnu

Читать полностью…

Python Daily

How far into a learning project do you go

As a SWE student, it always feels like a race against my peers to land a job. Lately, though, web development has started to feel a bit boring for me and this new project, a custom text editor has been really fun and refreshing.

Each new feature I add exposes really interesting problems and design concepts that I will never learn with web dev, and there’s still so much I could implement or optimize. But I can’t help but wonder, how do you know when a project has taken too much of your time and effort? A text editor might not sound impressive on a resume, but the learning experience has been huge.

Would love to hear if anyone else has felt the same, or how you decide when to stick with a for fun learning project versus move on to something “more career-relevant.”

Here is the git hub: https://github.com/mihoagg/text\_editor
Any code review or tips are also much appreciated.


/r/Python
https://redd.it/1ps39bq

Читать полностью…

Python Daily

What's stopping us from having full static validation of Python code?

I have developed two mypy plugins for Python to help with static checks (mypy-pure and mypy-raise)

I was wondering, how far are we with providing such a high level of static checks for interpreted languages that almost all issues can be catch statically? Is there any work on that on any interpreted programming language, especially Python? What are the static tools that you are using in your Python projects?

/r/Python
https://redd.it/1ps7gs4

Читать полностью…

Python Daily

I built a desktop app with Python's "batteries included" - Tkinter, SQLite, and minor soldering

Hi all. I work in a mass spectrometry laboratory at a large hospital in Rome, Italy. We analyze drugs, drugs of abuse, and various substances. I'm also a programmer.

**What My Project Does**

Inventarium is a laboratory inventory management system. It tracks reagents, consumables, and supplies through the full lifecycle: Products → Packages (SKUs) → Batches (lots) → Labels (individual items with barcodes).

Features:

\- Color-coded stock levels (red/orange/green)

\- Expiration tracking with days countdown

\- Barcode scanning for quick unload

\- Purchase requests workflow

\- Statistics dashboard

\- Multi-language (IT/EN/ES)

**Target Audience**

Small laboratories, research facilities, or anyone needing to track consumables with expiration dates. It's a working tool we use daily - not a tutorial project.

**What makes it interesting**

I challenged myself to use only Python's "batteries included":

\- Tkinter + ttk (GUI)

\- SQLite (database)

\- configparser, datetime, os, sys...

External dependencies: just Pillow and python-barcode. No Electron, no web framework, no 500MB node_modules.

**Screenshots:**

\- :Dashboard: https://ibb.co/JF2vmbmC

\- Warehouse: https://ibb.co/HTSqHF91

**GitHub:** https://github.com/1966bc/inventarium

Happy to answer questions or hear criticism. Both are useful.

/r/Python
https://redd.it/1ps1ab5

Читать полностью…

Python Daily

I built a VS Code extension to run Django tests without typing python manage.py test

Hey everyone 👋

I built a VS Code extension that makes running Django tests easier directly from the editor.

Features:

1. Test Explorer tree
2. One-click Run / Debug
3. Watch mode
4. .env file support and many more


Links:

VS Code Marketplace: https://marketplace.visualstudio.com/items?itemName=ViseshAgarwal.django-test-manager

Open VSX: https://open-vsx.org/extension/viseshagarwal/django-test-manager

GitHub (open source): https://github.com/viseshagarwal/django-test-manager


It’s free and open source. I’d really appreciate feedback, feature suggestions, or PRs from the community 🙂

/r/django
https://redd.it/1prj20e

Читать полностью…

Python Daily

How a try-except stole hours of our debugging time, or why Django signals went silent.

/r/django
https://redd.it/1prb6ge

Читать полностью…

Python Daily

Monkey Patching is hell. So I built a Mixin/Harmony-style Runtime AST Injector for Python.

**What My Project Does**

"Universal Modloader" (UML) is a runtime patching framework that allows you to inject code, modify logic, and overhaul applications **without touching the original source code**.

Instead of fragile monkey-patching or rewriting entire files, UML parses the target's source code at runtime and injects code directly into the Abstract Syntax Tree (AST) before execution.

This allows you to:

* Intercept and modify local variables inside functions (which standard decorators cannot do).
* Add logic to the beginning (HEAD) or end (TAIL) of functions.
* Overwrite return values or arguments dynamically.

**Target Audience**

This project is intended for **Modders, Researchers, and Hobbyists**.

* **For Modders:** If you want to mod a Python game or tool but the source is hard to manage, this acts like a BepInEx/Harmony layer.
* **For Researchers:** Useful for chaos engineering, time-travel debugging, or analyzing internal states without altering files.

**WARNING:** By design, this enables Arbitrary Code Execution and modifies the interpreter's state. **It is NOT meant for production environments.** Do not use this to patch your company's production server unless you enjoy chaos.

**Comparison**

How does this differ from existing solutions?

* **VS Standard Decorators:** Decorators wrap functions but cannot access or modify *internal local variables* within the function scope. UML can.
* **VS Monkey Patching:** Standard monkey

/r/Python
https://redd.it/1prf4zd

Читать полностью…

Python Daily

Elasticsearch-Grade Search, Zero Infrastructure — Just Django + Postgres

Elasticsearch-Grade Search, Zero Infrastructure — Just Django + Postgres

Native BM 25 search with PostgreSQL extension.

https://github.com/FarhanAliRaza/django-hawkeye

pip install django-hawkeye

/r/django
https://redd.it/1pqxqbv

Читать полностью…

Python Daily

The offline geo-coder we all wanted

#### What is this project about
This is an offline, boundary-aware reverse geocoder in Python. It converts latitude–longitude coordinates into the correct administrative region (country, state, district) without using external APIs, avoiding costs, rate limits, and network dependency.

#### Comparison with existing alternatives
Most offline reverse geocoders rely only on nearest-neighbor searches and can fail near borders. This project validates actual polygon containment, prioritizing correctness over proximity.

#### How it works
A KD-Tree is used to quickly shortlist nearby administrative boundaries, followed by on-the-fly polygon enclosure validation. It supports both single-process and multiprocessing modes for small and large datasets.

#### Performance
Processes 10,000 coordinates in under 2 seconds, with an average validation time below 0.4 ms.

### Target audience
Anyone who needs to do geocoding

### Implementation
It was started as a toy implementation, turns out to be good on production too

The dataset covers 210+ countries with over 145,000 administrative boundaries.

Source code: https://github.com/SOORAJTS2001/gazetteer
Docs: https://gazetteer.readthedocs.io/en/stable
Feedback is welcome, especially on the given approach and edge cases

/r/Python
https://redd.it/1pr3bih

Читать полностью…

Python Daily

Saturday Daily Thread: Resource Request and Sharing! Daily Thread

# Weekly Thread: Resource Request and Sharing 📚

Stumbled upon a useful Python resource? Or are you looking for a guide on a specific topic? Welcome to the Resource Request and Sharing thread!

## How it Works:

1. Request: Can't find a resource on a particular topic? Ask here!
2. Share: Found something useful? Share it with the community.
3. Review: Give or get opinions on Python resources you've used.

## Guidelines:

Please include the type of resource (e.g., book, video, article) and the topic.
Always be respectful when reviewing someone else's shared resource.

## Example Shares:

1. Book: "Fluent Python" \- Great for understanding Pythonic idioms.
2. Video: Python Data Structures \- Excellent overview of Python's built-in data structures.
3. Article: Understanding Python Decorators \- A deep dive into decorators.

## Example Requests:

1. Looking for: Video tutorials on web scraping with Python.
2. Need: Book recommendations for Python machine learning.

Share the knowledge, enrich the community. Happy learning! 🌟

/r/Python
https://redd.it/1pr052n

Читать полностью…

Python Daily

TalkPython podcast's another GEM of Talk/Round-Table - Framework Creators- Maintainers

https://www.youtube.com/watch?v=cHmoClKu6qk

Jeff Triplett - Django | Carlton Gibson - Django RestFramework

Sebastian Ramirez - FASTApi
David Lord and Phil Jones - Flask
Yanik Nouvertne and Cody Fincher - LiteStar

Great to listen from creators, their views and insights about current state and direction of these Projects.

Things I got learn:

\- Upgrading Python might be easy way to solve some/many of your performance issues

\- Try out https://github.com/ultrajson/ultrajson or other libraries for serialization

\- Try out uvicorn or some other async alternative to gunicorn even if not going fully async(with Django)

\- Try out https://github.com/emmett-framework/granian

/r/django
https://redd.it/1pqthhz

Читать полностью…

Python Daily

D AAMAS 2026 result is out.

This year we received a total of 1343 submissions (after withdrawals and desk rejections) of which 338 were accepted as full papers, resulting in an acceptance rate of 25%. Another 205 submissions were accepted as extended abstracts for an overall (full papers + extended abstracts) acceptance rate of 40%.

They originally set Dec 22nd as the announcement date, but it seems like they decided to go earlier.

/r/MachineLearning
https://redd.it/1pqjtbe

Читать полностью…

Python Daily

"Advent of Refactoring" short video series
https://www.youtube.com/playlist?list=PLXkLI8HXcMo2r9Q5t27aIh-S4guP_I7z1

/r/django
https://redd.it/1pqfffe

Читать полностью…

Python Daily

Hosting options for MVP

Hi, I'm building a SaaS MVP that is completely bootstrapped. All I've used at work last 10 years is AWS and GCP. I don't think that suits me well at this stage. If the product actually takes off, I'd probably have to move it to AWS/GCP eventually. What are my hosting options today? I need Postgresql to run the app so hosted option would be nice but I guess I could run it as well on my own. Need this to be cheap and reliable. Scale is not an issue at the moment. Ideas?

/r/django
https://redd.it/1ppxotd

Читать полностью…
Subscribe to a channel