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
Template for django-ninja?

I've been wanting to try Django ninja for some AI app that I'm trying tk build, because of its async support. However, I could not find an extensive template that shows all the batteries included for Django ninja. Can anybody recommend such template?

/r/django
https://redd.it/1nlwoo4
Tines API Wrapper

Links

PyPI: https://pypi.org/project/Tapi/
GitHub: https://github.com/1Doomdie1/Tapi
Pepy.tech: stats

So what is Tines?

In short, Tines is a no-code automation platform designed for security and IT teams. It allows users to build, orchestrate, and automate workflows such as incident response, threat detection, and IT operations without needing to write code. By connecting to APIs and tools, Tines helps streamline repetitive tasks, reduce response times, and improve operational efficiency. Althought it is marketed as a "no-code" solution, that doesn't mean it doesn't have the ability to run code. Quite the opposite, it provides you with a dedicated action which allows you to write and execute your own python code.

What My Project Does

I created Tapi as a Python wrapper for the Tines API. Rather than dealing with raw HTTP requests or parsing JSON by hand, Tapi provides structured classes like WorkflowsAPI, ActionsAPI, CredentialsAPI, and others. These give you a clean way to interact with your Tines tenant and its endpoints.

Examples

Pulling information about your tenant would look somehting like this:

from json import dumps
from tapi import TenantAPI

def main():
DOMAIN = "my-cool-domain-1234"


/r/Python
https://redd.it/1nlze8r
How to force my Flask app to always use English?

import os
from app.route import (
basic_input_route,
graph_investment_route,
graph_salary_growth_route,
pension_summary_route,
)
from flask import Flask, g, request
from flask_babel import Babel
from setup_secret import setup_secret
from extensions import db, csrf


def create_app(test_config=None):
app = Flask(__name__)
setup_secret()
secret_key = os.environ.get("SECRET_KEY")
if not secret_key:
raise RuntimeError(
"SECRET_KEY not found! Run setup_secret() or create a proper .env file."
)
app.config["SECRET_KEY"] = secret_key
app.config["SQLALCHEMY_DATABASE_URI"]

/r/flask
https://redd.it/1nmal6o
Improving the performance of Python/Django project with the help of Go?

In my work I use Django and I love it because I've been able to deliver some projects very quickly thanks to it providing an easy structure to follow and compose, but I've been learning Go recently and I've loved how efficient it can be, I was thinking of trying to rewrite some jobs I have in celery to Go to see if there's any improvement in performance, since we use VPS and before scaling I would like to see if Go can help us support more work with the current resources.

I would like to know if you have had experience integrating Go into Python or Django projects especially, and what you have discovered and how you have done it.

/r/django
https://redd.it/1nm8ij0
Sunday Daily Thread: What's everyone working on this week?

# Weekly Thread: What's Everyone Working On This Week? 🛠️

Hello /r/Python! It's time to share what you've been working on! Whether it's a work-in-progress, a completed masterpiece, or just a rough idea, let us know what you're up to!

## How it Works:

1. Show & Tell: Share your current projects, completed works, or future ideas.
2. Discuss: Get feedback, find collaborators, or just chat about your project.
3. Inspire: Your project might inspire someone else, just as you might get inspired here.

## Guidelines:

Feel free to include as many details as you'd like. Code snippets, screenshots, and links are all welcome.
Whether it's your job, your hobby, or your passion project, all Python-related work is welcome here.

## Example Shares:

1. Machine Learning Model: Working on a ML model to predict stock prices. Just cracked a 90% accuracy rate!
2. Web Scraping: Built a script to scrape and analyze news articles. It's helped me understand media bias better.
3. Automation: Automated my home lighting with Python and Raspberry Pi. My life has never been easier!

Let's build and grow together! Share your journey and learn from others. Happy coding! 🌟

/r/Python
https://redd.it/1nmdhrp
super lightweight stateful flow

What My Project Does

A lightweight AI-Ready Python framework for building asynchronous data processing pipelines with stateful nodes.

Target Audience

Those who wants to build AI application backends or lightweight data process backends. The project is not massivly tested in production.

Comparison

Compared to hamilton, airflow, pydag, etc., OoFlow is super lightweight and has very easy to use APIs, no restrictions on code positions, and its nodes/tasks are stateful, enabling cross-messages business logic.

\----------------------------------------------

when i was building new applications(some were AI related), i found the programming paradigm changed, because the first token/byte of each phase deeply affect user experiences.

