Daily Python News Question, Tips and Tricks, Best Practices on Python Programming Language Find more reddit channels over at @r_channels
What’s your approach to organizing Python projects for readability and scalability?
I'm working on improving my Python project structure for better readability and scalability. Any tips on organizing files, folders, modules, or dependencies?
/r/Python
https://redd.it/1lotna6
Practice resources
Recently complete watching “code bro” YouTube python learning
And now I wanted to practice on those skill. Do you have any recommended researchers to practice from it?
I tried “code war” and i think the Questions there is a little off ( some of the question there are weird and I don't think I'll ever run into them again)
I know “leet code” is more difficult question aiming for interview question but maybe I should learn from them
/r/Python
https://redd.it/1lonjvb
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/1loncju
An open-source alternative to Yahoo Finance's market data python APIs with higher reliability.
"Hey folks! 👋
I've been working on this Python API called defeatbeta-api that some of you might find useful. It's like yfinance but without rate limits and with some extra goodies:
• Earnings call transcripts (super helpful for sentiment analysis)
• Yahoo stock news contents
• Granular revenue data (by segment/geography)
• All the usual yahoo finance market data stuff
I built it because I kept hitting yfinance's limits and needed more complete data. It's been working well for my own trading strategies - thought others might want to try it too.
Happy to answer any questions or take feature requests!"
/r/Python
https://redd.it/1loaj1q
Best Way to Split Scientific PDF Text into Paragraphs?
Hi everyone,
I'm working on processing scientific articles (mostly IEEE-style) and need to split the extracted text into paragraphs reliably.
Simple rules like \\n or \\n\\n often give poor results because:
Many PDFs have line breaks at the end of each line, even mid-paragraph.
Paragraph separation isn't consistent.
I'm looking for a better method or tool (free if possible) to segment PDF text into proper paragraphs
Any suggestions (libraries methods......) would be appreciated!
/r/Python
https://redd.it/1lo60gv
any django package for user credit usage/balance ?
hi everyone!
I'm building an AI based web application with django, celery.
I want to allow users have pay-as-you-go model. There will be credit purchasing.
is there any package for this purpose ?
Thanks
/r/django
https://redd.it/1lo3b0o
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/1lntgli
Django 5 healthcheck
Hello, I am looking to create a healthcheck endpoint for my django app and I was hoping for it to be a little bit more thorough than just returning an HTTP 200 OK response. My idea was to do something that at least check for DB and cache connectivity before returning that successful response. Are there any recommended/ best practices for this?
I could certainly just perform a read to DB and read or write something to the cache, but was just curious to what others are doing out there since I feel that might be inefficient for an endpoint that's meant to be quick and simple.
/r/django
https://redd.it/1lnjeki
Starting Over at 40: How Solo Python Freelancing Let Me Trade Burnout for a Zero-Stress, Profitable
It took me twenty years, two burn-outs, and a hard look at what I really wanted from a working week to understand how I could earn a comfortable living and stay sane. This article is the unfiltered story of my learning curve. It’s 100 percent real; I wrote every line, using AI only to polish grammar and structure. If you are wondering whether a mid-career switch to Python freelance work could fit your own life, read on: I will lay out every step, the money, the mistakes, and exactly how I organise my days now so you can decide what might translate to your situation.
adrien.d_84254/starting-over-at-40-how-solo-python-freelancing-let-me-trade-burnout-for-a-zero-stress-profitable-870931ac8203">Link to full post here
/r/Python
https://redd.it/1lnkxko
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/1ln12ce
Finally tried Django 5.1’s {% querystring %} tag — it’s amazing (especially with HTMX)
While working on a Django project for a client, I had to build a fairly complex UI with HTMX — filtering, sorting, pagination — all driven by query parameters.
As you probably know, updating URLs in Django templates without clobbering the rest of the querystring used to be a pain. I was halfway into writing a custom tag (again) when a colleague pointed me to Django 5.1’s new {% querystring %} template tag.
Game. Changer. 🙌
It handles adding, removing, and updating query parameters cleanly — no loops, no custom tags, just elegant syntax.
I was so happy I found it and I hope it can make someone else happy :)
From the official docs: here
I wrote a short blog post walking through the tag, with examples of real-world usage (pagination, multi-param filters, HTMX integration, etc.) if your'e interested in some more info:
👉 alonwo/django-5-1s-game-changing-querystring-template-tag-finally-url-parameters-made-easy-d2edb539590f">Django 5.1’s Game-Changing QueryString Template Tag: Finally, URL Parameters Made Easy
Hope it’s useful — and I’d love to hear how others are using it or if you’ve got tips I missed!
/r/django
https://redd.it/1ln92hm
[R] LSTM or Transformer as "malware packer"
/r/MachineLearning
https://redd.it/1ln4omn
Are there many of you on here who do all their Python development inside a container?
I tried to run my app in a container during development a few years ago in vscode, but it didn't feel right at all. Within the few i spoke to who also tried this it didn't resonate either and most did their python development locally. They only used containers for development services.
I wonder if things have changed. It looks like you still need to do a lot of custom config to debug a container in vscode. Does hot reload work? Intellisense? click through to system modules? I wonder if the consensus is different in 2025.
/r/Python
https://redd.it/1lmztd5
Ending all Circular Imports Forever?
Wouldn't there be a way to hack Python so that it receives the following system-level command from module import:from module import somedef:(doppler)
And the argument (doppler) then automatically ensures that lazy is imported, and if that doesn't work, it detects a circle and automatically uses the doppler.py where you simply shove all defs() that make problems from your whole project?
🔄 DOPPLER MODULE ================ import sys
import importlib.util
class DopplerImportHook:
def find_spec(self, name, path, target=None): # Spot "(doppler)" Pattern
if ":(doppler)" in name:
# Circular Import Detection
# Fallback zu
`doppler.py` return
self.load_from_doppler(name)
# AST-Manipulation before Import: import ast
def preprocess_import(source):
# Parse "from module import func:(doppler)"
# Transform to try/except with doppler fallback
class AutoDopplerMeta(type):
def __new__(cls, name, bases, namespace):
# Automatically detect circular dependencies
# Route to doppler when needed
is this a bad idea?
/r/Python
https://redd.it/1lmmypt
I updated CtrlV: Share code instantly via web or directly from VS Code
/r/django
https://redd.it/1lmk52v
Blog Understand how Python works using daily koans
When I first started using Python, I did what everyone does: followed tutorials, bookmarked cheat sheets, and tried to memorize as much as I could. For a while, it worked. At least on the surface.
But even after months of writing code, something felt off.
I knew how to use the language, but I didn’t really understand it.
Then I stumbled across a line of code that confused me:
== False # False
if : # Also False
I spent longer than I care to admit just staring at it.
And yet that little puzzle taught me more about how Python handles truth, emptiness, and logic than any blog post ever did.
That was the first time I really slowed down.
Not to build something big, but to sit with something small. Something puzzling. And that changed the way I learn.
So I started a little experiment:
Each day, I write or find a short Python koan, a code snippet that seems simple, but carries a deeper lesson. Then I unpack it. What it looks like on the surface. Why it works the way it does. And
/r/Python
https://redd.it/1loq064
Can someone help me with a clear guide to Django auth process customization ?
Hello guys !! I'm new in the django world, and i feel a little confused by the authentication process of this framework. A come frame laravel where i used to create the auth process by myself (although there are some ready to use kits like breeze). But in Django, i've realized that the authentication system is a built in feature of the framework. I searched for a way to customize it, but all the tutorials i found were not as clear as i needed. So if someone has some tips or suggestions for me, il be delighted to explore them 🙂. Thanks in advance.
/r/django
https://redd.it/1lo9bwr
toycrypto: Some toy cryptographic modules and related tools
### toycrypto
Some toy cryptographic modules and related tools that should never, ever be used for anything other than demonstation purposes.
Python's "one int
to rule them all" makes it very attractive for illustrating cryptographic notions and computations.
- PyPi
- Github
- Documentation
### What My Project Does
toycrypto is a collection of modules which can be used to illustrate or teach about basic cryptographic concepts.
It has few third party dependencies and no required dependencies on anything that would prevent its use in a pure Python environment.
It started out as a place for me to collect various things I had written in Jupyter notebooks or in teaching notes.
A few examples:
- The oldest (and ugliest) code in the project is the Elliptic Curve module, which I had originally created to so that I could talk about the doubleandadd algorithm (and its vulnerabilites to side channels).
- The birthday problem module because I needed something that would efficiently provide reasonable approximations for the kinds of numbers and probability I wanted to talk about.
- A more recent module is the security games,
which can be used to illustrate things like IND-CPA.
- The number theory module started out to just give me pure Python utilities that I would otherwise have used Sage
/r/Python
https://redd.it/1loighk
How is PySide6 as a GUI development option?
I've been looking into native GUI app development, and PySide6 came up—does anyone have experience with it?
Also, is building GUI apps with Python kind of a bad idea in general?
/r/Python
https://redd.it/1lo9132
Feeling Overwhelmed as a Django Beginner, Is This Normal?
Hi guys, I recently started learning Django. I'm not completely new to backend development though, I understand the basics, since I had been using Flask for a while. However, I never worked on any real-world projects, just personal ones.
My first programming language was Python, then I moved on to Flask, and now I'm learning Django. I also know HTML and a bit of CSS. I've never really had any formal training; most of my learning has been through YouTube.
Lately, I’ve come to realize how little I actually know. Everything feels overwhelming. I keep learning every day, but there's always something new to figure out. I just started learning Django REST Framework (DRF) through a YouTube course. It was only yesterday or so that I found out about Django Ninja, another option for building REST APIs (I think it supports async too), I discovered it thanks to a Udemy course I got on using Redis with Django by Very Academy.
I've been applying for internships and junior developer roles. I've even sent emails to startups and organizations offering to work as an unpaid intern just to gain real world experience. How did you guys manage to keep going through all this?
Also, in
/r/django
https://redd.it/1lnc48l
Django 2024 Annual Impact Report
https://www.djangoproject.com/weblog/2025/jun/30/django-2024-annual-impact-report/
/r/django
https://redd.it/1lo3mxo
What best works for frontend if I use DRF?
/r/djangolearning
https://redd.it/1ln5jv5
Django DRF with django All Auth. Cross origin question.
Hey I'm trying to make Django DRF that uses django all auth with a React frontend.
The error is 403 (screenshot):
Backend - localhost:8000
Frontend - localhost:3000
Header's I'm sending along with the fetch request:
headers: {
'Accept': "application/json",
},
credentials: 'include',headers: {
'Accept': "application/json",
"X-CSRFToken": getCSRFToken() ?? '',
},
credentials: 'include',
(the function is tested and returns the token properly)
There is an example project, which I tried to replicate with no luck:
[https://codeberg.org/allauth/django-allauth/src/branch/main/examples/react-spa](https://codeberg.org/allauth/django-allauth/src/branch/main/examples/react-spa)
Request headers for 403:
POST /auth/browser/v1/auth/signup HTTP/1.1
Host: 127.0.0.1:8000
User-Agent: Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:140.0) Gecko/20100101 Firefox/140.0
Accept: application/json
Accept-Language: en-US,en;q=0.5
Accept-Encoding: gzip, deflate, br, zstd
Referer: http://localhost:3000/
X-CSRFToken:
Content-Type: text/plain;charset=UTF-8
Content-Length: 59
/r/django
https://redd.it/1lnljap
With Python 3.14 free-threading support coming up, will this be useful for Django's future performances?
I am not very familiar with how this is handled in Django, but does the Django team have a roadmap of supporting this feature and how long down the road should we expect it to roll over?
/r/django
https://redd.it/1lnekfg
Django rest job advice?
Hey guys i have been doing works with django more than a year. I am much comfortable with it that no other framework gives me courage. The best framework for me for backend currently i enjoy. So i wanna build career specifically on this cause i enjoy for hourse doing django rest stuffs.
But in my country there are only few companies that hires django developers.
I want to try remote company that hires django/fastapi developer. How to get job posts? I tried LinkedIn but failed many times bu sending cv...can anyone help me how to get a remote job? What should i add in CV?
I will pleased to have a network who are working as a django/python developer.
/r/django
https://redd.it/1ln4yuw
Showcase: I built perplexity clone with Django and React
I built a Perplexity clone with Django + React! 🔥
Knowmore is my latest open-source project featuring:
Real-time streaming AI responses
Web search integration for current info
Django async/ASGI backend
React + TypeScript frontend
Anthropic & OpenAI LLM integration
FireCrawl for web scraping
Check it out: https://github.com/ahmadrosid/Knowmore
Currently open to new opportunities as a Django/Python/React developer. If you're hiring or know someone who is, drop me a line at **hey@ahmadrosid.com** 📧
Would love your feedback on the code and architecture! 🚀
/r/django
https://redd.it/1lmrgd6
How are you managing local env-specific config/secrets?
Hi all, I manage a team running a number of web services both internally and externally ay my company, and one issue I always have is managing local configuration and secrets.
For example, we have develop/staging/prod instances for each web application, which allows us to validate changes and promote these changes to escalating prod-like environments. I think this pattern is probably pretty familiar to most folks but I'm happy to elaborate more.
However, one thing I have not figured out a good workflow for is managing local secrets. For example, when we are generating database migrations against prod, we need to be pointed to the prod database. What I have found works well enough is to store the secrets in a .env.local file, or .env.prod, .env.staging, .env.develop, etc. And then we just pass these around. It all sounds primitive, but it works well enough, but it feels a bit unwieldy and requires manual config switching to change envs.
However, I also don't imagine this is the best practice. So I guess my questions: how do you store and manage local secrets for dev purposes? I think this question touches on both secrets as well as other likely env-based configs that might vary
/r/django
https://redd.it/1lmusv2
Himig – Compose and Play Melodies with Python
GitHub: **Himig**
Playground: **Himig Playground · Streamlit**
What My Project Does?
Himig is a Python music synthesis module that lets you compose, play, and save melodies using simple note strings like "C4:0.5"
.
You can use it like this:
from himig import play
melody = "C4:0.5", "C4:0.5", "G4:1.0"
play(melody)
save(melody, "melody.wav")
Melodies are written using the format "NOTE:DURATION"
— for example, "A4:1.0
" or "R:0.25"
for a rest.
Try playing built-in melodies: happy birthday and twinkle twinkle or create your own.
Target Audience:
\-Hobbyists who want to compose melodies programmatically.
\-Educators teaching music, sound, or digital signal processing in Python.
\-Python developers who want to explore audio synthesis.
\-Others who just want to play with music.
Comparison:
\-Aside from Python built-ins, it relies only on Numpy.
\-Simple, readable note strings.
Limitation: One note at a time, wav output only, and sine wave synthesis only for now.
You can install via: pip install himig
/r/Python
https://redd.it/1lmnful
Pobshell: A Bash-like shell for live Python objects
# What Pobshell Does
Think cd, ls, cat, and find — but for Python objects instead of files.
Stroll around your code, runtime state, and data structures. Inspect everything: modules, classes, live objects. Plus recursive search and CLI integration.
2 minute video demo: https://www.youtube.com/watch?v=I5QoSrc\_E\_A
What it's for:
Exploratory debugging: Inspect live object state on the fly
Understanding APIs: Examine code, docstrings, class trees
Shell integration: Pipe object state or code snippets to LLMs or OS tools
Code and data search: Recursive search for object state or source without file paths
REPL & paused script: Explore runtime environments dynamically
Teaching & demos: Make Python internals visible and walkable
Pobshell is pick‑up‑and‑play: familiar commands plus optional new tricks.
# Target Audience
Python devs, Data Scientists, LLM engineers and intermediate Python learners.
Pobshell is open source, and in alpha release -- Don't use it in production. N.B. Tab-completion isn't available in Jupyter.
Tested on MacOs, Linux and Windows (Python 3.12)
Install: pip install pobshell
Github: https://github.com/pdalloz/pobshell
# Alternatives
You can get similar information from a good IDE or JupyterLab, but you'd need to craft Python list comprehensions using the inspect module. IPython has powerful introspection commands too.
What makes Pobshell different is how expressive its commands are, with an easy learning curve - because basic commands and
/r/Python
https://redd.it/1lmn348
[R] Thought Anchors: Which LLM Reasoning Steps Matter?
/r/MachineLearning
https://redd.it/1lmg313