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
What are some of the most interesting Django projects you worked on?

What are some of the most interesting Django projects you worked on? Be they in a professional or personal capacity. Be mindful if using a professional example not to divulge anything considered sensitive.

/r/django
https://redd.it/1onfdra
Showcase trendspyg - Python library for Google Trends data (pytrends
replacement)

What My Project Does



trendspyg retrieves real-time Google Trends data with two approaches:



RSS Feed (0.2s) - Fast trends with news articles, images, and sources

CSV Export (10s) - 480 trends with filtering (time periods, categories,

regions)



pip install trendspyg



from trendspyg import download_google_trends_rss



\# Get trends with news context in <1 second

trends = download_google_trends_rss('US')



print(f"{trends[0\]['trend'\]}: {trends[0\]['news_articles'\][0\]['headline'\]}")

\# Output: "xrp: XRP Price Faces Death Cross Pattern"



Key features:

\- 📰 News articles (3-5 per trend) with sources

\- 📸 Images with attribution

\- 🌍 114 countries + 51 US states

\- 📊 4 output formats (dict, DataFrame, JSON, CSV)

\- 188,000+ configuration options



\---

Target Audience



Production-ready for:



\- Data scientists: Multiple output formats, 24 automated tests, 92% RSS

coverage

\- Journalists: 0.2s response time for breaking news validation with credible

sources

\- SEO/Marketing: Free alternative saving $300-1,500/month vs commercial APIs

\- Researchers: Mixed-methods ready (RSS = qualitative, CSV = quantitative)



Stability: v0.2.0, tested on Python 3.8-3.12, CI/CD pipeline active



\---

Comparison



vs. pytrends (archived April 2025)





/r/Python
https://redd.it/1oo8fka
CoreSpecViewer: An open-source hyperspectral core scanning platform

# [](https://www.reddit.com/r/Python/?f=flair_name%3A%22Showcase%22)[CoreSpecViewer](https://github.com/Russjas/CoreSpecViewer/tree/main)

This is my first serious python repo, where I have actually built something rather than just "learn to code" projects.

It is pretty niche, a gui for hyperspectral core scanning workflows, but I am pretty pleased with it.

I hope that I have set it up in such a way that I can add pages with extra functionality, additional instrument manufacturers.

If anyone is nerdy enough to want to play with it free data can be downloaded from:

Happy to recieve all comments and criticisms, particularly if anyone does try it on data and breaks it!

**What my project does:**

This is a platform for opening raw hyperspectral core scanning data, processing and performing necessary corrections and processing for interpretation. It also handles all loading and saving of data, including products

**Target Audience**

Principally geologist working with drill core, this data is becoming more and more available, but there is limited choice in commercial applications and most open-souce solution require command line or scripting

**Comparison**
This is similar to many open-source python libraries, and uses them extensively, but is the only desktop based GUI platform

/r/Python
https://redd.it/1oo8lpf
How often does Python allocate?

Recently a tweet blew up that was along the lines of 'I will never forgive Rust for making me think to myself “I wonder if this is allocating” whenever I’m writing Python now' to which almost everyone jokingly responded with "it's Python, of course it's allocating"

I wanted to see how true this was, so I did some digging into the CPython source and wrote a blog post about my findings, I focused specifically on allocations of the `PyLongObject` struct which is the object that is created for every integer.

I noticed some interesting things:

1. There were a lot of allocations
2. CPython was actually reusing a lot of memory from a freelist
3. Even if it _did_ allocate, the underlying memory allocator was a pool allocator backed by an arena, meaning there were actually very few calls to the OS to reserve memory

Feel free to check out the blog post and let me know your thoughts!

/r/Python
https://redd.it/1ooe0g4
Type safe, coroutine based, purely functional algebraic effects in Python.

Hi gang. I'm a huge statically typed functional programming fan, and I have been working on a functional effect system for python for some years in multiple different projects.

With the latest release of my project https://github.com/suned/stateless, I've added direct integration with asyncio, which has been a major goal since I first started the project. Happy to take feedback and questions. Also, let me know if you want to try it out, either professionally or in your own projects!

What My Project Does

Enables type safe, functional effects in python, without monads.

Target Audience

Functional Python Enthusiasts.

/r/Python
https://redd.it/1oolq4o
Real time execution?

Hello my wonderful reddit pythonists!

