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 webpath to eliminate API boilerplate

I built webpath for myself. I did showcase it here last time and got some feedback. So i implemented the feedback. Anyway, it uses httpx and jmespath under the hood.

So, why not just use requests or httpx \+ jmespath separately?

You can, but this removes all the long boilerplate code that you need to write in your entire workflow.

Instead of manually performing separate steps, you chain everything into a command:

1. Build a URL with / just like pathlib.
2. Make your request.
3. Query the nested JSON from the res object.

Before (more procedural, stpe 1 do this, step 2 do that, step 3 do blah blah blah)

response = httpx.get("https://api.github.com/repos/duriantaco/webpath")

response.raiseforstatus()
data = response.json()
owner = jmespath.search("owner.login", data)
print(f"Owner: {owner}")

After (more declarative, state your intent, what you want)

owner = Client("https://api.github.com").get("repos", "duriantaco", "webpath").find("owner.login")

print(f"Owner: {owner}")

It handles other things like auto-pagination and caching also. Basically, i wrote this for myself to stop writing plumbing code and focus on the data.

Less boilerplate.

# Target audience

Anyone dealing with apis

If you like to contribute or

/r/Python
https://redd.it/1mg61fl
Venv in vscode

/r/djangolearning
https://redd.it/1mf1a92
But really, why use ‘uv’?

Overall, I think uv does a really good job at accomplishing its goal of being a net improvement on Python’s tooling. It works well and is fast.

That said, as a consumer of Python packages, I interact with uv maybe 2-3 times per month. Otherwise, I’m using my already-existing Python environments.

So, the questions I have are: Does the value provided by uv justify having another tool installed on my system? Why not just stick with Python tooling and accept ‘pip’ or ‘venv’ will be slightly slower? What am I missing here?

Edit: Thanks to some really insightful comments, I’m convinced that uv is worthwhile - even as a dev who doesn’t manage my project’s build process.

/r/Python
https://redd.it/1mfd3ww
Built Fixie: AI Agent Debugger using LangChain + Ollama

Just finished building **Fixie**, an AI-powered debugging assistant that uses multiple specialized agents to analyze Python code, detect bugs, and suggest fixes. Thought I'd share it here for feedback and to see if others find it useful! It's fast, private (runs locally), and built with modularity in mind.

**What My project does:**

* **Multi-agent workflow**: Three specialized AI agents (SyntaxChecker, LogicReasoner, FixSuggester) work together
* **Intelligent bug detection**: Finds syntax errors, runtime issues, and identifies exact line numbers
* **Complete fix suggestions**: Provides full corrected code, not just hints
* **Confidence scoring**: Tells you how confident the AI is about its fix
* **Local & private**: Uses Ollama with Llama 3.2 - no data sent to external APIs
* **LangGraph orchestration**: Proper agent coordination and state management

🎯 **Target Audience**

Fixie is aimed at:

* Intermediate to advanced Python developers who want help debugging faster
* Tinkerers and AI builders exploring multi-agent systems
* Anyone who prefers **local, private AI tools** over cloud-based LLM APIs

It’s functional enough for light production use, but still has some rough edges.

🔍 **Comparison**

Unlike tools like GitHub Copilot or ChatGPT plugins:

* Fixie runs **entirely locally** — no API calls, no data sharing
* Uses a **multi-agent architecture**, with each agent focusing on a specific task

# Example output:

--- Fixie AI Debugger ---


/r/Python
https://redd.it/1mg6cew
Snob: Only run tests that matter, saving time and resources.

What the project does:

Most of the time, running your full test suite is a waste of time and resources, since only a portion of the files has changed since your last CI run / deploy.

Snob speeds up your development workflow and reduces CI testing costs dramatically by analyzing your Python project's dependency graph to intelligently select which tests to run based on code changes.

Target audience:

Python developers tired of long iteration cycles / CI runs.

Comparison:

I don't know of any real alternatives to this that aren't testrunner specific.

Github: https://github.com/alexpasmantier/snob

