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
I built an open-source AI governance framework for Python — looking for feedback

I've been working on Ranex, a runtime governance framework for Python apps that use AI coding assistants (Copilot, Claude, Cursor, etc).

The problem I'm solving: AI-generated code is fast but often introduces security issues, breaks architecture rules, or skips validation. Ranex adds guardrails at runtime — contract enforcement, state machine validation, security scanning, and architecture checks.

It's built with a Rust core for performance (sub-100ns validation) and integrates with FastAPI.

What it does:

Runtime contract enforcement via `@Contract` decorator
Security scanning (SAST, dependency vulnerabilities)
State machine validation
Architecture enforcement

GitHub: https://github.com/anthonykewl20/ranex-framework

I'm looking for honest feedback from Python developers. What's missing? What's confusing? Would you actually use this?

/r/Python
https://redd.it/1pc36m8
teams bot integration for user specific notification alerts

Hi everyone,
I’m working on a small POC at my company and could really use some advice from people who’ve worked with Microsoft Teams integrations recently.

Our stack is Java (backend) + React (frontend).
Users on our platform receive alerts/notifications, and I’ve been asked to build a POC that sends each user a daily message through: Email, Microsoft Teams

The message is something simple like:
“Hey {user}, you have X unseen alerts on our platform. Please log in to review them.” No conversations, no replies, no chat logic. just a one-time, user-specific daily notification.

Since this message is per user and not a broadcast, I’m trying to figure out the cleanest and most future-proof approach for Teams.

Looking for suggestions from anyone who’s done this before:

- What approach worked best for user-specific messages?
- Is using the Microsoft Graph API enough for this use case?
- Any issues with permissions, throttling, app-only auth, or Teams quirks?
- Any docs, examples, or blogs you’d recommend?

Basically, the entire job of this integration is to Notify the user once per day on Teams that they have X unseen alerts on our platform. the suggestions i have been getting so far is to use python.

Any help or direction would be really appreciated. Thanks!

/r/Python
https://redd.it/1pc3qiu
I spent 2 years building a dead-simple Dependency Injection package for Python

Hello everyone,

I'm making this post to share a package I've been working on for a while: `python-injection`. I already wrote a post about it a few months ago, but since I've made significant improvements, I think it's worth writing a new one with more details and some examples to get you interested in trying it out.

For context, when I truly understood the value of dependency injection a few years ago, I really wanted to use it in almost all of my projects. The problem you encounter pretty quickly is that it's really complicated to know where to instantiate dependencies with the right sub-dependencies, and how to manage their lifecycles. You might also want to vary dependencies based on an execution profile. In short, all these little things may seem trivial, but if you've ever tried to manage them without a package, you've probably realized it was a nightmare.

I started by looking at existing popular packages to handle this problem, but honestly none of them convinced me. Either they weren't simple enough for my taste, or they required way too much configuration. That's why I started writing my own DI package.

I've been developing it alone for about 2 years now, and

/r/Python
https://redd.it/1pc77j2
PyImageCUDA - GPU-accelerated image compositing for Python


## What My Project Does

PyImageCUDA is a lightweight (~1MB) library for GPU-accelerated image composition. Unlike OpenCV (computer vision) or Pillow (CPU-only), it fills the gap for high-performance design workflows.

10-400x speedups for GPU-friendly operations with a Pythonic API.

## Target Audience

- Generative Art - Render thousands of variations in seconds
- Video Processing - Real-time frame manipulation
- Data Augmentation - Batch transformations for ML
- Tool Development - Backend for image editors
- Game Development - Procedural asset generation

## Why I Built This

I wanted to learn CUDA from scratch. This evolved into the core engine for a parametric node-based image editor I'm building (release coming soon!).

The gap: CuPy/OpenCV lack design primitives. Pillow is CPU-only and slow. Existing solutions require CUDA Toolkit or lack composition features.

The solution: "Pillow on steroids" - render drop shadows, gradients, blend modes... without writing raw kernels. Zero heavy dependencies (just pip install), design-first API, smart memory management.

