Python Daily – Telegram
Python Daily
2.56K subscribers
1.49K photos
53 videos
2 files
39K links
Daily Python News
Question, Tips and Tricks, Best Practices on Python Programming Language
Find more reddit channels over at @r_channels
Download Telegram
Finished My Agentic RAG Tutorial - Everything in Python, Fully Local

### 💡 What My Project Does

After 6 months of intensive study on RAG systems, I've completed a comprehensive educational repository for Agentic RAG. The entire system is in Python and runs fully locally, eliminating API costs!

This is a complete end-to-end example that demonstrates how all the pieces of an advanced agent architecture work together.

---

### 🎯 Target Audience

Anyone curious about how Agentic RAG actually works and wants to learn by building, rather than just reading theory.

### 🆚 The Comparison: Why This Is Different

Most RAG tutorials are scattered or skip the hard parts. This project provides a complete, working implementation that tackles the complexity head-on, offering:

End-to-End Functionality: All components (chunking, vector store, agents) work together seamlessly.
🔒 Zero Dependency Cost: No API keys or expensive cloud services required.
🐍 Pure Python Stack: No JavaScript, just Python and your local machine.

### 🧠 What You'll Learn (Architectural Deep Dive)

This is a deep dive into the architecture, including:

PDF → Markdown conversion
Hierarchical chunking (parent/child)
Hybrid embeddings (dense + sparse)
Vector storage with Qdrant
Query rewriting & human-in-the-loop interaction
Context management with summarization
Multi-agent map-reduce – Parallel sub-queries for complex questions
Fully working agentic RAG with LangGraph
Pure Python UI with Gradio for

/r/Python
https://redd.it/1picui1
DTOs or classes with objects and methods

Which is preferred in Python?

DTOs or classes that encapsulate data and methods?

Wondering about this as I'm from a C# background where we rarely used classes that encapsulate data and methods. My current job (Python) goes way heavier on OOP than my previous.

/r/Python
https://redd.it/1piug7a
A Roadmap for AIML from scratch !!

*YT Channels:*

*Beginner Level (for python till classes are sufficient) :*

* Simplilearn
* Edureka
* edX

Advanced Level (for python till classes are sufficient):

* Patrick Loeber
* Sentdex

*Flow:*

coding => python => numpy , pandas , matplotlib, scikit-learn, tensorflow

Stats (till Chi-Square & ANOVA) → Basic Calculus → Basic Algebra

Check out *"stats"* and *"maths"* folder in below link

*Books:*

