pythondaily | Образование

Telegram-канал pythondaily - Python Daily

1102

Daily Python News Question, Tips and Tricks, Best Practices on Python Programming Language Find more reddit channels over at @r_channels

Подписаться на канал

Python Daily

Turn Entire YouTube Playlists to Markdown Formatted and Refined Text Books (in any language)

Give it any YouTube playlist(entire courses for instance) and receive a clean, formatted and structured file with all the details of that playlist.

It's a simple yet effective script using the free Google Gemini API.

I haven't found any free tool available with this scale, so I made one.

This Python application extracts transcripts from YouTube playlists and refines them using the Google Gemini API(which is free). It takes a YouTube playlist URL as input, extracts transcripts for each video, and then uses Gemini to reformat and improve the readability of the combined transcript. The output is saved as a text file.

**What My Project Does**:

* Batch processing of entire playlists
* Refine transcripts using Google Gemini API for improved formatting and readability.
* User-friendly PyQt5 graphical interface.
* Selectable Gemini models.
* Output to markdown file.

**Target Audience**:

Turning large YouTube playlist into one large formatted text file has many advantages for studying and learning, documentation, having a source book of the playlist, etc...


**Comparison**:

I haven't found a similar tool that converts YouTube videos to easily readable document in this scale and be free and accessible.

