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
OneCode — Python library to turn scripts into deployable apps

# What My Project Does

OneCode is an open-source Python library that lets you convert your scripts to apps with minimal boilerplate. Using simple decorators/parameters, you define inputs/outputs, and OneCode automatically generates a UI for you.

Github link is here: https://github.com/deeplime-io/onecode

On OneCode Cloud, those same apps can be deployed instantly, with authentication, scaling, and access controls handled for you.

The cloud platform is here: https://www.onecode.rocks/ (free tier includes 3 apps, 1Gb of storage and up to 5 hours of compute).

OneCode allows you to run the same code locally or on the cloud platform (one code ;)). You can connect your github account and automatically sync code to generate the app.

# Target Audience

Python developers who want to share tools without building a web frontend
Data scientists / researchers who need to wrap analysis scripts with a simple interface
Teams that want internal utilities, but don’t want to manage deployment infrastructure
Suitable for production apps (access-controlled, secure), but lightweight enough for prototyping and demos.

# Comparison

Unlike Streamlit/Gradio, OneCode doesn’t focus on dashboards, instead it auto-generates minimal UIs from your function signatures. OneCode cloud is also usable with long running compute, big machines are available, and compute is scalable with the number of users.
Unlike

/r/Python
https://redd.it/1nvvsub
Snakebar — a tqdm-style progress bar that snakes across your terminal

## What My Project Does
Snakebar is a tqdm-like progress bar for Python. Instead of a plain horizontal bar, it draws a one-character snake that fills your terminal via a random space-filling curve.
It still reports percentage, iterations done, ETA, and rate (it/s), but makes waiting more fun.

## Target Audience
Anyone who runs long scripts, pipelines, or training loops — data scientists, ML engineers, researchers, developers with heavy ETL or simulations.
It’s meant as a lightweight library you can drop in as a direct replacement for tqdm. It’s production-ready but also works fine as a fun toy project in personal scripts.

## Comparison
Compared to tqdm:
- Same semantics (snake_bar works like tqdm).
- Still shows % complete, ETA, and rate.
- Instead of a static bar, progress is visualized as a snake filling the screen.
- Fits automatically to your terminal size.

## Installation
  
pip install snakebar


## Links
- PyPI: https://pypi.org/project/snakebar/
- GitHub: https://github.com/majoburo/snakebar
- License: MIT

/r/Python
https://redd.it/1nwhdmt
How safe is building my own login VS using Flask-Login extension?

Someone said that Flask session can be easily hacked via console and, depending on the implementation, they can inject a user's detail to impersonate them. How real is this?

I don't like much Flask-Login, feels limiting and weird... but I might be the one weird for this lol.

/r/flask
https://redd.it/1nwjw0d
Django Forms Lifecycle

class ContractItemForm(forms.ModelForm):
product = forms.ModelChoiceField(
queryset=Product.objects.none(), # start with no choices
required=True,
)

class Meta:
model = ContractItem
fields = ['product']

def __init__(self, *args, **kwargs):
super().__init__(*args, **kwargs)

# default: empty queryset
self.fields['product'].queryset = Product.objects.none()

# if editing an existing instance, allow that one product
if self.instance and self.instance.pk and self.instance.product_id:


/r/django
https://redd.it/1nw7763
Where to find clients for a software consulting team?

Hi everyone! 👋
We are a Python team (5–8 developers). We are finishing a big project now and want to start a new one.

Do you know where to find consulting projects or RFPs?

/r/django
https://redd.it/1nw818t
Frankenstyle - No-buid, value-driven, fully responsive, utility-first CSS framework.
https://franken.style/

/r/django
https://redd.it/1nwse84
Friday Daily Thread: r/Python Meta and Free-Talk Fridays

# Weekly Thread: Meta Discussions and Free Talk Friday 🎙️

Welcome to Free Talk Friday on /r/Python! This is the place to discuss the r/Python community (meta discussions), Python news, projects, or anything else Python-related!

## How it Works:

1. Open Mic: Share your thoughts, questions, or anything you'd like related to Python or the community.
2. Community Pulse: Discuss what you feel is working well or what could be improved in the /r/python community.
3. News & Updates: Keep up-to-date with the latest in Python and share any news you find interesting.

## Guidelines:

All topics should be related to Python or the /r/python community.
Be respectful and follow Reddit's Code of Conduct.

## Example Topics:

1. New Python Release: What do you think about the new features in Python 3.11?
2. Community Events: Any Python meetups or webinars coming up?
3. Learning Resources: Found a great Python tutorial? Share it here!
4. Job Market: How has Python impacted your career?
5. Hot Takes: Got a controversial Python opinion? Let's hear it!
6. Community Ideas: Something you'd like to see us do? tell us.