I have for you a question:
Is there any existing solution that effectively achieve real-time output of every line as I type?

Some background:
I am a mechanical engineer (well a student, final year) and often do many different calculations and modelling of systems in software. I find that "calculators" often don't quite hit the level of flexibility id like to see; think Qalculate for example. Essentially, what I desire is a calculator where I can define variables, write equations, display plots, etc and be able to change a earlier variable having everything below it update in real-time.
Note: I am NOT new to python/programming. Talk dirty (technical) to me if you must.

What I have already explored:
Jupyter - Cell based, fine for some calculations where there may be a long running step (think meshing or heavy iteration). Doesn't output all results, only the last without a bunch of print() statements. Requires re-running all cells if a early variable is updated.

Marimo - Closer then Jupyter. Still cell based but updates dynamically. This is pretty close but still not there as it only seems to update dynamically with Marimo ui elements (like scroll bars)

/r/Python
https://redd.it/1oolpva
Weak Incentives (Py3.12+) — typed, stdlib‑only agent toolkit

What My Project Does
Weak Incentives is a lean, stdlib‑first runtime for side‑effect‑free background agents in Python. It composes dataclass‑backed prompt trees that render deterministic Markdown, parses strict JSON, and records plans/tool calls/staged edits in a session ledger with reducers, rollback, a sandboxed VFS, planning tools, and optional Python‑eval (via asteval). Adapters (OpenAI/LiteLLM) are optional and add structured output + tool orchestration.

Target Audience
Python developers building LLM agents or automation who want reproducibility/auditability, typed I/O, and minimal dependencies (Python 3.12+).

Comparison
Most frameworks emphasize graph schedulers/optimizers or pull in heavy deps. Weak Incentives centers deterministic prompt composition and fail‑closed structured outputs, with a built‑in session/event model (reducers, rollback) and sandboxed VFS/planning; it works provider‑free for rendering/state and adds adapters only when you evaluate.

Source Code:
https://github.com/weakincentives/weakincentives

/r/Python
https://redd.it/1oohs41
pyro-mysql v0.1.8: a fast MySQL client library

What My Project Does
pyro-mysql is a fast sync/async MySQL library backed by Rust
Repo
https://github.com/elbaro/pyro-mysql/
Bench
https://github.com/elbaro/pyro-mysql/blob/main/BENCHMARK.md
For small sync SELECT, `pyro-mysql` is 40% faster than `mysqlclient`
For small async SELECT, pyro-mysql is 30% faster than aiomysql
For large SELECT, `pyro-mysql (async)` is x3 faster than `aiomysql/asyncmy`
An experimental wtx backend (not included in v0.1.8) is x5 faster than aiomysql.
For sync INSERT, `pyro-mysql` is 50% faster than `mysqlclient`
For async INSERT, pyro-mysql is 20% slower than aiomysql
Target Audience: the library aims to be production-ready
Comparison: see the previous post

v0.1.8 adds the sqlalchemy support with the following dialects:

mysql+pyro\_mysql://
mysql+pyro_mysql_async://
mariadb+pyro\_mysql://
mariadb+pyro_mysql_async://

It is tested against related test suites from the sqlalchemy repo.

/r/Python
https://redd.it/1oo4uuk
Optimizing filtered vector queries from tens of seconds to single-digit milliseconds in PostgreSQL

We actively use pgvector in a production setting for maintaining and querying HNSW vector indexes used to power our recommendation algorithms. A couple of weeks ago, however, as we were adding many more candidates into our database, we suddenly noticed our query times increasing linearly with the number of profiles, which turned out to be a result of incorrectly structured and overly complicated SQL queries.

Turns out that I hadn't fully internalized how filtering vector queries really worked. I knew vector indexes were fundamentally different from B-trees, hash maps, GIN indexes, etc., but I had not understood that they were essentially incompatible with more standard filtering approaches in the way that they are typically executed.

I searched through google until page 10 and beyond with various different searches, but struggled to find thorough examples addressing the issues I was facing in real production scenarios that I could use to ground my expectations and guide my implementation.

Now, I wrote a blog post about some of the best practices I learned for filtering vector queries using pgvector with PostgreSQL based on all the information I could find, thoroughly tried and tested, and currently in deployed in production use. In it I try to provide:

\-

/r/Python
https://redd.it/1ooy326
What is the point of CSRF for form validation?

Hello,