Check it out : [https://github.com/Ebrizzzz/Youtube-playlist-to-formatted-text](https://github.com/Ebrizzzz/Youtube-playlist-to-formatted-text)

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

Читать полностью…

Python Daily

Time to stop using filter()?

Python's built-in filter() function predates generators, and it has persisted, partly out of habit, partly for legacy reasons, and partly because it can be a bit faster than generators.

Having recently tested the performance of filters vs generators in Python 3.13, I found the speed benefit has reversed. In all of my tests, generators were faster than the equivalent filter call - typically by 5 to 10%.

Is it now time to stop using filter() in new code (Python >= 3.13), or are there still cases where it is clearly the better option?

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

Читать полностью…

Python Daily

Starter Django Project (Boilerplate)

Hi all, I am looking for a starter Django project that only has the login, register, reset password, and activate account already set up (send email with activate/reset link). The setting up of the boilerplate is what always prevents me from starting new projects, sadly I am just so lazy.

If anyone knows of a repo that has this please can you point me to it. I will also help maintain it.

/r/django
https://redd.it/1iof4ow

Читать полностью…

Python Daily

Segment anything UI: Segmentation / object detection annotation made the easy way

Hello to everyone.

I have officially released segment anything ui for segmentation / object detection annotation tasks. It is a PySide6 application.


I have been working on this tool for some time and I hope that it will help to remove annoying instance segmentation / object detection annotation. It is designed to be simple, feature rich and as automatic as possible. Feel free to request features, bugfixes or star the project.


https://github.com/branislavhesko/segment-anything-ui


Let's do the annotations the most pleasant way.

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

Читать полностью…

Python Daily

Problem with deployment in pythonanywhere

I'm trying to deploy my web application to pythonanywhere. The problem is that the really big one has many files and folders created following miguel's megatutorial. How can I put this folder containing the entire application in pythonanywhere?

/r/flask
https://redd.it/1im8ax6

Читать полностью…

Python Daily

Django 5.1 Security Vulnerabilities: What You Need to Know

# Executive Summary (For CEOs & Managers):

* **What’s at risk?** Attackers can exploit these vulnerabilities to disrupt services (denial-of-service) or compromise your database (SQL injection).
* **What should you do?** Instruct your technical team to upgrade Django to the latest secure versions immediately: **5.1.5, 5.0.11, or 4.2.18**, depending on what your systems use.
* **Why it matters:** Even a brief service disruption or successful SQL injection can lead to lost revenue, reputational damage, and compliance issues.

# Technical Breakdown (For Blue Teams & Developers):

# 1. CVE-2024-56374 – IPv6 Validation DoS

**Details:** Lack of a limit on string length when validating IPv6 addresses could allow attackers to overload the system, causing a denial-of-service.

* **Vulnerable Components:** `clean_ipv6_address`, `is_valid_ipv6_address`, and `django.forms.GenericIPAddressField` (Note: `django.db.models.GenericIPAddressField` is not affected).
* **Recommendation:** Upgrade to **5.1.5, 5.0.11, or 4.2.18**. Avoid using these functions in unpatched versions.

# 2. CVE-2024-53908 – SQL Injection in Oracle Databases

**Details:** Direct use of `django.db.models.fields.json.HasKey` lookup with untrusted data can lead to SQL injection attacks on Oracle databases.

* **Attack Vector:** SQL injection when the `HasKey` lookup is used with user-controlled input.
* **Recommendation:** Upgrade to **5.1.4, 5.0.10, or 4.2.17**. Review and sanitize any input passed to `HasKey` lookups.

# 3. CVE-2024-53907 – DoS in strip_tags() and striptags Filter

**Details:** The `strip_tags()` method and

/r/django
https://redd.it/1io0uhp

Читать полностью…

Python Daily

Web Socket connection is failing between Flask and React, Docker Containers

I am trying to setup a dockerized development for ReactJS and Flask

1. My all other api are working correctly but the socket connection is failing.
2. When i sh into react container, and try to form socket connection with flask, it's working, but when using react app on localhost, the socket connection is failing.
3. CORs is allowed on the flask server
4. Accessing the flask server using docker service name
5. Everything (API + web sockets) seems to be working fine when running outside docker containers.
6. Tried to create a docker-network in the compose file as well
7. Tried disabling the Firewall on my MacBook as well

stacker link: https://stackoverflow.com/questions/79430474/web-socket-connection-is-failing-between-flask-and-react-docker-containers

/r/flask
https://redd.it/1in2ea7

Читать полностью…

Python Daily

School Children NFC

Hi, I’m currently working on a school project to create a system for school children using NFC tags. The system is designed to handle attendance tracking and allow students to pay for food in the canteen using NFC. Parents can top up their children’s NFC tag balance through a web app that we’ve developed using Django and Python. I have limited knowledge about NFC, so if anyone has experience with a similar system, I would appreciate any advice or suggestions.


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

Читать полностью…

Python Daily

Getting told “PL/SQL is a better option compare to Python” on Report Automation

Background: Recently I’m working on a report automation task using Python Pandas library, but - I was told by the TI team (Tech infra) that currently they are having issues with the Pandas library on the servers, so I’m asked to find alternatives to revise my finished program…

The problem is while I’m looking for alternatives, I’m getting a lot of options or ideas from not just my own team, but other teams.

And one of the Senior employees on my team asked me what my Python program is doing, after I explained my program logic, he basically told me “You shouldn’t use Python for this task in the first place. Should just use PL SQL” Because:
1. PL SQL is being used by my team for a long time, most of people are more familiar with it.
2. Using PL SQL avoids the Python Libraries issue
3. It’s approved by the company so no need to worry about “getting approvals”

Maybe this option could work and he is trying to help, but I’m not convinced by his explanations on why PL SQL is a better option specifically in the context of the report automation task which requires:
1. Iterating through each rows of data, uses

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

Читать полностью…

Python Daily

R LLMs as Few-Shot Data Annotators for Multilingual Text Detoxification

This paper introduces a method for using LLMs as few-shot learners to generate high-quality parallel datasets for text detoxification. The key innovation is using modern LLMs to create paired toxic/non-toxic text examples that maintain semantic meaning while reducing toxicity.

Main technical points:
- Uses few-shot prompting with carefully curated example pairs
- Implements multi-stage filtering to ensure quality
- Validates semantic preservation using automated metrics
- Achieves better toxicity reduction while maintaining meaning compared to existing methods
- Creates larger, higher-quality parallel datasets than previous approaches

Results:
- Outperforms existing detoxification models on standard benchmarks
- Shows strong cross-domain generalization
- Demonstrates effectiveness with just 3-5 examples
- Maintains semantic similarity scores >0.85
- Reduces toxicity scores by >60% on test sets

I think this could be particularly valuable for content moderation systems that need to preserve meaning while removing harmful content. The ability to generate high-quality parallel data could help train better downstream detoxification models.

I think the few-shot approach is especially promising because it reduces the need for large annotated datasets, which are expensive and time-consuming to create manually.

TLDR: Modern LLMs can generate high-quality parallel toxic/non-toxic text pairs using few-shot learning, enabling better training data for detoxification systems while maintaining semantic meaning.

Full summary is here. Paper here.

/r/MachineLearning
https://redd.it/1innuh3

Читать полностью…

Python Daily

Pykomodo: A python chunker for LLMs

Hola! I recently built **Komodo**, a Python-based utility that splits large codebases into smaller, LLM-friendly chunks. It supports multi-threaded file reading, powerful ignore/unignore patterns, and optional “enhanced” features(e.g. metadata extraction and redundancy removal). Each chunk can include functions/classes/imports so that *any* individual chunk is self-contained—helpful for AI/LLM tasks.

If you’re dealing with a huge repo and need to slice it up for context windows or search, Komodo might save you a lot of hassle or at least I hope it will. I'd love to hear any feedback/criticisms/suggestions! Please drop some ideas and if you like it, do drop me a star on github too.

**Source Code:** [https://github.com/duriantaco/pykomodo](https://github.com/duriantaco/pykomodo)

**Features:Target Audience / Why Use It:**

* Anyone who's needs to chunk their stuff

Thanks everyone for your time. Have a good week ahead.

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

Читать полностью…

Python Daily

ParScrape v0.5.1 Released

# What My project Does:

Scrapes data from sites and uses AI to extract structured data from it.

# Whats New:

* BREAKING CHANGE: --ai-provider Google renamed to Gemini.
* Now supports XAI, Deepseek, OpenRouter, LiteLLM
* Now has much better pricing data.

# Key Features:

* Uses Playwright / Selenium to bypass most simple bot checks.
* Uses AI to extract data from a page and save it various formats such as CSV, XLSX, JSON, Markdown.
* Has rich console output to display data right in your terminal.

# GitHub and PyPI

* PAR Scrape is under active development and getting new features all the time.
* Check out the project on GitHub or for full documentation, installation instructions, and to contribute: [https://github.com/paulrobello/par\_scrape](https://github.com/paulrobello/par_scrape)
* PyPI [https://pypi.org/project/par\_scrape/](https://pypi.org/project/par_scrape/)

# Comparison:

I have seem many command line and web applications for scraping but none that are as simple, flexible and fast as ParScrape

# Target Audience

AI enthusiasts and data hungry hobbyist

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

Читать полностью…

Python Daily

What I learned about Django security from my hidden analytics module

I built a hidden statistics module in my Django portfolio and discovered something interesting about security

I added a secret stats endpoint to my Django site that tracks all attempts to access my site. After analyzing 2.2k unique visitors, the data tells an interesting story.

Legitimate traffic is exactly what you'd expect: homepage (2.6k visits), portfolio (911), blog (661). But here's where it gets fun - my stats module caught hundreds of automated attacks trying everything from .env file access (64 attempts) to WordPress admin panels.

The best part? I didn't build any special security - Django's default configurations handled everything. The stats module just silently recorded all these failed attempts while serving my actual visitors without a hitch.

My favorite discovery was seeing the persistence of some bots - one tried +50 different variations of WordPress manifest files. On a Django site. I actually found myself admiring their determination.

TL;DR: Built a secret stats module in Django, watched it record thousands of failed hack attempts while Django's security didn't break a sweat.

https://preview.redd.it/0sleafxbxkie1.png?width=1905&format=png&auto=webp&s=e2f2912cdda1ac3940054f97e6346b68a2b8dc3b

/r/django
https://redd.it/1ina9i4

Читать полностью…

Python Daily

Wednesday Daily Thread: Beginner questions

# Weekly Thread: Beginner Questions 🐍

Welcome to our Beginner Questions thread! Whether you're new to Python or just looking to clarify some basics, this is the thread for you.

## How it Works:

1. Ask Anything: Feel free to ask any Python-related question. There are no bad questions here!
2. Community Support: Get answers and advice from the community.
3. Resource Sharing: Discover tutorials, articles, and beginner-friendly resources.

## Guidelines:

This thread is specifically for beginner questions. For more advanced queries, check out our [Advanced Questions Thread](#advanced-questions-thread-link).

## Recommended Resources:

If you don't receive a response, consider exploring r/LearnPython or join the Python Discord Server for quicker assistance.

## Example Questions:

1. What is the difference between a list and a tuple?
2. How do I read a CSV file in Python?
3. What are Python decorators and how do I use them?
4. How do I install a Python package using pip?
5. What is a virtual environment and why should I use one?

Let's help each other learn Python! 🌟

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

Читать полностью…

Python Daily

Plutus Is a Command Line Income and Expense Tracker

Hi,

Plutus helps you quickly analyze your income and expenses from the command line using a single CSV file as your data source.

Source code

[https://github.com/nickjj/plutus](https://github.com/nickjj/plutus)

Documentation / demo video

The repo has as extensive readme file
A demo video is on [YouTube ](https://www.youtube.com/watch?v=mwVnKbne9v4)(no ads) and is also linked in the readme

Target audience / why

You can use this to help with budgeting or getting your numbers in order for filing taxes.

You just want to keep track of your income from a few sources, separate out personal / business expenses and keep tabs on how much you paid in taxes. You want to get your numbers and move on with life.

Features and benefits

A single CSV data source
Have peace of mind it won't get corrupted from a tool upgrade
Easily trackable in git
Pipe its output to other tools
View it in any spreadsheet tool if you want ad hoc visualizations
Friendly towards sending it to an accountant
Categories and subcategories are unrestricted along with being easy to change later
A category is just text in a specific CSV column
Flexible report generating with a

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

Читать полностью…

Python Daily

D How you do ML research from scratch?

Someone who has published their works at top ML conferences (NIPS, ICML, ICLR) or domain oriented conferences (CVPR, ICCV, ACL, EMNLP, KDD, SIGIR).
1. How do you get from 0 to your first paper?
2. How much is your skill (Pytorch, or domain knowledge)?
3. What is the whole process that you follow to become good at implementing your ideas?
4. How do you come up with an idea and solution?

/r/MachineLearning
https://redd.it/1ion90w

Читать полностью…

Python Daily

A new sorting algorithm for 2025, faster than Powersort!

tl;dr It's faster than Python's Default sorted() function, Powersort, and it's not even optimized yet.

Original post here: https://www.reddit.com/r/computerscience/comments/1ion02s/a\_new\_sorting\_algorithm\_for\_2025\_faster\_than/

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

Читать полностью…

Python Daily

A polyphonic MIDI synth in less than 100 lines of code

# Background

I am posting a series of Python scripts that demonstrate using Supriya, a Python API for SuperCollider, in a dedicated subreddit. Supriya makes it possible to create synthesizers, sequencers, drum machines, and music, of course, using Python.

All demos are posted here: r/supriyapython.

The code for all demos can be found in this GitHub [repo](
https://github.com/dayunbao/supriyademos).

These demos assume knowledge of the Python programming language. They do not teach how to program in Python. Therefore, an intermediate level of experience with Python is required.

# The demo

In this demo, I show how to handle MIDI messages to play a polyphonic synthesizer using Supriya. It took a little less than 100 lines of code, which is pretty amazing.

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

Читать полностью…

Python Daily

Python pdf bytes stream to Postman

I acknowledge that the question might not be fully flask related.

Essentially I have a flask endpoint that takes a few arguments and stores a PDF File + an analytical object tied to it in MongoDB. One of the arguments passed to the endpoint is the pdf byte stream of the PDF itself.

I am trying now to test the endpoint via postman but I struggle to define to include the pdf byte stream as I can't seem to be able to copy the entire value of it from python. Has anyone else ever encountered a similar issue, i.e., manually defining a pdf byte stream as a parameter argument in postman?

Appreciate any help!

/r/flask
https://redd.it/1im845d

Читать полностью…

Python Daily

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/1io5ruy

Читать полностью…

Python Daily

I am creating a site that will need something similar to mods and subreddit. Should I create a mod called a super mod that can edit everything?

Hey I am sorry if this a dumb question and I am inexperienced.

Also a forum might be a better analogy.



I am building a simple admin features in flask for my app. But I have a question when designing the database. The analogy in my site is kind of like reddit mods and subreddit. I want to make is so only mods can create a new subreddit. Seems easy enough. Now my question, should I create a super mod that can edit everything? One of the negative is that if a super mod was hacked the entire site could go down. Or am I worrying about nothing? Also should I just make it so the first user is automatically a super mod and just add super mods and mods?

I am using flask sqlalchemy if that makes a difference also.

/r/flask
https://redd.it/1io33pt

Читать полностью…

Python Daily

why there is no option like community edition jasper report whit report designer in python

Reportlab, fpdf and many other options are good but have no report designer which can be cumbersome to write small but many reports with header footer groups with visually aligned elements
Jasper reports is very good at it but there is no parallel in python

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

Читать полностью…

Python Daily

Inviting contributions to an open source chat web app !

Hey everyone!

I’ve built a basic Django chat app using Django Channels & WebSockets, and I’d love to open it up for community contributions! The project is still in its early stages, and I believe it would be more exciting to build it together rather than alone.

I've opened multiple issues (friend requests, message indicators, PostgreSQL integration, etc.), so feel free to pick one, suggest improvements, or even add new features! It’s a great way to gain experience, build your portfolio, and collaborate with others.

Repo Link : https://github.com/frzn23/zeenchat

Would love to hear your thoughts and ideas!

/r/django
https://redd.it/1inwnz7

Читать полностью…

Python Daily

jupad - Python Notepad

I've always used python as a calculator but wanted something that feels more like a soulver sketchpad.

* **Source code:** [ jupad - Python Notepad](https://github.com/idanpa/jupad)
* **Target audience:** Developer tool
* **Comparison**: This is somewhere between python REPL to Jupyter notebook. Inspired by notepad calculators ([Soulver](https://soulver.app/), [Numi](https://numi.app/), [Numbr](https://numbr.dev/)), reactive jupyter notebooks ([marimo](https://github.com/marimo-team/marimo), [ipyflow](https://github.com/ipyflow)) and similar projects ([Hydrogen](https://github.com/nteract/hydrogen)). Based on [qtconsole](https://github.com/jupyter/qtconsole).

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

Читать полностью…

Python Daily

How to prepare for live coding test

Okay so i have a live coding test


And tbh idk what to do,how do you even prepare for it?

I cant even remember the non obvious imports without searching then how do they expect to create a full stack app in 1 hour(thats what they aked me to do first time)

I cleared the conceptual interview but now its time for 2nd coding test,incould not do first one because or problems with django of my system

/r/django
https://redd.it/1inmut7

Читать полностью…

Python Daily

My talk has been accepted for DjangoCon EU 2025!

“What if I fail?”

That thought used to haunt me every time I took a step outside my comfort zone. Applying for my first open-source contribution, organizing Django meetups, even sharing my thoughts publicly—self-doubt was always lurking.

But today, I have proof that pushing past fear leads to something bigger. My talk on Zango framework has been accepted for DjangoCon EU 2025! 🎉

This isn’t just about a conference talk. It’s about the journey—the long nights, the imposter syndrome, the relentless belief that if you keep showing up, opportunities will follow.

From casually exploring Django to building a thriving community in India, from contributing in silence to speaking on an international stage—it’s been a wild ride. And if there’s one thing I’ve learned, it’s this:

“Do it. Even if you think you’re not “ready” yet”

Because the best things happen when you stop waiting for permission.

If you’re attending DjangoCon EU 2025, let’s meet, exchange ideas, and keep growing together. 🚀


Checkout offical zango website: zango.dev
You can star the framework here: https://github.com/Healthlane-Technologies/Zango

https://preview.redd.it/vab7feuiwnie1.jpg?width=800&format=pjpg&auto=webp&s=3315f71790fd94a209cd300d10a036606ff56a0e




/r/django
https://redd.it/1inlr5k

Читать полностью…

Python Daily

Any free hosting providers that allow me to install other apps?

I have a flask web app that uses musescore to generate sheet music, are there any free hosting providers that allow this? Pythonanywhere does allow me to compile other apps but has a 500mb limit.

/r/flask
https://redd.it/1inecoj

Читать полностью…

Python Daily

Preswald: A full-stack Python SDK for building and deploying interactive data apps

Hi everyone,

Preswald is a lightweight, full-stack SDK that helps you build, deploy, and manage interactive data applications. all with minimal Python and SQL. It brings together data ingestion, storage, transformation, and visualization into one simple framework.

Source Code: https://github.com/StructuredLabs/preswald

Slack: Community


Features:Target Audience / Why Use It:

Build apps with minimal Python/SQL.
Handle ingestion, ETL, and visualization in one SDK.
Connect to CSV, JSON, Parquet, or SQL databases easily.
Customize your app’s look with simple tweaks in preswald.toml.
Deploy locally or to Google Cloud Run with one command.
Lightweight and simple, no need for a huge data stack.

If you’re tired of juggling tools to get simple data apps up and running, this might make life easier. It’s good for quick internal tools, dashboards, or just experimenting with data.

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

Читать полностью…

Python Daily

D What happened to SSMs and linear attentions?

Someone who is upto date with this area of research can summarize what is current state of SSMs and softmax attention alternatives? Are they used in cusomer focused models yet or are still in research? Does their promise only appears to be in benchmarks on a paper? or are the hardware accelerators have etched the attention so that it is fully juiced up and using SSMs or linear attention alternatives only provide marginal gains which does appeal with the level of complexity in them?

/r/MachineLearning
https://redd.it/1in9y30

Читать полностью…

Python Daily

Dockerize a Django App

I need help. I want to deploy a project that I've been working with. It's fairly simple, here's the repo: https://github.com/gabrielpistore/SiGOS-UFCAT. I've been thinking about using docker. Anyone could give me some advices on how should I do it.

/r/django
https://redd.it/1imvnfk

Читать полностью…
Подписаться на канал