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
The Complete Flask Rest Api Python Guide

Hey, I have made a guide about building rest apis in python with flask, it starts from the basics and covers the crud operations.

In the guide we use Sql with Postgres, and threading is also involved.

I would love to share it in case any one is interested.

The link is: https://youtu.be/QYhxntIScxI?si=6VDCriYEDBjOYzc4

/r/Python
https://redd.it/1k3szln
Computer algebra pkg that handles vector expressions

Do any of the open source computer algebra pkgs handle vector expressions vs instances of specific vectors?..so AxBxC vs [a1,a2,a3\]x[b1, b2, b3\]...so something like this. I've look in sympy, and sagemath..but haven't been able to find anything...

https://preview.redd.it/312t2i8d50we1.png?width=501&format=png&auto=webp&s=7fc4e77301e54e32b8a7394ab4b0f0f31b8e653f




/r/IPython
https://redd.it/1k3o4z2
How do you manage Django Migration in a team

Hello everyone,

How do you manage migration files in your Django project in multiple developers are working in it? How do you manage localcopy, staging copy, pre-prod and production copy of migration files? What is practice do you follow for smooth and streamlined collaborative development?

Thanks in advance.

/r/django
https://redd.it/1k3rdj9
R Unifying Flow Matching and Energy-Based Models for Generative Modeling

Far from the data manifold, samples move along curl-free, optimal transport paths from noise to data. As they approach the data manifold, an entropic energy term guides the system into a Boltzmann equilibrium distribution, explicitly capturing the underlying likelihood structure of the data. We parameterize this dynamic with a single time-independent scalar field, which serves as both a powerful generator and a flexible prior for effective regularization of inverse problems.

Disclaimer: I am one of the authors.

Preprint:
https://arxiv.org/abs/2504.10612

/r/MachineLearning
https://redd.it/1k3l87t
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/1k404cv
Looking for the best structured paid course to master Django — any recommendations?

Hey everyone! I'm looking for a well-structured course that can teach me Django from beginner to advanced level. Any recommendations?
and I will go through the docks but right now I need a structured course that can teach me backend in django.



/r/django
https://redd.it/1k3mfbp
I made a django app to automate video processing & streaming

Hey dear community!

I have been part of you for many years and I am hobbyist django developer originally working as a data engineer.

Recently I shared here that I just made an api with django to automate video processing. This time I made a django app which you can install to your project and just include pretty cool features builtin.

And if you process less than 10gb < month, basically everything is free - forever.

So what it does?

\- If you have a django project and if you are storing your media files on S3 (aws, hetzner or any s3) you are probably aware that it charges you by storage and bandwidth. And also for big files usually the experience for the people streaming it is not very good because it is slow.

The app uses the contentor API and basically after you set it up, it automatically compress your content into web optimized format, size. Creates different resolutions (based on your settings). It also replaces the original file.

It also have a pretty cool feature for uploading large files, which is chunk upload. It is also included.

I really enjoyed building this, I hope you would also enjoy

/r/django
https://redd.it/1k3skn1
glyphx: A Better Alternative to matplotlib.pyplot – Fully SVG-Based and Interactive

What My Project Does

glyphx is a new plotting library that aims to replace matplotlib.pyplot for many use cases
— offering:

• SVG-first rendering: All plots are vector-based and export beautifully.

• Interactive hover tooltips, legends, export buttons, pan/zoom controls.

• Auto-display in Jupyter, CLI, and IDE — no fig.show() needed.

• Colorblind-safe modes, themes, and responsive HTML output.

• Clean default styling, without needing rcParams or tweaking.

• High-level plot() API, with built-in support for:

• line, bar, scatter, pie, donut, histogram, box, heatmap, violin, swarm, count, lmplot, jointplot, pairplot, and more.



Target Audience

• Data scientists and analysts who want fast, beautiful, and responsive plots

• Jupyter users who are tired of matplotlib styling or plt.show() quirks

• Python devs building dashboards or exports without JavaScript

• Anyone who wants a modern replacement for matplotlib.pyplot

Comparison to Existing Tools

• vs matplotlib.pyplot: No boilerplate, no plt.figure(), no fig.tight_layout() — just one line and you’re done.

• vs seaborn: Includes familiar chart types but with better interactivity and export.