/r/Python
https://redd.it/1mgf5mu
ANN django‑smart‑ratelimit v0.8.0: Circuit Breaker Pattern for Enhanced Reliability

Major Features

Circuit Breaker Pattern: automatic failure detection and recovery for all backends
Exponential Backoff: smart recovery timing that increases delay on repeated failures
Built‑in by Default: all rate limiting automatically includes circuit breaker protection
Zero Configuration: works out‑of‑the‑box with sensible defaults
Full Customization: global settings, backend‑specific config, or disable if needed

Quality & Compatibility

50+ new tests covering scenarios & edge cases
Complete mypy compliance and thread‑safe operations
Minimal performance overhead and zero breaking changes

Install
pip install django‑smart‑ratelimit==0.8.0

Links
GitHub → https://github.com/YasserShkeir/django-smart-ratelimit

Looking forward to your feedback and real‑world performance stories!

/r/django
https://redd.it/1mgf25x
Seo in django means

I came to know that django is a search engine optimised oriented framework.
What does that means and why is called like that

/r/django
https://redd.it/1mgezor
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/1mfezri
Bash user here, am I missing something with not using python?

Hello, I'm managing a couple of headless servers, and I use bash scripts heavily to manage them. I manage mostly media files with ffmpeg, other apps, copying and renaming... and other apps.

However, whenever I see someone else creating scripts, most of them are in python using api instead of direct command lines. Is python really that better for these kind of tasks compared to bash?

/r/Python
https://redd.it/1mgsnxn
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/1mgylil
django and celery logging

Hi All,

I have logging mostly figured out but...

I made an https logging server which will accept a json payload that can contain information to be logged. It works well mostly but not with one of my django/celery apps. I have to use a custom class to log to https.

I have the django/celery app set to log to console as well as to the https. Every log that is on the console is making it to the https server and into the db.

I am using python logger, have the LOGGING dict in settings.py and it is a pretty standard setup.

Not complete data is logged from background services

I have a custom format but essentially I set up JSON and the message is the msg that comes from the log record.

{"module": "/usr/local/lib/python3.12/site-packages/celery/app/trace.py", "logName": "celery.app.trace", "message": "Task %(name)s[%(id)s] succeeded in %(runtime)ss: %(return_value)s", "function": "info"}

You can see the %s which is not complete with data. Not sure how to even google for ideas on this one.

/r/djangolearning
https://redd.it/1mgd2o8
D What’s the realistic future of Spiking Neural Networks (SNNs)? Curious to hear your thoughts

I’ve been diving into the world of Spiking Neural Networks (SNNs) lately and I’m both fascinated and a bit puzzled by their current and future potential.

From what I understand, SNNs are biologically inspired, more energy-efficient, and capable of processing information in a temporally dynamic way.

That being said, they seem quite far from being able to compete with traditional ANN-based models (like Transformers) in terms of scalability, training methods, and general-purpose applications.

# So I wanted to ask :

Do you believe SNNs have a practical future beyond niche applications?
Can you see them being used in real-world products (outside academia or defense)?
Is it worth learning and building with them today, if I want to be early in something big?
Have you seen any recent papers or startups doing something truly promising with SNNs?

Would love to hear your insights, whether you’re deep in neuromorphic computing or just casually watching the space.

Thanks in advance!

/r/MachineLearning
https://redd.it/1mgocly
A lightweight and framework-agnostic Python library to handle social login with OAuth2

Hey everyone! 👋

I just open-sourced a Python package I had been using internally in multiple projects, and I thought it could be useful for others too.

SimpleSocialAuthLib is a small, framework-agnostic library designed to simplify social authentication in Python. It helps you handle the OAuth2 flow and retrieve user data from popular social platforms, without being tied to any specific web framework.

### Why use it?

Framework-Agnostic: Works with any Python web stack — FastAPI, Django, Flask, etc.
Simplicity: Clean and intuitive API to deal with social login flows.
Flexibility: Consistent interface across all providers.
Type Safety: Uses Python type hints for better dev experience.
Extensibility: Easily add custom providers by subclassing the base.
Security: Includes CSRF protection with state parameter verification.