Let's keep the conversation going. Happy discussing! 🌟

/r/Python
https://redd.it/1nwk7ps
Help! Flask template variable errors using tojson—const object causing 8 "errors"

Hi all,
I’m making a Flask app that renders an HTML form with JavaScript for interactive coupon discounts. I want to pass a Python object from Flask to my template and use it for calculations in the frontend JS

https://preview.redd.it/f3otwg2qolsf1.png?width=2880&format=png&auto=webp&s=eda8890ac98c3aecbb4ad113e448f1aae4fee3c1



/r/flask
https://redd.it/1nvq6u4
Looking for a paid/unpaid software engineering internship.

Hey, I'm Youseph Zidan. I'm a Software Engineer with a track record of delivering over 25 freelance projects, including high-performance web scrapers and data pipelines. My practical skills are supported by a strong foundation in core programming principles, which I've honed through both development and teaching Python. For over a year, I have accelerated my growth through intensive mentorship from a Senior Engineer at a leading Silicon Valley tech company, focusing on industry best practices in system design and code architecture. I am eager to apply this unique blend of a builder's mindset, strong fundamentals, and high-level insight to a collaborative engineering team.

I recently developed a solution to a technical challenge I encountered: accurately downloading Street View panoramas. My project, Gspv-dl, is my take on building the most precise and reliable tool for this task.

My personal portfolio website: Portfolio

/r/flask
https://redd.it/1nwyqfy
R New paper: LLMs don't have privileged self knowledge, which means we can efficiently train a General Correctness Model to predict the correctness of multiple models. Surprising or expected?

Quick paper highlight (adapted from TLDR thread):
Finds no special advantage using an LLM to predict its own correctness (a trend in prior work), instead finding that LLMs benefit from learning to predict the correctness of many other models – becoming a GCM.
\--
Training 1 GCM is strictly more accurate than training model-specific CMs for all models it trains on (including CMs trained to predict their own correctness).
GCM transfers without training to outperform direct training on OOD models and datasets.
GCM (based on Qwen3-8B) achieves +30% coverage on selective prediction vs much larger Llama-3-70B’s logits.

TLDR thread: https://x.com/hanqi\_xiao/status/1973088476691042527
Full paper: https://arxiv.org/html/2509.24988v1

