Python Daily
2.57K subscribers
1.48K photos
53 videos
2 files
38.9K links
Daily Python News
Question, Tips and Tricks, Best Practices on Python Programming Language
Find more reddit channels over at @r_channels
Download Telegram
Bobtail - A WSGI Application Framework

I'm just showcasing a project that I have been working on slowly for some time.

https://github.com/joegasewicz/bobtail

# What My Projects Does

It's called Bobtail & it's a WSGI application framework that is inspired by Spring Boot.

It isn't production ready but it is ready to try out & use for hobby projects (I actually now run this in production for a few of my own projects).

# Target Audience

Anyone coming from the Java language or enterprise OOP environments.

# Comparison

Spring Boot obviously but also Tornado, which uses class based routes.



I would be grateful for your feedback, Thanks

#





/r/Python
https://redd.it/1p3c9gi
What is the best Django course today (beginner → advanced)? Books, video, blog… anything.

I’m getting back into learning Django after stopping for a while, and I want to restart with modern learning resources that match the current real-world tech stack (Django 5.x, DRF, async, AI integration, modern tooling, etc.).

I’m looking for recommendations for the best learning path from beginner to advanced, including:

Online courses
YouTube tutorials
Books
Blogs/documentation
Project-based learning resources
Anything that helped you go from “I know nothing” to job-ready

Ideally, I want resources that focus on production-level skills, not just toy apps.

If you’ve learned Django recently (2023–2025), what resources made the biggest difference for you?

Thanks in advance!

/r/django
https://redd.it/1p2tgqx
CAN SOME ONE EXPLAIN THIS?

https://programmers-haven.myshopify.com/
IM CONFUSED ABOUT WHAT THIS GUY IS TRYING TO SELL. IS THIS LEGIT?

/r/Python
https://redd.it/1p3ntd8
Need help to make small changes

Can any good person help me with my class project? I will fail if i don't do it.need to get it done asaf I need to make some changes all instructions and how to do it are written. But still i don't know much code. The stack used is python flask.

About the software

It's a simple website which has login,admin,user, posting feature. The main goal is to make it free from any cyber vulnerability. Now the software has some vulnerability pointed out by another team. They have given us a report on it and what we should do. We need to make some changes implement 2-3 basic authentication features.


Please help 🙏😭

/r/flask
https://redd.it/1p3ga4p
Is there any way to simulate a slow network connection on localhost?

When I build a Flask app and test it on localhost, can I simulate a slow connection? (For example, by a python module that allows me to determine the speed of sending data from the Flask server)

/r/flask
https://redd.it/1p3pypy
Avenv - A Minimal Virtual Environment Script for Python

# What My Project Does

This is a minimal Linux-compatible script that streamlines Python virtual environment management. It creates each environment inside a dedicated directory in your home folder and sources the activate script directly. No wrappers, no frameworks, no extra abstractions.

Workflow example:

$ avenv -m newvenv
$ source avenv new
venv

# Target Audience

Developers who want a lightweight, zero-overhead method for managing Python virtual environments. Intended for personal workflows and simple development setups, not complex production pipelines.

# Comparison

Compared to tools like virtualenvwrapper, pipenv, or poetry, this script adds no metadata, no new workflow concepts, and no dependency management. It is a thin wrapper around python -m venv that provides a predictable, minimal interface focused solely on creating and activating environments.

# Background

I built this script for my own use several years ago, and it remains the most efficient workflow I’ve used for handling Python virtual environments.

Link: https://github.com/begbaj/avenv/

/r/Python
https://redd.it/1p3rxb6
I’m building a Python-native frontend framework that runs in the browser (Evolve)

I’m currently building a personal project called Evolve \- a Python-native frontend framework using WebAssembly and a minimal JavaScript kernel to manage DOM operations.

The idea: write UI logic in Python, run it in the browser, with a reactive system (no virtual DOM).

Still early stage, - I’ll be posting progress, architecture, and demos soon.

Would love to know: would you try a Python-first frontend framework?