I am currently in the process of building a small app aiming to localy train small AI models. I keep seeing on the internet that desactivating the CSRF in forms is super dangerous, but is it if the app will be run localy only, and not have "sensitive" (ie account management) informations uploaded?

Right now I have forms to upload a project name and training files, I don't think I need CSRF for these?

Thanks in advance

/r/flask
https://redd.it/1oo94xx
Free Introductory Python Book (amongst others)

I recently discovered the wonderful collection of free textbooks made available by the openstax organisation (https://openstax.org/). There are many books available covering a wide range of disciplines but there’s one in particular that may be of interest to redditors here, namely Introduction to Python Programming: https://openstax.org/details/books/introduction-python-programming

Another notable example is Principles of Data Science: https://openstax.org/details/books/principles-data-science

There are many others including texts on mathematics and computer science.

/r/Python
https://redd.it/1op1ghd
First event Django Day India is here - November 8, 2025

We’re excited to invite you to Django Day India 2025, the biggest Django community event in the country!

The schedule is now live, featuring talks on Django, Python, architecture, scalability, and open source from some of the most active contributors in the ecosystem.

Keynote Speakers:

Thibaud Colas — President, Django Software Foundation & Tech Lead at Torchbox

Sarah Abderemane — Vice President, Django Software Foundation & Software Engineer at Kraken Tech

Whether you’re building with Django daily or just passionate about web development, this is a great chance to learn, connect, and be part of India’s growing Django community

Tickets are closing tomorrow , so grab yours before they sell out!

tickets: https://konfhub.com/djangoday-india-2025

Official website: djangoday.in

Come for the code, stay for the community!

/r/django
https://redd.it/1op14p2
Looking for a Mentor

Hello Everyone,

I started learning Django today, I need a mentor, who can guide me in this Journey.

TIA.

/r/djangolearning
https://redd.it/1ooqqdb
Can anyone suggest me resources to learn django, need to make an ai chat ap with semantic search on chats



/r/djangolearning
https://redd.it/1oms8o8
Flask-Compress 1.22 released

2 releases were made recently to add support for streaming responses.
No more buffering the entire response to compress it, it now happens on the fly

/r/flask
https://redd.it/1op4w9f
Create a Flask app-website

Hi I am learning python and I would like to create a website using Flask like a personal page. How does it work? Do you know useful materials? How do I buy a domain? Should I buy it?

/r/flask
https://redd.it/1ondv3r
Best practice for Django PKs in 2025 - Auto-Incrementing or UUIDField?

I am wondering what the consensus is for a public website and if you should use Django's default auto-incrementing IDs or switch to using UUID4 as the primary key.

I've read arguments of both sides and am still not able to draw a conclusion.

I'm slowly settling on keep the PK as the Django auto-incrementing and adding separate UUID field that is a generated UUID4 value.

Thoughts?

import uuid
from django.db import models
from nanoid import generate

class Product(models.Model):
# Keep the default original Django auto-incrementing PK

# uuid4 for internal use and for distributed databases to work together
uuid = models.UUIDField(
default=uuid.uuid4,
editable=False,
db_index=True,
)

#

/r/django
https://redd.it/1opi4xl
Thursday Daily Thread: Python Careers, Courses, and Furthering Education!

# Weekly Thread: Professional Use, Jobs, and Education 🏢

Welcome to this week's discussion on Python in the professional world! This is your spot to talk about job hunting, career growth, and educational resources in Python. Please note, this thread is not for recruitment.

---

## How it Works:

1. Career Talk: Discuss using Python in your job, or the job market for Python roles.
2. Education Q&A: Ask or answer questions about Python courses, certifications, and educational resources.
3. Workplace Chat: Share your experiences, challenges, or success stories about using Python professionally.

---

## Guidelines:

- This thread is not for recruitment. For job postings, please see r/PythonJobs or the recruitment thread in the sidebar.
- Keep discussions relevant to Python in the professional and educational context.

---

## Example Topics:

1. Career Paths: What kinds of roles are out there for Python developers?
2. Certifications: Are Python certifications worth it?
3. Course Recommendations: Any good advanced Python courses to recommend?
4. Workplace Tools: What Python libraries are indispensable in your professional work?
5. Interview Tips: What types of Python questions are commonly asked in interviews?

---

Let's help each other grow in our careers and education. Happy discussing! 🌟

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