Discussion Seed:
Previous works have suggested / used LLMs having self knowledge, e.g., identifying/preferring their own generations [https://arxiv.org/abs/2404.13076\], or ability to predict their uncertainty. But paper claims specifically that LLMs don't have knowledge about their own correctness. Curious on everyone's intuition for what LLMs have / does not have self knowledge about, and whether this result fit your predictions.

Conflict of Interest:
Author is making this post.

/r/MachineLearning
https://redd.it/1nwoxqz
PEP 810 – Explicit lazy imports

PEP: https://pep-previews--4622.org.readthedocs.build/pep-0810/

Discussion: https://discuss.python.org/t/pep-810-explicit-lazy-imports/104131

This PEP introduces lazy imports as an explicit language feature. Currently, a module is eagerly loaded at the point of the import statement. Lazy imports defer the loading and execution of a module until the first time the imported name is used.

By allowing developers to mark individual imports as lazy with explicit syntax, Python programs can reduce startup time, memory usage, and unnecessary work. This is particularly beneficial for command-line tools, test suites, and applications with large dependency graphs.

The proposal preserves full backwards compatibility: normal import statements remain unchanged, and lazy imports are enabled only where explicitly requested.

/r/Python
https://redd.it/1nx0oxk
pyya - Simple tool that converts YAML/TOML configuration files to Python objects

New version 0.1.11 is ready, now pyya can convert and validate configuaration from TOML files. In the previous version, I also added a CLI tool to generate stub files from your YAML/TOML configuaration fil, so that tools like mypy can validate type hints and varoius LSPs can autocomplete dynamic attribute-style dictionary. Check README for more info. Contributions/suggestions are welcome as always.

Check GitHub Page: https://github.com/shadowy-pycoder/pyya
Check PyPi Page: https://pypi.org/project/pyya/

/r/Python
https://redd.it/1nwv8re
Real-time application with Django

lately, I created a helpdesk app, I used Django rest framework and vue js
there is a chat app in this helpdesk and I have to use websocket for a real time experience with the chat
the problem is that I don't really know how I am supposed to do that
I've heard about django channels but I have no idea of how it works
Can somebody explain the role of a consumer, asgi and routing in all of this ?
I'm kinda lost with all this stuff



/r/django
https://redd.it/1nwx3b2
Python Library for GUI

Hey, I am making a software application for a school assignment that takes in csv files and reads them to display different statistics and whatnot for the user. I'm going to use pandas to manipulate the CSV files but was wondering what library I should use for the GUI. I have used python but very little GUI, so I am not sure what would be good for this specific application.

/r/Python
https://redd.it/1nx8jon
Django hard to do real time.

I love django but i hate when it comes to real time updates and chat apps, it just sucks, the whole setup feels messy and confusing, its so easy in ruby on rails and even laravel now with new updates, Django should also make it easy apply

I know i can use node js or go as separate for only websockets but what do so you use ?

/r/django
https://redd.it/1nx7k8k
PyThermite - Rust backed object indexer

Attention ⚠️ : NOT another AI wrapper

Beta released today - open to feedback - especially bugs

https://github.com/tylerrobbins5678/PyThermite

https://pypi.org/project/pythermite/

-what My Project Does

PyThermite is a rust backed python object indexer that supports nested objects and queries with real-time data. In plain terms, this means that complex data relations can be conveyed in objects, maintained state, and queried easily. For example, if I have a list of 100k cars in a city and want to get a list of cars moving between 20 and 40 mph and the owner of the car is named "Jim" that was born after 2005, that can be a single built query with sub 1 ms response. Keep in mind that the cars speed is constantly changing, updating the data structures as it goes.

In testing, its significantly (20- 50x) faster than pandas dataframe filtering on a data size of 100k. Query time complexity is roughly O(q + r) where q is the amount of query operations (and, or, in, eq, gt, nesting, etc) and r is the result size.

The cost to index is defined paid and building the structure takes around 6-7x longer than a dataframe consuming a list, but definitely worth it if the data is queried more

/r/Python
https://redd.it/1nwnr98
TorchSystem: Event driven systems with PyTorch

**What My Project Does**

While doing deep learning experiments, I noticed that it is very hard to write reusable code for training models. There are packages that help track metrics, logs, and checkpoints, but they often create more problems than they solve. As a result, training pipelines become bloated with infrastructure code that obscures the actual business logic.

That’s why I created **TorchSystem** a package designed to help you build extensible training systems using domain-driven design principles, to replace ugly training scripts with clean, modular, and fully featured training services, with type annotations and modern python syntax.

**Repository**: [https://github.com/entropy-flux/TorchSystem](https://github.com/entropy-flux/TorchSystem)

**Documentation**: [https://entropy-flux.github.io/TorchSystem/](https://entropy-flux.github.io/TorchSystem/)

**Full working example**: [https://github.com/entropy-flux/TorchSystem/tree/main/examples/mnist-mlp](https://github.com/entropy-flux/TorchSystem/tree/main/examples/mnist-mlp)

**Target Audience**

* ML engineers building **complex training pipelines** who need modularity.
* Researchers experimenting with **custom training loops** without reinventing boilerplate.
* Developers who want **DDD-inspired architecture** in their AI projects.
* Anyone frustrated with hard-to-maintain "script soup" training code.

**Comparison**

* [pytorch-lightning](https://github.com/Lightning-AI/pytorch-lightning): There aren't any framework doing this, [pytorch-lightning](https://github.com/Lightning-AI/pytorch-lightning) come close by encapsulating all kind of infrastructure and the training loop inside a custom class, but it doesn't provide a way to actually decouple the logic from the implementation details. You can use a `LightningModule` instead of my `Aggregate` class, and use the whole the message system of the library to bind it with

/r/Python
https://redd.it/1nxcxox
Saturday Daily Thread: Resource Request and Sharing! Daily Thread

# Weekly Thread: Resource Request and Sharing 📚

Stumbled upon a useful Python resource? Or are you looking for a guide on a specific topic? Welcome to the Resource Request and Sharing thread!

## How it Works:

1. Request: Can't find a resource on a particular topic? Ask here!
2. Share: Found something useful? Share it with the community.
3. Review: Give or get opinions on Python resources you've used.

## Guidelines:

Please include the type of resource (e.g., book, video, article) and the topic.
Always be respectful when reviewing someone else's shared resource.

## Example Shares:

1. Book: "Fluent Python" \- Great for understanding Pythonic idioms.
2. Video: Python Data Structures \- Excellent overview of Python's built-in data structures.
3. Article: Understanding Python Decorators \- A deep dive into decorators.

## Example Requests:

1. Looking for: Video tutorials on web scraping with Python.
2. Need: Book recommendations for Python machine learning.

Share the knowledge, enrich the community. Happy learning! 🌟

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