## Key Features

Zero Setup - No CUDA Toolkit/Visual Studio, just standard NVIDIA drivers
1MB Library - Ultra-lightweight
Float32 Precision - Prevents color banding
Smart Memory - Reuse buffers, resize without reallocation
NumPy Integration - Works with OpenCV, Pillow, Matplotlib
Rich Features - +40 operations

/r/Python
https://redd.it/1pcce1w
I pushed my first Django enterprise boilerplate (Kanban, calendar, 2FA, Celery, Docker, Channels) – would love feedback

Hey everyone,

I’ve just put my first public repo on GitHub and would really appreciate some honest feedback.

It’s a Django Enterprise Boilerplate meant to give a solid starting point for apps that need auth, background tasks, and a usable UI out of the box. I built this using Antigravity.

Key features:

Kanban board – drag-and-drop task management with dynamic updates
Calendar – month and day views with basic event scheduling
Authentication – login, registration, and 2FA (TOTP) wired in
UI – Tailwind CSS + Alpine.js with a Geist-inspired layout
Async-ready – Celery, Redis, and WebSockets (Daphne) pre-configured
Dockerized – comes with Docker Compose for local setup

Tech stack: Django 5, Python 3.11, PostgreSQL, Redis, Tailwind, Alpine.js

Repo:
https://github.com/antonybenhur/Django-Alpine-BoilerPlate

I’ll be adding more features soon, including Google sign-in, Stripe payment integration, and other quality-of-life improvements as I go.

Thanks in advance..

https://preview.redd.it/7ktgs55e0r4g1.png?width=1024&format=png&auto=webp&s=3f65a00d66dcc1f6cc4513545ce3e1e64ce06585

https://preview.redd.it/vh70jwae0r4g1.png?width=2221&format=png&auto=webp&s=9f722a734278b07dad60f8d74f233b4edbde4ade

https://preview.redd.it/5xrhk3he0r4g1.png?width=2377&format=png&auto=webp&s=d7bf8f3f2c58890b8ab513ad7ccdf9791bd369ee

https://preview.redd.it/olbkc55e0r4g1.png?width=2440&format=png&auto=webp&s=08ab209b7b7145ee2a9169f5ff6fa27b6ae8081f

https://preview.redd.it/4vwy665e0r4g1.png?width=2083&format=png&auto=webp&s=6c1da0cdccdcca24fd69ce36c09fed75ec28342c

https://preview.redd.it/b7lnr55e0r4g1.png?width=2089&format=png&auto=webp&s=031f5a3624d62a98bd90978554c7b63abaf0b548

https://preview.redd.it/g1ora95e0r4g1.png?width=2088&format=png&auto=webp&s=df694de063b05183deecb634e5c49ab13e39630c

https://preview.redd.it/2fby465e0r4g1.png?width=2230&format=png&auto=webp&s=bdcb593bf36778c311deee73edf290931032aacb

https://preview.redd.it/ay5sq55e0r4g1.png?width=1915&format=png&auto=webp&s=ac939150f885e118aefa7dfdb185290c2c84f81d

/r/django
https://redd.it/1pc2x47
Structure Large Python Projects for Maintainability

I'm scaling a Python project from "works for me" to "multiple people need to work on this," and I'm realizing my structure isn't great.

Current situation:

I have one main directory with 50+ modules. No clear separation of concerns. Tests are scattered. Imports are a mess. It works, but it's hard to navigate and modify.

Questions I have:

What's a good folder structure for a medium-sized Python project (5K-20K lines)?
How do you organize code by domain vs by layer (models, services, utils)?
How strict should you be about import rules (no circular imports, etc.)?
When should you split code into separate packages?
What does a good test directory structure look like?
How do you handle configuration and environment-specific settings?

What I'm trying to achieve:

Make it easy for new developers to understand the codebase
Prevent coupling between different parts
Make testing straightforward
Reduce merge conflicts when multiple people work on it

