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
Any recommendations for an open source Flask repo using pytorch?

Hi, I'd like to play around with some open source Flask project that is using pytorch under the hood. I'm working on a build system and I'd like to test it out with apps that are huge packages like pytorch.



/r/flask
https://redd.it/1ijq279
DjangoMatrix.com - A project I've built in couple of weeks

Hey guys,

just wanted to share with you a project I've built with Django in the last couple of weeks.

The project is about being a one-stop-shop for everything related to Django packages, versioning, compatibilities etc.

You can find more detailed information on the r/Django post I've posted a while ago.

Given that it is open-source, you can scour trough the code and maybe get an "Aha!" moment.
(I'm not saying this is the perfect codebase (or project) I've built, but rather one that I've managed to build and deploy in very little time, and hoping if it gets some traction - we can do many, many improvements!)

p.s. All contributions are welcomed! Feel free to make a PR or report an Issue in the Github repository.

Check it out:
👉 DjangoMatrix.com
👉 GitHub Repository

/r/djangolearning
https://redd.it/1ij1t56
Seniors of django, how did learn the framework?

Hey everyone,

I’m 24 and trying to learn Django, but I’ve been struggling a lot. I have a background in computer engineering and some coding knowledge, but I lack job experience. Whenever I try to study or work on projects, I get tired quickly and lose focus. I also tend to underestimate my skills, which makes learning feel even harder.

On top of that, I feel really alone in this process. I don’t have a support system of people who understand what I’m going through, and I can’t use freelance platforms due to my location. All of this makes it hard to stay motivated, especially when I don’t see immediate progress.

I’m wondering if anyone has been in a similar situation. How do you push through when you feel isolated and discouraged? How do you deal with feeling like you’re not good enough, even when logically you know you’re making progress? Any tips for managing fatigue while studying?

I’d really appreciate any advice or encouragement. Thanks in advance!

P.s: I am interested in coding and developing.



/r/django
https://redd.it/1ijvisj
PyPy v7.3.18 release

>Here's the blog post about the PyPY 7.3.18 release that came out yesterday. Thanks to @matti-p.bsky.social, our release manager! This the first version with 3.11 support (beta only so far). Two cool other features in the thread below.

https://pypy.org/posts/2025/02/pypy-v7318-release.html

/r/Python
https://redd.it/1ijrewd
Handling Multiple Request of Streaming Responses for a Flask App?

Hi,

I'm using Flask for API end points. Front end is just a static site.
I'm currently just on the basic paid tier of pythonanywhere with 2 web workers.
For simple API calls, it is enough.

But currently, I'm implementing a chat gpt streaming completion which takes from 3 to 10 seconds.
With multiple requests, the third user will have to wait for the other user to finish, since there are only 2 web workers. And for the 4th user onwards, I think that would feel like an eternity lol


An obvious solution is to increase the web workers but I only have intermittent multiple request. I don't want to pay for multiple web workers that don't get used.

How do I go about this in pythonanywhere or should I just switch to a different provider? Can you recommend one that allows me to just use a web worker based on demand?

/r/flask
https://redd.it/1ijdfis
init() takes 1 positional argument but 3 were given

Someone Help please I don't know why my code is running on Juptyer

\# DASH Framework for Jupyter

from jupyter_dash import JupyterDash

from dash import dcc

from dash import html

from dash.dependencies import Input, Output

from pymongo import MongoClient

from bson.json_util import dumps

\# URL Lib to make sure that our input is 'sane'

import urllib.parse

\#TODO: import for your CRUD module

from aac_crud import AnimalShelter

\# Build App

app = JupyterDash("ModuleFive")

app.layout = html.Div([

\# This element generates an HTML Heading with your name

html.H1("Module 5 Asssignment - Stephanie Spraglin"),

\# This Input statement sets up an Input field for the username.

dcc.Input(

id="input_user".format("text"),

type="text",

placeholder="input type {}".format("text")),

\# This Input statement sets up an Input field for the password.

\# This designation masks the user input on the screen.

dcc.Input(

id="input_passwd".format("password"),

type="password",

placeholder="input type {}".format("password")),

\# Create a button labeled 'Submit'. When the button is pressed

\# the n_clicks value will increment by 1.

html.Button('Submit', id='submit-val', n_clicks=0),

\# Generate a horizontal line separating our input from our

\# output element

html.Hr(),

\# This sets up the output element for the dashboard. The

\# purpose of the stlye option is to make sure that the

\# output will function like a regular text area and accept

\# newline ('\\n') characters as line-breaks.

html.Div(id="query-out", style={'whiteSpace': 'pre-line'}),

\#TODO: insert unique identifier code here. Please Note:

\# when you insert another HTML element here, you will need to

\# add a comma to

/r/flask
https://redd.it/1ijja7g
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/1ik9pae
Unable to understand flask

Im a beginner in computer science with some experience in pandas, matplotlib, scikit-learn and decided to learn backend.
I started a tutorial and finished it. Did the coding along with tutorial, but I couldn’t understanding why the things are happening like how is things being done under the hood like factory template, user authentication etc , especially flask-sqlalchemy.

I try to read documentation for any issue or thing i wanna implement and do. The sql-alchemy documentation is really shit and I can’t get anything out of it.
As for flask whatever i open has way too many things and everything goes side ways.

In the end i ask gpt to help me and teach me. And it kinda does work, and i understand a bit. But I don’t understand how the underlying things work.
Question is since I’ve completed the tutorial, how can i improve and learn flask very well and understand backend concepts deeply. I am thinking of doing this side by side along with my uni for next four months.

Should i just try to build different projects with the help of gpt or not. I can’t really understand.

/r/flask
https://redd.it/1ik44h2
Best way to get better at practical Python coding

I've noticed a trend in recent technical interviews - many are shifting towards project-based assessments where candidates need to build a mini working solution within 45 minutes.

While we have LeetCode for practicing algorithm problems, what's the best resource for practicing these types of practical coding challenges? Looking for platforms or resources that focus on building small, working applications under time pressure.

Any recommendation is much appreciated!

(Update: removed the website mentioned, not associated with it at all :) )

/r/Python
https://redd.it/1ik0tw7
I have published FastSQLA - an SQLAlchemy extension to FastAPI

Hi folks,

I have published FastSQLA:

Documentation: [https://hadrien.github.io/FastSQLA/](https://hadrien.github.io/FastSQLA/)
Github repo: https://github.com/hadrien/fastsqla

# What is it?

FastSQLA is an SQLAlchemy 2.0+ extension for FastAPI.

It streamlines the configuration and async connection to relational databases using SQLAlchemy 2.0+.

It offers built-in & customizable pagination and automatically manages the SQLAlchemy session lifecycle following SQLAlchemy's best practices.

It is licenced under the MIT Licence.

# Comparison to alternative

fastapi-sqla allows both sync and async drivers. FastSQLA is exclusively async, it uses fastapi dependency injection paradigm rather than adding a middleware as fastapi-sqla does.
fastapi-sqlalchemy: It hasn't been released since September 2020. It doesn't use FastAPI dependency injection paradigm but a middleware.
SQLModel: FastSQLA is not an alternative to SQLModel. FastSQLA provides the SQLAlchemy configuration boilerplate + pagination helpers. SQLModel is a layer on top of SQLAlchemy. I will eventually add SQLModel compatibility to FastSQLA so that it adds pagination capability and session management to SQLModel.

# Target Audience

It is intended for Web API developers who use or want to use python 3.12+, FastAPI and SQLAlchemy 2.0+, who need async only sessions and who are looking to following SQLAlchemy best practices, latest python, FastAPI & SQLAlchemy.

I use it in production on revenue-making projects.

# Feedback wanted

I would love to get feedback:

Are there

/r/Python
https://redd.it/1ikhmtd
Best approach for searching and filtering data?

Hello everyone,

I'm currently developing an Angular/Django application that heavily relies on searching and filtering data. I'm trying to determine the best approach for implementing these features efficiently. Here’s how the app needs to work:

1. Users will have access to an "advanced filtering" option with almost 50 different filters.
- Many of these filters are dropdowns representing the keys of related models.
- The remaining filters are text-based, allowing users to enter keywords or phrases.

For the text-based search filters, I need to be able to handle spelling errors and find matches even when the word order differs (e.g., "large, green, and heavy" vs. "heavy, green, and large"). Also, some text inputs will need to be searched across multiple columns.

2. The app will have two search modes: first one will return only the results that match 100% of the user's filters. The other mode will need to use a scoring system, ranking results by their relevance (e.g., 100% matches first, followed by 90%, 80%, etc.).

3. The table in question has around 3.000 records.

I would love some suggestions about how to implement this, will Django filters be enough? What would be the best way to handle the weighted search? Any recommendations on handling fuzzy search

/r/djangolearning
https://redd.it/1iik49d
Getting information about the fields of a django rest framework view

I'm currently working in a django rest framework project in which users are able to create projects, in the project they can select certain options and assign other users as members. This works fine, but only if you assume the front end already has information about what choices the user can select in each field, including the field where they can select other users (limited to their company). Is there a easy/standard way to give this "form" information to the front end app? What fields are present and their respective types, which ones are mandatory, choices available for each field, etc? I assume there is as this information is present in the browsable API, but I'm not sure how to access it or how to limit the user choices in a given field correctly

Am I supposed to use Metadata for this? If so, how?

/r/djangolearning
https://redd.it/1iir837
A Lightweight Camera SDK for Windows, macOS, and Linux

If you’re looking for a lightweight alternative to OpenCV for camera access on Windows, Linux, and macOS, I’ve created a minimal SDK called lite-camera .

Installation

pip install lite-camera

Quick Usage

import litecam

camera = litecam.PyCamera()

if camera.open(0):

window = litecam.PyWindow(
camera.getWidth(), camera.getHeight(), "Camera Stream")

while window.waitKey('q'):
frame = camera.captureFrame()
if frame is not None:
width = frame0
height = frame1
size = frame2
data = frame3


/r/Python
https://redd.it/1ikizbe
Terminal Task Manager Using Python

I've built a terminal task manager for programmers, that lets you manage your coding tasks directly from the command line. Key features include:

Adding task

Marking tasks as complete

Listing pending task

Listing completed tasks (filter like today, yesterday, week etc)

I am thinking about adding more features like reminder, time tracking,etc. what would you want to see in this task manager. Comment below

I'd love for you to check it out, contribute and help make it even better
The project is available on GitHub https://github.com/MickyRajkumar/task-manager

/r/Python
https://redd.it/1ikipwh
PomdAPI: Declarative API Clients with Tag-Based Caching (HTTP/JSON-RPC) - Seeking Community

Hey everyone,

I’d like to introduce pomdapi, a Python library to simplify creating and caching API calls across multiple protocols (HTTP, JSON-RPC, XML-RPC). It features a clear, FastAPI-like decorator style for defining endpoints, built-in sync/async support, and tag-based caching.

## What My Project Does

- **Declarative Endpoints**: You define your API calls with decorators (@api.query for reads, @api.mutation for writes).
- **Tag-Based Caching**: Tag your responses for easy invalidation. For example, cache getUser(123) under Tag("User", "123") and automatically invalidate it when the user changes.
- **Sync or Async**: Each endpoint can be called synchronously or asynchronously by specifying is_async=True/False.
- **Multi-Protocol**: Beyond HTTP, you can also use JSON-RPC and XML-RPC variants.
- **Swappable Cache Backends** : Choose in-memory, Redis, or Memcached.
Effectively, pomdapi helps you avoid rewriting the usual “fetch => parse => store => invalidate” logic while still keeping your code typed and organized.

## Target Audience

- Developers who need to consume multiple APIs—especially with both sync and async flows—but want a single, typed approach.
- Production Teams wanting a more systematic way to manage caching and invalidation (tag-based) instead of manual or ad-hoc solutions.
- Library Authors or CLI Tool Builders who need to unify caching across various external services—HTTP, JSON-RPC, or even custom protocols.

## Comparison
- Requests + Manual

/r/Python
https://redd.it/1ikjs2s
A new type of interpreter has been added to Python 3.14 with much better performance

Summary: This week I landed a new type of interpreter into Python 3.14. It improves performance by -3-30% (I actually removed outliers, otherwise it's 45%), and a geometric mean of 9-15% faster on pyperformance depending on platform and architecture. The main caveat however is that it only works with the newest compilers (Clang 19 and newer). We made this opt-in, so there's no backward compatibility concerns. Once the compilers start catching up a few years down the road, I expect this feature to become widespread.

Python 3.14 documentation: https://docs.python.org/3.14/whatsnew/3.14.html#whatsnew314-tail-call


(Sorry can't cross-post here) Original post: https://www.reddit.com/r/ProgrammingLanguages/comments/1ikqi0d/a\_new\_type\_of\_interpreter\_has\_been\_added\_to/

/r/Python
https://redd.it/1iks79k
What is this blank box on the left ? this is on the documentation page of python

Can anyone tell me what is this ??

this is the link : https://docs.python.org/3.13/genindex.html



https://preview.redd.it/r5qpcg242zhe1.png?width=1857&format=png&auto=webp&s=de04daafd00403e68dc3c385d06d3ceb5229eb9c



/r/Python
https://redd.it/1ikwb6i
Stuck in a Loop Learning Web Dev—Need Advice!

Hey everyone,

I’ve been learning web development, but I feel stuck in a cycle—watching tutorials, building small projects, fixing bugs, and repeating the same things daily. It feels like I’m not making real progress.

I think I’m too comfortable with what I know and struggle to push myself into bigger challenges. Has anyone else felt this way? How did you break out of the loop and level up?

Would love any advice! Thanks!

/r/django
https://redd.it/1ikr38s
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/1il1iwf
form."field" vs models."field": Defining field parameters in a single location

I plan to pass my models to the forms.py file and I'm wondering if it's possible to define parameters for form.field & models.field in the same line? For example: I want to define required=True & blank = Flalse.

userfirstname = (???).CharField(required=True, blank=False, max_length= 40, verbose_name="First Name")



edit: had true and false reversed in first paragraph

/r/djangolearning
https://redd.it/1ikxiji
RedCoffee: Making SonarQube Reports Shareable for Everyone

Hi everyone,

I’m excited to share a new update for [RedCoffee](https://pypi.org/project/redcoffee/), a Python package that generates SonarQube reports in PDF format, making it easier for developers to share analysis results efficiently.

# Motivation:

Last year, while working on a collaborative side project, my team and I integrated SonarQube to track code quality. Since this was purely a learning-focused initiative, we decided to use the SonarQube Community Edition, which met our needs—except for a few major limitations:

* There was no built-in way to share the analysis report.
* Our SonarQube instance was running locally in a Docker container.
* No actively maintained plugins were available to generate reports.

After some research, I found an old plugin that supported PDF reports, but it had not been updated since 2016. Seeing no viable solution, I decided to build RedCoffee, a CLI-based tool that allows users to generate a PDF report for any SonarQube analysis, specifically designed for teams using the Community Edition.

I first introduced RedCoffee on this subreddit around nine months ago, and I received a lot of valuable feedback. Some developers forked the repository, while others raised feature requests and reported bugs. This update includes fixes and enhancements based on that input.

**What's new in the recent update ?**

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