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
Authentication Methods

I am getting into web dev and am confused on the different types of authentication methods and how they works and what their pros and cons are. Could anyone link to a resource where I could learn about these. so far, the two I know are using JWT and using cookies but am not too sure how they work so I don’t know which I should use. I am using DRF to make an API if that changes anything. Thank you!

/r/django
https://redd.it/1kh8nie
introduction of flasky ! Free Flask AI chatbot.

hi folks! Today I'm writing to you after a few weeks of development to introduce Flasky. Flasky is a modified version of qwen coder 2.5 that I trained on flask data, basically I took the basic model and provided it with a tone of flask related data.

It's not as powerful as claude 3.7 etc. but it gets the job done! I host it totally locally on 2 4060 loll.. i got them for dirt cheep so. Oh and you can access it to ask for help at any time on flask wiki it's 100% and NO i dont collect any data, it's litterally just going trought my Ollama API then trought my custom model. No data collection and will never have any.

https://flaskwiki.wiki/ai-assistant

Hope you enjoy hehe, don't hesitate to let me know of any problems or potential improvements. This is my first real experience with AI I've already fuck arround a bit with Ollama, lm studio in the past or copilot, but I never really got far.

But I think AI can honestly help so much in solving stupid little problems that we get stuck on sometimes... Anyway! hope it can help you :)!

/r/flask
https://redd.it/1kflevr
R Cracking 40% on SWE-bench with open weights (!): Open-source synth data & model & agent

We all know that RL & FTing works great to get good agent models. But creating swe-bench style training data for software engineering agents is difficult! Until now.

Introducing SWE-smith: Generate 100s to 1000s of task instances for any GitHub repository.

Using this, we've generated 50k+ task instances for 128 popular GitHub repositories, then trained our own LM for SWE-agent.

The result? SWE-agent-LM-32B achieve 40% pass@1 on SWE-bench Verified.

Now, we've open-sourced everything, and we're excited to see what you build with it!

That means you get an open source LM, a big finetuning dataset, the framework that was used to create it, and our agent has been open source for a long time!

In addition, we share lots of insides about synthetic data, finetuning, and agent behavior in our paper.

/r/MachineLearning
https://redd.it/1kh18td
R Process Reward Models That Think

TLDR: Tackles the challenge of expensive step-level supervision required for training PRMs via ThinkPRM, a generative PRM fine-tuned with only 8K process labels, enabling it to verify reasoning using long chains-of-thought.


🔗 Paper : https://arxiv.org/abs/2504.16828

Github: https://github.com/mukhal/thinkprm
Verifiers: ThinkPRM-14BThinkPRM-1.5B
Data: https://huggingface.co/datasets/launch/thinkprm-1K-verification-cots



/r/MachineLearning
https://redd.it/1kgya52
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/1khchg7
Why wagtail over plain django?

Isn't embracing and extending in this way exactly the worst possible thing. Why not make it a library that you can add to a django project instead? They have zero information in their FAQ about maintenance - which is exactly my main concern.

/r/django
https://redd.it/1khjx7h
Ty: An extremely fast Python type checker and language server, written in Rust.

Astral just released a stand alone repository of their new typer checker ty on their github: https://github.com/astral-sh/ty

/r/Python
https://redd.it/1kgzxs0
Help me with oauth

Anyone have implemented oauth sign in with google in flask, can you share the code with me for reference.

/r/flask
https://redd.it/1khh53h
P Introducing the Intelligent Document Processing (IDP) Leaderboard – A Unified Benchmark for OCR, KIE, VQA, Table Extraction, and More

The most comprehensive benchmark to date for evaluating document understanding capabilities of Vision-Language Models (VLMs).

What is it?
A unified evaluation suite covering 6 core IDP tasks across 16 datasets and 9,229 documents:

Key Information Extraction (KIE)
Visual Question Answering (VQA)
Optical Character Recognition (OCR)
Document Classification
Table Extraction
Long Document Processing (LongDocBench)
(Coming soon: Confidence Score Calibration)

Each task uses multiple datasets, including real-world, synthetic, and newly annotated ones.

Highlights from the Benchmark

Gemini 2.5 Flash leads overall, but surprisingly underperforms its predecessor on OCR and classification.
All models struggled with long document understanding – top score was just 69.08%.
Table extraction remains a bottleneck — especially for long, sparse, or unstructured tables.
Surprisingly, GPT-4o's performance decreased in the latest version (gpt-4o-2024-11-20) compared to its earlier release (gpt-4o-2024-08-06).
Token usage (and thus cost) varies dramatically across models — GPT-4o-mini was the most expensive per request due to high token usage.

Why does this matter?
There’s currently no unified benchmark that evaluates all IDP tasks together — most leaderboards (e.g., OpenVLM, Chatbot Arena) don’t deeply assess document understanding.

Document Variety
We evaluated models on a wide range of documents: Invoices, forms, receipts,

/r/MachineLearning
https://redd.it/1khpwl3
I actually used Python practically the first time today!

I had to copy and paste a long sentence that was in all caps into a google doc, but didn't feel manually retyping the whole thing to be lower case, so I just wrote:

sentence = "Blah blah blah"

print(sentence.lower())

and voila, I have the long ass sentence in full lower case. Just wanted to share my milestone with some fellow python enthusiasts.

/r/Python
https://redd.it/1kh3uz7
Just out of curiosity, has anyone here ever used flask as the backend to a mobile app?