Check out the *“ML-DL-BROAD”* section on my GitHub: [Github | Books Repo](http://github.com/Rishabh-creator601/Books)

* Hands-On Machine Learning with Scikit-Learn & TensorFlow
* The Hundred-Page Machine Learning Book

>

Please let me How is it ? and if in case i missed any component

/r/Python
https://redd.it/1piwygn
Frist: Property base age, calendar windows and business calendar ages/windows using properties.

🐍 What Frist Does

Frist (a German word related to scheduling) is a package that allows for calculation of ages on different time scales, if dates fit into time/calendar windows (last 3 minutes, this week) and determine age and windows for business/working days.

At no time do you perform any "date math", interact with datetime or date fields or timespans or deltas. Ages are all directly accessed via time scale properties and time windows are accessed via method calls that work across all supported time scales (second, minute, hour, day, week, month, quarter, fiscal quarter, year, fiscal year). Objects in Frist are meant to be immutable.

Time windows are by default "half-open intervals" which are convenient for most cases but there is support for a generalized between that works like the Pandas implementation as well as a thru method that is inclusive of both end points.

All of the initializers allow wide data types. You can pass datetime, date, int/float time stamps and strings, which all are converted to datetimes. Ideally this sets you up to never write conversion code, beyond providing a non-ISO date format for "non-standard" string inputs.

The code is type annotated and fully doc-stringed for a good

/r/Python
https://redd.it/1pilirz
Should I generate images on the client or server side ?

In my django website I have a model called event , that has as attributes background image and overlay image .
My business flow is as follows :
The user uploads a picture
I open the background picture
I paste the user 's picture on it
I then paste the overlay picture

So I use pillow in the backend , but I feel this might be doing unnecessary and causing me too much memory and time . When I could just use the user 's browser and render the images .


After I changes my code to do this on the client side using canvas , I noticed my memory usage went down by 10 MB , due to me not opening the background picture in memory and then pasting imag3s in it.


Is this wise from performance pov ?

/r/django
https://redd.it/1piidtl
P Supertonic — Lightning Fast, On-Device TTS (66M Params.)

Hello!

I'd like to share Supertonic, a lightweight on-device TTS built for extreme speed and easy deployment across a wide range of environments (mobile, web browsers, desktops, etc).

It’s an open-weight model with 10 voice presets, and examples are available in 8+ programming languages (Python, C++, C#, Java, JavaScript, Rust, Go, and Swift).

For quick integration in Python, you can install it via pip install supertonic:

from supertonic import TTS

tts = TTS(autodownload=True)

# Choose a voice style
style = tts.get
voicestyle(voicename="M1")

# Generate speech
text = "The train delay was announced at 4:45 PM on Wed, Apr 3, 2024 due to track maintenance."
wav, duration = tts.synthesize(text, voicestyle=style)

# Save to file
tts.save
audio(wav, "output.wav")

GitHub Repository

Web Demo

Python Docs

/r/MachineLearning
https://redd.it/1pj11sm
Introducing Serif: a zero-dependency, vector-first data library for Python

Since I began in Python, I wanted something simpler and more predictable. Something more "Pythonic" than existing data libraries. Something with vectors as first-class citizens. Something that's more forgiving if you need a for-loop, or you're not familiar with vector semantics. So I wrote Serif.

This is an early release (0.1.1), so don't expect perfection, but the core semantics are in place. I'm mainly looking for reactions to how the design feels, and for people to point out missing features or bugs.



What My Project Does

Serif is a lightweight vector and table library built around ergonomics and Python-native behavior. Vectors are first-class citizens, tables are simple collections of named columns, and you can use vectorized expressions or ordinary loops depending on what reads best. The goal is to keep the API small, predictable, and comfortable.

Serif makes a strategic choice: clarity and workflow ergonomics over raw speed.

pip install serif

Because it's zero dependency, in a fresh environment:

pip freeze
# serif==0.1.1



Sample Usage

Here’s a short example that shows the basics of working with Serif: clean column names, natural vector expressions, and a simple way to add derived columns:



/r/Python
https://redd.it/1pj5wdb
D Benchmark: Massive degradation in NVMe Random Read throughput on A100 vs H100 during Multi-GPU Model Loading

We recently conducted a series of benchmarks comparing A100 (PCIe Gen4) and H100 (PCIe Gen5) clusters to isolate bottlenecks during cold-start model loading (snapshot restoration).

We found a significant, non-linear degradation in disk throughput on A100 systems when scaling from single-GPU to multi-GPU loading, which does not appear on H100 systems.

The Setup:
We measured the throughput when loading large model snapshots (70GB - 500GB) from local NVMe RAIDs directly to VRAM.

The Results (Throughput in GiB/s):

| Configuration | A100 (Gen4) | H100 (Gen5) |
|:---|:---|:---|
| 1 GPU Load | ~1.71 GiB/s | ~1.57 GiB/s |
| 2 GPU Load | ~0.22 GiB/s | ~1.33 GiB/s |
| 4 GPU Load | ~0.21 GiB/s | ~2.20 GiB/s |
| 8 GPU Load | ~0.25 GiB/s | ~1.12 GiB/s |

Observations:
1. The "Cliff" on A100:On the A100 setup, as soon as we move to parallel loading for 2+ GPUs, throughput crashes by nearly 8x (from 1.7 to 0.2 GiB/s).

2. H100 Stability:The H100 setup maintains (and actually increases) aggregate throughput as we scale to 4 GPUs, likely due to the wider PCIe Gen5 bus handling the concurrent random read requests and interrupts much better.

Hypothesis:
The degradation on A100 seems to be caused by the saturation of the PCIe Gen4 lanes when handling

/r/MachineLearning
https://redd.it/1pj6c33
Giving Back to the Community - The Complete Backend Developer Roadmap

Hey everyone, I am a software developer with years of experience in server side development.

I’ve decided to open my course for free, I hope this helps people.

If you found this content helpful, please consider subscribing to the channel and liking the video so I can post new videos in the future.

Thank you, omri.
Backend Development Roadmap – SQL, Python, APIs, Docker, Kubernetres, Linux, Git & More

/r/Python
https://redd.it/1pj7k1u
Django-q problem

I am making a sort of reminder api with django it would take a message ,a time to start ,the reminder , an interval and the number of times the message should be sent, im using django-q to handle scheduling and I want to output a json payload that would contain the messages the with their timestamps for each time the message was called

/r/djangolearning
https://redd.it/1pia0xd
blank page on python flask project

Im working on a web application with python flask, html, css, bootstrap and sqlite db. I have created the base.html file (instead of index), base_guest.html (extends base) and the login_fron.html (extends base_guest) which is for the login. Even though everything seems to be fine everytime i try to run 127.0.0.1:5000/login nothing appears on my vs code terminal or the web page and when i press ctrl + u to see the source of the page nothing appears on the source. Does anyone have an idea what coulod be wrong. ( "* Serving Flask app 'app'

* Debug mode: on

WARNING: This is a development server. Do not use it in a production deployment. Use a production WSGI server instead.

* Running on http://127.0.0.1:5000

Press CTRL+C to quit

* Restarting with stat

* Debugger is active!

* Debugger PIN: 167-011-435" thats the only thing that appears on my vs code even when i run the web page)

base.html:

<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<noscript>Tasks {% block noscript %}{% endblock %}</noscript>
<link href="https://cdn.jsdelivr.net/npm/bootstrap@5.3.8/dist/css/bootstrap.min.css" rel="stylesheet" integrity="sha384-sRIl4kxILFvY47J16cr9ZwB07vP4J8+LH7qKQnuqkuIAvNWLzeN8tE5YBujZqJLB" crossorigin="anonymous">
</head>
<body>
<div class="container">
<nav class="navbar navbar-expand-lg bg-body-tertiary">
<div class="container-fluid">
<a

/r/flask
https://redd.it/1pj5fpr
django intertia might be the biggest game changer

Have been using it for a bit now when before I had a nextjs app and was using django as our api backend


We ended up trashing the nextjs app and brought it over to inertia so django can be the beautiful monolith it is and its been flawless


thats all. Had to share

/r/django
https://redd.it/1pjapxb
How to make long dropdown options break into multiple lines in Django?

Hi everyone,
I’m facing an issue in my Django project with a dropdown (select field). Some of the options have long text, but instead of wrapping to the next line, the text gets cut off. I’ve already tried several approaches, but none of them worked due to Django’s select widget behavior, which doesn’t seem to allow modifying this easily.

Has anyone dealt with this before or knows a CSS/HTML workaround that works for Django forms or admin? Or maybe an alternative would be to show the full content when hovering over the option?

Thanks in advance!

/r/djangolearning
https://redd.it/1pd3uto
R How does one get "invited talks" or any "talk" for that matter for a published work?

The noscript --- I see PhD students get invited to present their recently published (or even arXiv based) work here and there. How does that work? Do people just reach out to you or do you reach out to people looking for speakers?

In case of the latter, how and where do you find such people? In case of the former, how to get noticed (without best paper awards and chunky publication history)?

P.S. If any of y'all looking for speakers, I'm doing some causal ML stuff.

/r/MachineLearning
https://redd.it/1pjbo1m
This one liner bug fix took 3 hours to identify and understand.

Yesterday I lost two full hours of my life to the most infuriating Django + Celery bug in a freelanced code base.

Issue:
Orders were being created fine.
Related OrderItems (created in a post_save signal) were saving correctly.
The confirmation email Celery task was being sent.
But inside the task, order.items.all() was empty.
Every. Single. Time.

I checked everything:
Signals were connected.
Transaction was committing.
No database replication lag.
Task was running on the same DB.
Even added time.sleep(5) in the task, still no items.

I was one step away from rewriting the whole thing with a service layer and explicit item creation inside the view. Then I looked at the code again:

def create_order(data):
with transaction.atomic():
order = Order.objects.create(**data)

transaction.on_commit(
lambda: send_order_confirmation.delay(order.id)
)

return order


Did you get it?

Turns out this is the classic Python closure-in-loop gotcha, but inside a single function.
The lambda captures the name order, not the value.
By the time the on_commit callback runs (after the transaction

/r/django
https://redd.it/1pjre47
What if groups are not enough for authorization?

In many cases, just a group doesn't give enough information to decide what a user can do or see.

Let's say I'm creating a site for car sharing. For the sake of simplicity, let's say we have administrators, car owners, and drivers. Administrators can do everything, so I'll just ignore those for now.

For a given car, we have different things that various users can do, and that depends on the relation between the user and the specific car/reservation, for example:

\- only the person who owns the car can edit the schedule for sharing it, and assign drivers to free slots in the schedule

\- everyone can request to reserve a slot in the schedule

\- only the owner of the car and the driver who made a reservation, can cancel that reservation

So we need to know the group someone is in, AND whether they are the owner of the current car, or the driver for the current reservation, etc. That makes the standard permissions framework a bit useless.

In the past I've use django-rules for this, but that seems to be poorly maintained. I was wondering how people in general implement this, do you extend the permissions framework somehow? Is there a best practice

/r/django
https://redd.it/1pj8ew3
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/1pjisyw
Python tool to quickly create a nicely animated .gif out of an .stl for communicating ideas wout cad

* **What My Project Does**

takes a 3d model in stl and renders a quick isometric animation about two axes then does a crazy undo thing and loops all nice, just run, select .stl file and boom

* **Target Audience** (e.g., Is it meant for production, just a toy project, etc.

anyone working with 3d models that want to quickly send a visual to a colleague / friend / investor etc.

* **Comparison** (A brief comparison explaining how it differs from existing alternatives.)

I googled around for 5 minutes and it didn't exist in the form I imagined where it just selects a file and plops out a perfectly animated and scaled isometric rotating gif that loops all aesthetically perfectly and yes I did use claude but this is art okay

[https://github.com/adamdevmedia/stl2gif](https://github.com/adamdevmedia/stl2gif)

/r/Python
https://redd.it/1pjklha
Just created a css utility class generator for my admin panel

Features:

* Generates a minified file for CSS utility classes.
* Generates a guide file for quick explaination and for feeding into AI models with as few tokens as possible.
* Compresses with brotli 11 because the main file is massive

[https://github.com/flicksell/css-utils-generator/](https://github.com/flicksell/css-utils-generator/)

Note - since it's something I made for my project, I don't imagine many people being able to use it as-is, but I think this could be an inspiration for something you might build (or vibe code) yourself in an opinionated manner.

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