/r/Python
https://redd.it/1p3p00u
If one python selling point is data-science and friends, why it discourages map and filter?

… and lambda functions have such a weird syntax and reduce is hidden in functools, etc.? Their usage is quite natural for people working with mathematics.

/r/Python
https://redd.it/1p3mjlc
How do you implement customizable document templates (like QuickBooks)


I’m building an invoicing module in Django, and right now all my document templates (Quotation, POS Receipt, etc.) are hard-coded as Django HTML templates.

I want to redesign this so that:

- Multiple templates exist per document type

(e.g., Standard Invoice, Minimalist, POS Receipt, Japanese Style, etc.)

- Users can choose which template their organisation uses

(at setup time or inside settings)

- Users can customize parts of the template

(override header, colors, messages, table layout, footer text… basically inject custom HTML blocks)

- Ability to preview templates

(ideally show a small thumbnail preview)

/r/django
https://redd.it/1p43aga
Onlymaps, a Python micro-ORM

Hello everyone! For the past two months I've been working on a Python micro-ORM, which I just published and I wanted to share with you: https://github.com/manoss96/onlymaps

Any questions/suggestions are welcome!

## What My Projects Does

A micro-ORM is a term used for libraries that do not provide the full set of features a typical ORM does, such as an OOP-based API, lazy loading, database migrations, etc... Instead, it lets you interact with a database via raw SQL, while it handles mapping the SQL query results to in-memory objects.

Onlymaps does just that by using Pydantic underneath. On top of that, it offers:

- A minimal API for both sync and async query execution.
- Support for all major relational databases.
- Thread-safe connections and connection pools.

## Target Audience

Anyone can use this library, be it for a simple Python script that only needs to fetch some rows from a database, or an ASGI webserver that needs an async connection pool to make multiple requests concurrently.

## Comparison

This project provides a simpler alternative to typical full-feature ORMs which seem to dominate the Python ORM landscape, such as SQLAlchemy and Django ORM.

/r/Python
https://redd.it/1p3us1n
Python - Numerical Evidence - max PSLQ to 4000 Digits for Clay Millennium Problem (Hodge Conjecture)

* **What My Project Does**

The Zero-ology team recently tackled a high-precision computational challenge at the intersection of HPC, algorithmic engineering, and complex algebraic geometry. We developed the **Grand Constant Aggregator (GCA)** framework -- a fully reproducible computational tool designed to generate **numerical evidence** for the **Hodge Conjecture** on **K3 surfaces** ran in a Python script.

The core challenge is establishing formal certificates of numerical linear independence at an unprecedented scale. GCA systematically compares known transcendental periods against a canonically generated set of ρ real numbers, called the **Grand Constants**, for K3 surfaces of Picard rank ρ ∈ {1,10,16,18,20}.

The GCA Framework's core thesis is a computationally driven attempt to provide overwhelming numerical support for the Hodge Conjecture, specifically for five chosen families of K3 surfaces (Picard ranks 1, 10, 16, 18, 20).

The primary mechanism is a test for linear independence using the PSLQ algorithm.

The Target Relation: The standard Hodge Conjecture requires showing that the transcendental period $(\\omega)$ of a cycle is linearly dependent over $\\mathbb{Q}$ (rational numbers) on the periods of the *actual* algebraic cycles ($\\alpha\_j$).

The GCA Substitution: The framework substitutes the unknown periods of the algebraic cycles ($\\alpha\_j$) with a set of synthetically generated, highly-reproducible, transcendental numbers, called the **Grand Constants** ($\\mathcal{C}\_j$), produced by the **Grand Constant Aggregator (GCA)** formula.

The Test: The framework tests for an integer linear dependence

/r/Python
https://redd.it/1p44cr8
Built free interview prep repo for AI agents, tool-calling and best production-grade practices

I spent the last few weeks building the tool-calling guide I couldn’t find anywhere: a full, working, production-oriented resource for tool-calling.

What’s inside:

66 agent interview questions with detailed answers
Security + production patterns (validation, sandboxing, retries, circuit breaker, cost tracking)
Complete MCP spec breakdown (practical, not theoretical)
Fully working MCP server (6 tools, resources, JSON-RPC over STDIO, clean architecture)
MCP vs UTCP with real examples (file server + weather API)
9 runnable Python examples (ReAct, planner-executor, multi-tool, streaming, error handling, metrics)

Everything compiles, everything runs, and it's all MIT licensed.

GitHub: https://github.com/edujuan/tool-calling-interview-prep

Hope you some of you find this as helpful as I have!

/r/Python
https://redd.it/1p469il
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/1p4851a
Why do devs prefer / use PyInstaller over Nuitka?

I've always wondered why people use PyInstaller over Nuitka?

I mean besides the fact that some old integrations rely on it, or that most tutorials mention PyInstaller; why is it still used?

For MOST use cases in Python; Nuitka would be better since it actually compiles code to raw machine (C) code instead of it being a glorified [.zip\] file and a Python interpreter in it.


Yet almost everyone uses PyInstaller, why?


Is it simplicity, laziness, or people who refuse to switch just because "it works"? Or does PyInstaller (same applies to cx_Freeze and py2exe) have an advantage compared to Nuitka?



At the end of the day you can use whatever you want; who am I to care for that? But I am curious why PyInstaller is still more used when there's (imo) a clearly better option on the table.

/r/Python
https://redd.it/1p46onk
[P] Interactive Advanced Llama Logit Lens

/r/MachineLearning
https://redd.it/1p4akjr
What could I have done better here?

Hi, I'm pretty new to Python, and actual scripting in general, and I just wanted to ask if I could have done anything better here. Any critiques?

import time
import colorama
from colorama import Fore, Style

color = 'WHITE'
colorvar2 = 'WHITE'

#Reset colors
print(Style.RESETALL)

#Get current directory (for debugging)
#print(os.getcwd())

#Startup message
print("Welcome to the ASCII art reader. Please set the path to your ASCII art below.")

#Bold text
print(Style.BRIGHT)

#User-defined file path
path = input(
Fore.BLUE + 'Please input the file path to your ASCII art: ')
color = input('Please input your desired color (default: white): ' + Style.RESET
ALL)

#If no ASCII art path specified
if not path:
print(Fore.RED +

/r/Python
https://redd.it/1p4ffmh
Air gapped app

How does one prepare an air gapped app version of the Django project ?

are there tools to wrap frontend and backend in Docker and orchestrate this on a cloud ?

/r/django
https://redd.it/1p4fs71
Python Mutable Defaults or the Second Thing I Hate Most About Python

TLDR: Don’t use default values for your annotated class attributes unless you explicitly state they are a ClassVar so you know what you’re doing. Unless your working with Pydantic models. It creates deep copies of the models.
I also created a demo flake8 linter for it: https://github.com/akhal3d96/flake8-explicitclassvar/ Please check it out and let me know what you think.

I run into a very annoying bug and it turns out it was Python quirky way of defining instance and class variables in the class body. I documented these edge cases here: https://blog.ahmedayoub.com/posts/python-mutable-defaults/

But basically this sums it up:

class Members:
number: int = 0

class FooBar:
members: Members = Members()


A = FooBar()
B = FooBar()

A.members.number = 1
B.members.number = 2

# What you expect:
print(A.members.number) # 1
print(B.members.number) # 2




/r/Python
https://redd.it/1p469fk
The Labyrinth of Tech Careers: The Significance of Your Developer Portal
https://mappen.ai/blog/the-labyrinth-of-tech-careers-the-significance-of-your-developer-portal

/r/django
https://redd.it/1p4jg3x
I built a backend-only data analysis tool using Django.

I have focused heavily on security, ensuring the tool is safe against file upload vulnerabilities and common threats like XSS.

Feel free to review or audit the code. If you find any security flaws or bugs, please let me know in the comments. The project is open source, so you are welcome to fork and modify it. I would appreciate any feedback or suggestions to help me improve my future projects.

Repository Link: https://github.com/saa-999/djangolytics



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