• vs plotly / bokeh: No JavaScript required. Outputs are pure SVG+HTML, lightweight and shareable. Yes.

• vs matplotlib + Cairo: glyphx supports native SVG export, plus optional PNG/JPG via cairosvg.



Repo

GitHub: [github.com/kjkoeller/glyphx](https://github.com/kjkoeller/glyphx)

PyPI: [pypi.org/project/glyphx](https://pypi.org/project/glyphx)



Happy to get feedback or ideas — especially if you’ve tried building matplotlib replacements before.

Edit:
Hyperlink URLs

/r/Python
https://redd.it/1k3yoq5
OC Anirra, a self-hosted, anime watchlist, search, and recommendations app

[Release\] Anirra – Self-hosted Anime Watchlist, Search, and Recommendation App with Sonarr/Radarr Integration

I’ve just released Anirra, a fully self-hosted anime watchlist and recommendation app. It's designed for anime fans who want control over their data and tight integration with their media server setup.

The frontend is writen in Nextjs, and the backend writen completely in Python using FastAPI.

# 🔧 What my project does

Watchlist Management – Organize anime into categories: planning, watching, or completed.
Search – Find anime by title or tags using a built-in offline database.
Recommendations – Get suggestions based on your watch history.
Sonarr/Radarr Integration – Add anime or movies directly to your media server from within the app.

# Target Audience

Users looking to keep their data private, and easily add new anime to their media servers.

# Comparison to Existing Tools

MAL, and AniList do exist, but you expose your data to them and they don't hook into your own media servers for ease of use.

# 🔜 Coming Soon

Mobile-friendly UI
Watchlist rating and smarter recommendations
Jellyfin integration for tracking watch progress
Manga tracking and recommendations based off of read manga

Repo: https://github.com/jaypyles/anirra

Let me know if you run into issues or have feature suggestions. Feedback is welcome, as well as pull requests and bug reports.

/r/Python
https://redd.it/1k3zzph
How good is flask(gunicorn) for production

I want to write a simple web app that serves as a form, it’ll accept sensitive personal info from the recipients. Issue is i’ve written flask for mostly personal websites and chatbots nothing too serious. Can flask scale and is it secure? or do I have to learn django?

I am aware that the web server provided with flask isn’t supposed to be used.

/r/flask
https://redd.it/1k3w02f
Settings.py for DRF

RESTFRAMEWORK = {
    "DEFAULT
AUTHENTICATIONCLASSES": (
        "rest
frameworksimplejwt.authentication.JWTAuthentication",
    ),
    "DEFAULT
PERMISSIONCLASSES": [
        "rest
framework.permissions.IsAuthenticated",
    ],
}

SIMPLEJWT = {
    "ACCESS
TOKENLIFETIME": timedelta(
minutes
=30),
    "REFRESH
TOKENLIFETIME": timedelta(
days
=1),
}


I just finished watching TechWithTim's django and react tutorial and am trying to work on my own project. More specifically for these two things above, what does the REST\
FRAMEWORK variable do, and is the SIMPLE_JWT variable how you usually set the lifetimes for the tokens. Thank you!

/r/django
https://redd.it/1k4ansn
Why was multithreading faster than multiprocessing?

I recently wrote a small snippet to read a file using multithreading as well as multiprocessing. I noticed that time taken to read the file using multithreading was less compared to multiprocessing. file was around 2 gb

Multithreading code

import time
import threading

def processchunk(chunk):
# Simulate processing the chunk (replace with your actual logic)
# time.sleep(0.01) # Add a small delay to simulate work
print(chunk) # Or your actual chunk processing

def read
largefilethreaded(filepath, chunksize=2000):
try:
with open(filepath, 'rb') as file:
threads = []
while True:
chunk =
file.read(chunksize)


/r/Python
https://redd.it/1k4cwbm
How do you manage Django Migration in a team

Hello everyone,

How do you manage migration files in your Django project in multiple developers are working in it?

How do you manage local copy, staging copy, pre-prod and production copy of migration files? What is practice do you follow for smooth and streamlined collaborative development?

Thanks in advance.

/r/djangolearning
https://redd.it/1k43p9z
Made a Python Mod That Forces You to Be Happy in League of Legends 😁