i had to make every step processing data asynchronous, stateful, parallel.

"""
Flow topology diagram:
A


B
╱ ╲
▼ ▼
C D
╲ ╱

E
"""


/r/Python
https://redd.it/1nmgr3q
pyya - integrate YAML configurations with your code easily

Updated to v0.1.9. Added a CLI tool to generate stubs for YAML configuration, now attribute style configuration has nice completion suggestions assuming you have setup mypy/python LSP.

Install:
pip install pyya

Page:
https://github.com/shadowy-pycoder/pyya

Features:

1) Automatically merge default and production configuration files
2) Convert keys in configuration files to snake_case
3) YAML validation with Pydantic models
4) Generate stub files for your dynamic configuration with pyya CLI tool.
5) Simple API

/r/Python
https://redd.it/1nmo8hl
duvc-ctl Windows library for UVC camera control and Property control

I made this for controlling USB cameras on Windows without needing any extra SDKs or serial controls for PTZ. It’s called duvc-ctl. Supports C++, Python(other languages support coming soon), and a CLI for adjusting pan/tilt/zoom(ptz), focus, exposure, and other camera properties.

https://github.com/allanhanan/duvc-ctl

What my project does:
Control camera properties such as Brightness, Exposure, Pan, Tilt, Zoom, and other camera properties available in DirectShow
It exposes the DirectShow api to access these properties easily in C++ and binds it to python

Linux already has v4l2-ctl which is waay better but windows was lacking

Would be interested to hear if others find this useful or have ideas for where it could fit into workflows.

I personally found this useful where I didn't want to mess with visca or other serial protocols and just wanted to control it from python with just the usb connected

I might add linux support but I'm open to hear any opinions on this for now

/r/Python
https://redd.it/1nmio5b
I built a full programming language interpreter in Python based on a meme

The project started as a joke based on the "everyone talks about while loops but no one asks WHEN loops" meme, but evolved into a complete interpreter demonstrating how different programming paradigms affect problem-solving approaches.

# What My Project Does

WHEN is a programming language interpreter written in Python where all code runs in implicit infinite loops and the only control flow primitive is when conditions. Instead of traditional for/while loops, everything is reactive:

# WHEN code example
count = 0

main:
count = count + 1
print("Count:", count)
when count >= 5:
print("Done!")
exit()

The interpreter features:

Full lexer, parser, and AST implementation
Support for importing Python modules directly
Parallel and cooperative execution models
Interactive graphics and game development capabilities (surprisingly)

You can install it via pip: pip install when-lang

# Target Audience

This is Currently a toy/educational project, but exploring use cases in game development, state machine modeling,

/r/Python
https://redd.it/1nmta0f
Python 3.13 is 10% slower than 3.12 for my file parser

I have written a custom parser for a game-specific file format.

It performs particularly bad when there's too many nested references (A reference to a different object in an object), but that's a different problem on its own.

The current problem I have is with the performance degradation by almost 10% when using Python 3.13. I am trying to figure out what changes happened in 3.13 that might be relevant for my issue.

I should probably attach the concrete code, so here is the method in question.

/r/Python
https://redd.it/1nmuy7t
filter on model

Hello, in my template i have some filters to filter items basing on each item property. Now I need to add a checkbox called "flat" which only shows items if the heel_height property value is equal to 0.

i created flat() method on models.py


class Shoe(models.Model):
    heelheight = models.IntegerField(default=0, blank=False, null=False)
    def flat(self):
        if self.heel
height == 0:
            return True
        else:
            return False


I added that field to the forms.py

class SearchForm(ModelForm):
     class Meta:
         model = Shoe
         fields = 'season', 'color', 'size', 'flat',


and i added it to my existing searchform on template

            <div class="fieldWrapper">
   

/r/django
https://redd.it/1nmqguj
📝 Focused on what I love: building and growing things📈.It's rewarding to see an idea come to life on the web. Excited about the projects ahead and always looking to learn from others in the field😊 #GrowthMindset #Tech #Innovation #PassionForWork #DigitalMarketing #WebDevelopment #OnlinePresenc

/r/django
https://redd.it/1nmna3h
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/1nn7o0l
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/1nn7o08
My flask web page is a blank page

Hello, I'm trying a small start with flask and web tools, I wrote a small code contain the main Flask, HTML, CSS and JS, but all i see is a white page, i tried changing the browsers but it didn't work, what could be the problem? this is my code :

Project structure :