### Supported providers:

Google
GitHub
Twitter/X (coming soon)
LinkedIn (coming soon)

It’s still evolving, but stable enough to use.
I’d love to hear your feedback, ideas, or PRs! 🙌

Repo: https://github.com/Macktireh/SimpleSocialAuthLib

/r/flask
https://redd.it/1mgrq0f
Help with form and values

I am creating a form where the the choices have a value (int). In the end based on the amount of “points” you would get an answer.

Is it a good idea to use a nested dictionary in the choicefield? So the answers have a value connected to them. Later on I would combine the values for the end result

Also I am seeing this as a multi page form. My plan is to use JS to hide and show parts of the form with a “next” button. And keep it on the same URL. Are there any other ways I’m not familiar with?

Cheers

/r/django
https://redd.it/1mhd033
PicTex v1.0 is here: a declarative layout engine for creating images in Python

Hey r/Python,

A few weeks ago, I [posted](https://www.reddit.com/r/Python/comments/1lwjsar/pictex_a_python_library_to_easily_create_stylized/) about my personal project, `PicTex`, a library for making stylized text images. I'm really happy for all the feedback and suggestions I received.

It was a huge motivator and inspired me to take the project to the next level. I realized the core idea of a simple, declarative API could be applied to more than just a single block of text. So, `PicTex` has evolved. It's no longer just a "text-styler"; it's now a declarative UI-to-image layout engine.

You can still do simple, beautiful text banners easily:

```python
from pictex import Canvas, Shadow, LinearGradient

# 1. Create a style template using the fluent API
canvas = (
Canvas()
.font_family("Poppins-Bold.ttf")
.font_size(60)
.color("white")
.padding(20)
.background_color(LinearGradient(["#2C3E50", "#FD746C"]))
.border_radius(10)
.text_shadows(Shadow(offset=(2, 2), blur_radius=3, color="black"))
)

# 2. Render some text using the template
image = canvas.render("Hello, World! 🎨")

# 3. Save or show the result
image.save("hello.png")
```
Result: [https://imgur.com/a/Wp5TgGt](https://imgur.com/a/Wp5TgGt)

But now you can compose different components together. Instead of just rendering text, you can now build a whole tree of `Row`, `Column`, `Text`, and `Image` nodes.

Here's a card example:

```python
from pictex import *

# 1. Create the individual content builders
avatar

/r/Python
https://redd.it/1mhdbcf
Is mutating the iterable of a list comprehension during comprehension intended?

Sorry in advance if this post is confusing or this is the wrong subreddit to post to

I was playing around with list comprehension and this seems to be valid for Python 3.13.5

(lambda it: [(x, it.append(x+1))[0] for x in it if x <= 10])([0])

it = 0
print((x, it.append(x+1))[0 for x in it if x <= 10])

The line above will print a list containing 0 to 10. The part Im confused about is why mutating it is allowed during list comprehension that depends on it itself, rather than throwing an exception?

/r/Python
https://redd.it/1mhdjdc
A free goldmine of tutorials for the components you need to create production-level agents
Extensive

I’ve worked really hard and launched a FREE resource with 30+ detailed tutorials for building comprehensive production-level AI agents, as part of my Gen AI educational initiative.

The tutorials cover all the key components you need to create agents that are ready for real-world deployment. I plan to keep adding more tutorials over time and will make sure the content stays up to date.

The response so far has been incredible! (the repo got nearly 10,000 stars in one month from launch - all organic) This is part of my broader effort to create high-quality open source educational material. I already have over 130 code tutorials on GitHub with over 50,000 stars.

I hope you find it useful. The tutorials are available here: https://github.com/NirDiamant/agents-towards-production

The content is organized into these categories:

1. Orchestration
2. Tool integration
3. Observability
4. Deployment
5. Memory
6. UI & Frontend
7. Agent Frameworks
8. Model Customization
9. Multi-agent Coordination
10. Security
11. Evaluation
12. Tracing & Debugging
13. Web Scraping

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