Do you follow a specific pattern, or make your own rules?

/r/Python
https://redd.it/1pccbk4
AI Impostor Game

/r/flask
https://redd.it/1pcsja2
Python-native mocking of realistic datasets by defining schemas for prototyping, testing, and demos

https://github.com/DavidTorpey/datamock

What my project does:
This is a piece of work I developed recentlv that I've found quite useful. I decided to neaten it up and release it in case anyone else finds it useful.

It's useful when trving to mock structured data during development, for things like prototyping or testing. The declarative schema based approach feels Pythonic and intuitive (to me at least!).

I may add more features if there's interest.


Target audience: Simple toy project I've decided to release

Comparison:
Hypothesis and Faker is the closest things out these available in Python. However, Hypothesis is closely coupled with testing rather than generic data generation. Faker is focused on generating individual instances, whereas datamock allows for grouping of fields to express and generating data for more complex types and fields more easily. Datamock, in fact, utilises Faker under the hood for some of the field data generation.

/r/Python
https://redd.it/1pcrbn4
I listened to your feedback on my "Thanos" CLI. It’s now a proper Chaos Engineering tool.

Last time I posted `thanos-cli` (the tool that deletes 50% of your files), the feedback was clear: it needs to be safer and smarter to be actually useful.

People left surprisingly serious comments… so I ended up shipping **v2**.

It still “snaps,” but now it also has:

* weighted deletion (age / size / file extension)
* `.thanosignore` protection rules
* deterministic snaps with `--seed`

So yeah — it accidentally turned into a mini chaos-engineering tool.


If you want to play with controlled destruction:

GitHub: [https://github.com/soldatov-ss/thanos](https://github.com/soldatov-ss/thanos)

Snap responsibly. 🫰

/r/Python
https://redd.it/1pd2cgw
Django + HTMX + jquery. Do you know any websites / apps using this stack?

I am looking for example websites using this stack as it minimizes maintenance for most basic setups.

Let me know if you know any websites.

Of course, any ideas, critics and concerns for this stack are welcome, too.

/r/django
https://redd.it/1pcp15d
Blog: ReThinking Django Template #4: Server Side Component

This is #4 of my ReThinking Django Template series.

In this blog post, I will compare Django server-side component packages:

1. Django-Components
2. Django-ViewComponent
3. Cotton
4. Django-Slippers

After reading, it will help you pick one which fits best for your Django project.

ReThinking Django Template: Part 4, Server Side Component

/r/django
https://redd.it/1pd1dl9
My wife was manually copying YouTube comments, so I built this tool

I have built a Python Desktop application to extract YouTube comments for research and analysis.

My wife was doing this manually, and I couldn't see her going through the hassle of copying and pasting.

I posted it here in case someone is trying to extract YouTube comments.

What My Project Does

1. Batch process multiple videos in a single run
2. Basic spam filter to remove bot spam like crypto, phone numbers, DM me, etc
3. Exports two clean CSV files - one with video metadata and another with comments (you can tie back the comments data to metadata using the "video_id" variable)
4. Sorts comments by like count. So you can see the high-signal comments first.
5. Stores your API key locally in a settings.json file.

By the way, I have used Google's Antigravity to develop this tool. I know Python fundamentals, so the development became a breeze.

Target Audience

Researchers, data analysts, or creators who need clean YouTube comment data. It's a working application anyone can use.

Comparison

Most browser extensions or online tools either have usage limits or require accounts. This application is a free, local, open-source alternative with built-in spam filtering.

Stack: Python, CustomTkinter for the GUI, YouTube Data API v3, Pandas

GitHub: https://github.com/vijaykumarpeta/yt-comments-extractor

Would love to hear your feedback or feature

/r/Python
https://redd.it/1pd1g30
Pandas 3.0 release candidate tagged

After years of work, the Pandas 3.0 release candidate is tagged.

>We are pleased to announce a first release candidate for pandas 3.0.0. If all goes well, we'll release pandas 3.0.0 in a few weeks.

* Release candidate: [https://github.com/pandas-dev/pandas/releases/tag/v3.0.0rc0](https://github.com/pandas-dev/pandas/releases/tag/v3.0.0rc0)
* Full release notes: [https://pandas.pydata.org/docs/dev/whatsnew/v3.0.0.html](https://pandas.pydata.org/docs/dev/whatsnew/v3.0.0.html)
* Tracking issue: [https://github.com/pandas-dev/pandas/issues/57064](https://github.com/pandas-dev/pandas/issues/57064)

A very concise, incomplete list of changes:

#### String Data Type by Default
Previously, pandas represented text columns using NumPy's generic "object" dtype. Starting with pandas 3.0, string columns now use a dedicated "str" dtype (backed by PyArrow when available). This means:

* String columns are inferred as dtype "str" instead of "object"
* The str dtype only holds strings or missing values (stricter than object)
* Missing values are always NaN with consistent semantics
* Better performance and memory efficiency

#### Copy-on-Write Behavior
All indexing operations now consistently behave as if they return copies. This eliminates the confusing "view vs copy" distinction from earlier versions:

* Any subset of a DataFrame or Series always behaves like a copy
* The only way to modify an object is to directly modify that object itself
* "Chained assignment" no longer works (and the SettingWithCopyWarning is removed)
* Under the hood, pandas uses views for performance but copies when needed

#### Python and Dependency Updates
* Minimum Python version: 3.11
* Minimum NumPy version:

/r/Python
https://redd.it/1pdb5u2
Pyrefly now has built-in support for Pydantic

Pyrefly (Github) now includes built-in support for Pydantic, a popular Python library for data validation and parsing.

The only other type checker that has special support for Pydantic is Mypy, via a plugin. Pyrefly has implemented most of the special behavior from the Mypy plugin directly in the type checker.

This means that users of Pyrefly can have provide improved static type checking and IDE integration when working on Pydantic models.

Supported features include:
- Immutable fields with ConfigDict
- Strict vs Non-Strict Field Validation
- Extra Fields in Pydantic Models
- Field constraints
- Root models
- Alias validation

The integration is also documented on both the Pyrefly and Pydantic docs.

/r/Python
https://redd.it/1pdbw37
JustHTML: A pure Python HTML5 parser that just works.

Hi all! I just released a new HTML5 parser that I'm really proud of. Happy to get any feedback on how to improve it from the python community on Reddit.

I think the trickiest thing is if there is a "market" for a python only parser. Parsers are generally performance sensitive, and python just isn't the faster language. This library does parse the wikipedia startpage in 0.1s, so I think it's "fast enough", but still unsure.

Anyways, I got HEAVY help from AI to write it. I directed it all carefully (which I hope shows), but GitHub Copilot wrote all the code. Still took months of work off-hours to get it working. Wrote down a short blog post about that if it's interesting to anyone: https://friendlybit.com/python/writing-justhtml-with-coding-agents/

What My Project Does

It takes a string of html, and parses it into a nested node structure. To make sure you are seeing exactly what a browser would be seeing, it follows the html5 parsing rules. These are VERY complicated, and have evolved over the years.

from justhtml import JustHTML

html = "<html><body><div id='main'><p>Hello, <b>world</b>!</p></div></body></html>"
doc = JustHTML(html)



/r/Python
https://redd.it/1pdgpmk
D Self-Promotion Thread

Please post your personal projects, startups, product placements, collaboration needs, blogs etc.

Please mention the payment and pricing requirements for products and services.

Please do not post link shorteners, link aggregator websites , or auto-subscribe links.

\--

Any abuse of trust will lead to bans.

Encourage others who create new posts for questions to post here instead!

Thread will stay alive until next one so keep posting after the date in the title.

\--

Meta: This is an experiment. If the community doesnt like this, we will cancel it. This is to encourage those in the community to promote their work by not spamming the main threads.

/r/MachineLearning
https://redd.it/1pbxkt2
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/1pdkuig