FLASKTEST/
test.py

├── templates/
│ index.html
└── static/
style.css
script.js

**test.py** file :

from flask import Flask, rendertemplate

app = Flask(name)

@app.route("/")
def home():
return render
template("index.html")

if name == "main":
app.run(debug=True)

index.html file :

<!DOCTYPE html>
<html lang="en">
<head>


/r/flask
https://redd.it/1nmxhe5
Do you find it helpful to run Sphinx reStructuredText/Markdown in a browser?

I’ve been thinking a lot about documentation workflows lately. Sphinx is super powerful (and pretty much the standard for Python), but every time I try to onboard someone new, the initial “install + configure” step feels like a wall.

For example, if you just want to:

Test how reStructuredText or MyST Markdown renders
Show a student how Sphinx works
Experiment with docs-as-code quickly
Quickly see the resulting HTML when styling Sphinx themes

…you still need a local setup, which isn’t always trivial. Has anyone else struggled with this? How do you usually get around the “first steps” friction when teaching or experimenting with Sphinx?

(I’ve been tinkering with a little experiment in running full, latest Sphinx completely in a browser using WebAssembly — will share it in the comments if anyone’s curious.)

/r/Python
https://redd.it/1nmycfj
Trying to GET data from my DB using modal form

i want to be able to pull a data i just sent to my database using modal form to my FE. i am able to post the data from my FE to the database, but where i have an issue is if i reload the page, the page is supposed to GET the data from the DB and display it, but it doesn't. i'm pretty sure it might be something minor i'm missing but i haven't been able to solve it despite hours of debugging.

EDIT: Here's the Flask code

import datetime as dt
from flask import Flask,rendertemplate, request, urlfor
from flaskcors import CORS
import db


app = Flask(name)
CORS(app)

today =
dt.datetime.today()
# gets the data of every registered user including name and date of birth etc.
saved
birthdays= db.DateOfBirth.objects().all()



# This is the home page route to to show the active Birthdays


/r/flask
https://redd.it/1nnjihb
We just launched Leapcell, deploy 20 Python websites for free

hi r/Python

Back then, I often had to pull the plug on side projects built with Python, the hosting bills and upkeep just weren’t worth it. They ended up gathering dust on GitHub.

That’s why we created **Leapcell**: a platform designed so your Python ideas can stay alive without getting killed by costs in the early stage.

**Deploy up to 20 Python websites or services for free (included in our free tier)**
Most PaaS platforms give you a single free VM (like the old Heroku model), but those machines often sit idle. Leapcell takes a different approach: with a serverless container architecture, we fully utilize compute resources and let you host multiple services simultaneously. While other platforms only let you run one free project, Leapcell lets you run up to **20 Python apps** for free.

And it’s not just websites, your Python stack can include:

* Web APIS: Django, Flask, FastAPI
* Data & automation: Playwright-based crawlers
* APIs & microservices: lightweight REST or GraphQL services

We were inspired by platforms like Vercel (multi-project hosting), but Leapcell goes further:

* **Multi-language support:** Django, Node.js, Go, Rust.
* **Two compute modes**
* ***Serverless***: cold start < 250ms, autoscaling with traffic (perfect for early-stage Django apps).
*

/r/Python
https://redd.it/1nnh6g0
Why Django is the best backend framework for the startup and mvp projects ?

I’m a startupper. I really like using Django for this kind of projects. It’s too fast and comfortable to develop. Why do you choose Django for the MVPs ? How Django’s helped you to solve your problems ?

/r/django
https://redd.it/1nno0uk
D&D Twitch bot: Update 2!

Hello! So I posted awhile back that I was making a cool twitch bot for my chatters themed on D&D and wanted to post another update here! (OG post) https://www.reddit.com/r/Python/comments/1mt2srw/dd\_twitch\_bot/

My most current updates have made some major strides!

1.) Quests now auto generate quest to quest, evolving over time at checkpoints and be much more in depth overall. Giving chatters a better story, while also allowing them multiple roll options with skill rolls tied into each class. (Things like barbarians are bad at thinking, but great at smashing! So they might not be the best at a stealth mission in a China shop...)

2.) The bot now recognizes new chatters and greets them with fanfare and a little "how to" so they are not so confused when they first arrive. And the alert helps so I know they are a first time chatter!

3.) I got all the skill rolls working, and now they are showing and updated in real time on the display. That way chatters can see at all times which skills are the best for this adventure they are on!

4.) Bosses now display across

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