Started learning flask and the ease of certain things such as getting a development server up and running has me hooked. I eventually will like to build a mobile app for the saas web application I will begin working on soon as I get more experience.

/r/flask
https://redd.it/1kf72vx
simplesi - a units-aware package for engineers

GitHub Link: [https://github.com/jkbgbr/simplesi](https://github.com/jkbgbr/simplesi)

**What my project does**

simplesi is a package for units-aware engineering calculations with the primary scope to be used in applications / calculation documentation rather than interactive environments.

simplesi provides:

* A means of defining SI and non-SI unit environments, possibly at a package-external location.
* Arithmetics, comparisons etc. with units-aware quantities - use them as regular numbers.
* Options to set printing and error handling behaviour.
* Substantial speedup when compared to [forallpeople](https://github.com/connorferster/forallpeople) or [pint](https://github.com/hgrecco/pint).

The project is used in production environment, but should be considered beta as only the structural environment is actively used. Testers, contributors etc. are welcome, the project will be actively maintained in the forseeable future.

Though the current scope is as stated above, I'm not against enhancements towards jupyter, numpy etc. usage; these are likely possible already now but not tested.

**Target audience**

* Whoever needs to use units in their calculations - probably engineers, engineering students.

**Why I made this**

I work as design engineer and got frustrated over issues with both forallpeople and pint in my use cases.

/r/Python
https://redd.it/1khjfmo
TIL that a function with 'yield' will return a generator, even if the 'yield' is conditional

This function (inefficient as it is) behaves as expected:
def greet(as_list: bool):
message = 'hello!'
if as_list:
message_list = []
for char in message:
message_list += char
return message_list
else:
return message


>>> greet(as_list=True)
['h', 'e', 'l', 'l', 'o', '!']
>>> greet(as_list=False)
'hello!'


But what happens if we replace the list with a generator and return with yield?
def greet(as_generator: bool):
message = 'hello!'
if as_generator:
for char in message:
yield char
else:
return message


>>> greet(as_generator=True)
<generator object greet at 0x0000023F0A066F60>
>>> greet(as_generator=False)
<generator object greet at 0x0000023F0A066F60>


Even though the function is called with as_generator=False, it still returns a generator object!

Several years of Python experience and I did not know that until today :O

/r/Python
https://redd.it/1ki1qem
all routes with rendertemplate() stopped working after deleting and recreating database.

I deleted my posts.db and suddenly after creating a new one all of the routes that end with return render\
template() don't work anymore, they all return 404. I deleted it after changing around the User, BlogPost and Comment db models. It worked perfectly fine before. I'm following a course on Udemy to learn Python btw

https://github.com/ldclaura/helpme/tree/main/helpme1

/r/flask
https://redd.it/1ki5i0m
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/1ki537m
What problems in the Django framework still have no direct solution?

Good day, everyone. I am planning to create an extension or a Django app specifically aimed at providing solutions to recurring problems that affect the development process—particularly those that cause headaches during integration or development.

This thread is a safe space to share suggestions, constructive criticism, and ideas for improvement, all with the goal of making Django more efficient, developer-friendly, and robust.

Your input is valuable and highly appreciated. Let’s work together to enhance the Django ecosystem.

/r/django
https://redd.it/1kias7m
Could anyone help us with this program problem?

my wife and I have been going to couples therapy and we've been assigned to work on something we both like. We've both enjoyed robotics back in school so we bought the maqueen plus. We've hit a wall with our program. It's supposed to be going around the black edge and stopping at the top opening (as you could see if you try it). The problem is if he even stays on track long enough, he doesnt stop at the white opening. If anyone knows how to fix our bug, we'd be so grateful.

from mbrobot import *

RobotContext.useBackground("sprites/field2.gif")

rightArc(0.1)

delay(1000)

forward()

def aufDerKanteFahren():

count = 0

if count == 0:

forward()

vR = irRight.read_digital()

vL = irLeft.read_digital()

if vR != 1 or vL != 1:

count += 1

if count == 1:

if vL == 0 and vR == 0:

rightArc(0.1)

delay(300)

count +=1

elif vL == 0 and vR == 1:

leftArc(0.1)

delay(300)

count +=1

elif vL == 1 and vR == 0:

rightArc(0.1)

delay(1000)

count +=1

elif count == 2 and vR == 1 and vL == 1:

stop()

print(count)

setSpeed(50)

while True:

vR = irRight.read_digital()

vL = irLeft.read_digital()

aufDerKanteFahren()

delay(100)

/r/IPython
https://redd.it/1kic4ts
Every script can become a web app with no effort.

When implementing a functionality, you spend most of time developing the UI. Should it run in the terminal only or as a desktop application? These problems are no longer something you need to worry about; the library Mininterface provides several dialog methods that display accordingly to the current environment – as a clickable window or a text on screen. And it works out of the box, requiring no previous knowledge.

What My Project Does

The current version includes a feature that allows every script to be broadcast over HTTP. This means that whatever you do or have already done can be accessed through the web browser. The following snippet will bring up a dialog window.

from mininterface import run

m = run()
m.form({"Name": "John Doe", "Age": 18})

Now, use the bundled mininterface program to expose it on a port:

$ mininterface web program.py --port 1234

Besides, a lot of new functions have been added. Multiple selection dialog, file picker both for GUI and TUI, minimal installation dropped to 1 MB, or added argparse support. The library excels in generating command-line flags, but before, it only served as an

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