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
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
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
How to Implement login by either email or phone number?

Hello, I'm trying to develop an online store project, and I need a way to allow users to use either email OR phone number for registration. Keyword being Or. However since this is an online store, for actual purchase i will require users to provide phone number later. For now, is there a way to let users sign up with email or phone number? (CustomUser maybe?)

/r/djangolearning
https://redd.it/1low9b8
D Monthly Who's Hiring and Who wants to be Hired?

For Job Postings please use this template

>Hiring: [Location\], Salary:[\], [Remote | Relocation\], [Full Time | Contract | Part Time\] and [Brief overview, what you're looking for\]

For Those looking for jobs please use this template

>Want to be Hired: [Location\], Salary Expectation:[\], [Remote | Relocation\], [Full Time | Contract | Part Time\] Resume: [Link to resume\] and [Brief overview, what you're looking for\]

​

Please remember that this community is geared towards those with experience.

/r/MachineLearning
https://redd.it/1loqe5e
Will requiring login deter users from trying my mood tracker?

I am finishing up my first web application, a simple mood tracker where users log daily mood and notes. All pages require login so data stays private. I’m worried visitors will see the login wall and leave without trying the core features. Is that a dealbreaker? What’s the easiest way to let people try the main functionality without sacrificing privacy? I’m using React with a Django REST backend and session based authentication.

/r/django
https://redd.it/1louful
ViewORM for SQLAlchemy

Hello, Python community! Here is a package I developed for some projects I work at, and hopefully it might be helpful to a broad audience of developers: **SQLAlchemy-ViewORM** for managing simple and materialized views in ORM manner with any DB support.

* [PyPI](https://pypi.org/project/SQLAlchemy-ViewORM/)
* [Documentation](https://sqlalchemy-vieworm.readthedocs.io/en/latest/)
* [GitHub](https://github.com/AivanF/SQLAlchemy-ViewORM)

# What My Project Does

Features:

* **Standard views**: Traditional simple SQL views that execute their query on each access.
* **Materialized views**: Views that store their results physically for faster access.
* **Simulated views**: For databases that don’t support materialized views, they can be mocked with tables or simple views. Actually, *this was the primary reason of the project* – to simplify quick tests with SQLite while deployments use Postgres. The lib allows to control the way of simulation.
* **Views lifecycle control**: create, refresh or delete the views all together or each one separately, depending on your project / business needs.
* **ORM interface, dialect-specific queries**: views can be defined as a static SQL/ORM query, or as a function that takes DB dialect and returns a `selectable`. After creation, the views can be used as ordinary tables.

What it lacks:

* **Migrations**, Alembic support. For now, migrations related to views should be handled manually or by custom scripts. In case the project receives

/r/Python
https://redd.it/1loweun
Python script to batch-download YouTube playlists in any audio format/bitrate (w/ metadata support)

I couldn’t find a reliable tool that lets me download YouTube playlists in audio format exactly how I wanted (for car listening, offline use, etc.), so I built my own script using yt-dlp.

# 🔧 Features:

Download entire playlists in any audio format: `.mp3`, `.m4a`, `.wav`
Set any bitrate: 128 / 192 / 256 kbps or max available
Batch download multiple playlists at once
Embed metadata (artist, title, album, etc.) automatically

It’s written in Python, simple to use, and fully open-source.

It was created using ChatGPT and It performs as described.

Feel free use it ,if you need it

📽️ [YouTube tutorial link\] -https://youtu.be/HVd4rXc958Q
💻 [GitHub repo link\] - https://github.com/dheerajv1/AutoYT-Audio

/r/Python
https://redd.it/1lot7nn
Is it unreasonable to pair Django with Astro as well as htmx?

So basically you have a website that is completely static up until the login page. Does Django’s project structure work well with this? Where you can basically use Astro to efficiently develop the static pages and not have to use “bloated” Django or rather ssr as a whole for the completely static portions. Then I’m also not sure if Django is suitable to be used with htmx, but I really like the concept of not having to reload the entire page request. It’s kind of like Astro’s island architecture but for ssr in a backwards twisted way where you could make the comparison.

I’m also torn between using golang with Templ to learn backend development or going with Django in python. Htmx and Astro pair-ability is definitely a must, so if it’s easily doable without some hacky round about way in Django, then I will probably go with that for simplicity, employability, and overall more widespread use.

/r/djangolearning
https://redd.it/1ln514x
What is the best vps (interms of price) to host my django + react app.....(i have a background process script too)



/r/djangolearning
https://redd.it/1llmq48
How do you choose your Django hosting provider?

Hey guys, what are your usual go-to solutions when you're hosting your Django projects, and why?

Is price the most important factor, or is it the feature set, credibility of the company, or how do you choose the right one?

I'm conducting a small research project to gain a deeper understanding of this topic. Thank you for your help

/r/django
https://redd.it/1lp00rp
Making a Simple HTTP Server with Asyncio Protocols

Hey,

If you're curious about how Asyncio Protocols work (and how you they can be used to build a super simple HTTP server) check out this article: https://jacobpadilla.com/articles/asyncio-protocols

/r/Python
https://redd.it/1lpcaec
Best alternatives to Django?

Are there other comprehensive alternatives to Django that allow for near plug and play use with lots of features that you personally think is better?

I wouldn't consider alternatives such as Flask viable for bigger solo projects due to a lack of builtin features unless the project necessitates it.

/r/Python
https://redd.it/1lp3r3j
pyfiq -- Minimal Redis-backed FIFO queues for Python

What My Project Does

pyfiq is a minimal Redis-backed FIFO task queue for Python. It lets you decorate functions with `@fifo(...)`, and they'll be queued for execution in strict order processed by threaded background workers utilizing Redis BLPOP.

It's for I/O-bound tasks like HTTP requests, webhook dispatching, or syncing with third-party APIs-- especially when execution order matters, but you don't want the complexity of Celery or external workers.


This project is for:

Developers writing code for integrating with external systems
People who want simple, ordered background task execution
Anyone who don't like Celery, AWS Lambda, etc, for handling asynchronous processing

Comparison to Existing Solutions

Unlike:

Celery, which requires brokers, workers, and doesn't preserve ordering by default
AWS Lambda queues, which don't guarantee FIFO unless using with SQS FIFO + extra setup

pyfiq is:

Embedded: runs in the app process
Order-preserving: one queue, multiple consumers, with strict FIFO
Zero-config: no services to orchestrate

It's designed to be very simple, and only provide ordered execution of tasks. The code is rudimentary right now, and there's a lot of room for improvement.

Background

I'm working on an event-driven sync mechanism, and needed something to offload sync logic in the background, reliably and in-order. I could've

/r/Python
https://redd.it/1lpfkei
Simple beginners guide

Python-Tutorial-2025.vercel.app


It's still a work in progress as I intend to continue to add to it as I learn. I tried to make it educational while keeping things simple for beginners. Hope it helps someone.



/r/Python
https://redd.it/1lphzws
Code Sharing and Execution Platform Security Risks?

Currently working on a Python code sharing and execution platform aimed at letting users rapidly prototype with different libraries, frameworks, and external APIs. I am aware of the general security concerns and the necessity of running code in isolation (I am using GCP containers and Gvisor). Some concerns I'm thinking of:

\- crypto mining
\- network allowances leading to malicious code on external sites
\- container reuse

Wondering what everyones thoughts are on these concerns and if there are specific security measures I should be implementing beyond isolation and code-parsing for standard attacks?

/r/Python
https://redd.it/1lpflqb
Built a CLI tool that bridges multiple Python backtesting libraries to live APIs!

I just released my first significant open-source project, tackling an interesting architectural challenge. Different Python backtesting libraries (zipline, backtrader, vectorbt, backtesting.py) all have completely different APIs, but deploying strategies to live trading means rewriting everything from scratch.

So I built StrateQueue, a universal adapter between any backtesting library and live broker APIs. The technical challenge was normalizing signals across multiple library architectures and creating a clean plugin system for broker integrations, achieving \~11ms signal processing latency.

The CLI makes deployment dead simple:

stratequeue deploy \
--strategy examples/strategies/sma.py \
--symbol AAPL \
--timeframe 1m

DEMO

Since this is my first major open source contribution, I'd love feedback on code organization, API design, and Python best practices. The adapter pattern implementation was particularly fun to solve.

If you're interested in fintech applications with Python, I'd welcome contributors to help expand broker integrations or optimize performance. Even if you're just curious about the architecture, a GitHub star would help with visibility!

GITHUB

DOCS

TL;DR:

What my project does: StrateQueue is the fastest way from backtest to live trading

Target

/r/Python
https://redd.it/1lp470w
Want to gain experience

I am learning django nowadays and want to know how real projects work, so if someone is working on some django project and need someone's help I am ready to help so I can learn. (For free)

Even if you don't want my help please share your repo. So I can see how exactly we work in real world project in django.

/r/djangolearning
https://redd.it/1lpqzam