Figured some Python enthusiasts also play League, so I’m sharing this in case anyone (probably some masochist) wants to give it a shot :p

What My Project Does

It uses computer vision to detect if you're smiling in real time while playing League.
If you're not smiling enough… it kills the League process. Yep.


Target Audience

Just a dumb toy project for fun. Nothing serious — just wanted to bring some joy (or despair) to the Rift.


Comparison

Probably not. It’s super specific and a little cursed, so I’m guessing it’s the first of its kind.


Code

👉 Github

Stay cool, and good luck with your own weird projects 😎 Everything is a chance to improve your skills!

/r/Python
https://redd.it/1k4kx23
Anyone still using twisted in 2025.

are there companies still using python twisted library and what benefits it has over others . Does is still makes sense to use twisted for backend game servers?
https://github.com/twisted/twisted

/r/Python
https://redd.it/1k4en05
Personal Project. Preparation questions generator for CompTIA Security+

Hi guys,

I have been developing a tool with Flask to generate prep questions for Security+ for my own preparation, but it actually turned out so well so I decided to share it with people. Please have a look: https://github.com/ilya-smut/blue-book

It uses Google Gemini to generate questions. The questions are actually of high quality, and you can even specify the topic you want to focus on. It also checks your answers and tells you what you got right or wrong. I attach some screenshots.

Please let me know what you think about and feel free to use it for your own preparation or contribute to the project!

P.S. I know we are talking about Cyber Security here, so just wanted to clarify one thing. Gemini access token is saved locally on your machine in user home directory. You can see how it's done in save_config() function in the code.

You can generate 2, 5, 10, or 20 questions. You can change \/ add more values in code if you want to

Example with a topic to focus on specified

(https://preview.redd.it/tool-to-generate-comptia-security-preparation-questions-v0-xb1z3gc3a9we1.png?width=1722&format=png&auto=webp&s=a015c58ceb692c5cfaaa733d93df8cef04032d25)

Example of questions generated without topic specified

(https://preview.redd.it/tool-to-generate-comptia-security-preparation-questions-v0-3lhuqrcea9we1.png?width=1412&format=png&auto=webp&s=e1f4a9ffe7dcc221e0e8e4522d8076a2c1ab2e60)

Answers check

(https://preview.redd.it/tool-to-generate-comptia-security-preparation-questions-v0-y8ei0pysa9we1.png?width=1220&format=png&auto=webp&s=f9c9e2357a3aa363428921e407b2e0e59b5d8993)

/r/flask
https://redd.it/1k4pjsc
D What are the current research gaps on GNN?

I would like to know your suggestions since I’m very interested in GNN and also their explainability aspects, however I noticed the huge amount of literature in the last years and I don’t want to lose focus in the new aspects of potential research.

/r/MachineLearning
https://redd.it/1k4oxgo
Tuesday Daily Thread: Advanced questions

# Weekly Wednesday Thread: Advanced Questions 🐍

Dive deep into Python with our Advanced Questions thread! This space is reserved for questions about more advanced Python topics, frameworks, and best practices.

## How it Works:

1. **Ask Away**: Post your advanced Python questions here.
2. **Expert Insights**: Get answers from experienced developers.
3. **Resource Pool**: Share or discover tutorials, articles, and tips.

## Guidelines:

* This thread is for **advanced questions only**. Beginner questions are welcome in our [Daily Beginner Thread](#daily-beginner-thread-link) every Thursday.
* Questions that are not advanced may be removed and redirected to the appropriate thread.

## Recommended Resources:

* If you don't receive a response, consider exploring r/LearnPython or join the [Python Discord Server](https://discord.gg/python) for quicker assistance.

## Example Questions:

1. **How can you implement a custom memory allocator in Python?**
2. **What are the best practices for optimizing Cython code for heavy numerical computations?**
3. **How do you set up a multi-threaded architecture using Python's Global Interpreter Lock (GIL)?**
4. **Can you explain the intricacies of metaclasses and how they influence object-oriented design in Python?**
5. **How would you go about implementing a distributed task queue using Celery and RabbitMQ?**
6. **What are some advanced use-cases for Python's decorators?**
7. **How can you achieve real-time data streaming in Python with WebSockets?**
8. **What are the

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