pythondaily | Education

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

Subscribe to a channel

Python Daily

Gemma 3 released: beats Deepseek v3 in the Arena, while using 1 GPU instead of 32 N

Chatbot Arena Elo Score


https://blog.google/technology/developers/gemma-3/

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

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

Python Daily

ZipNN: High-Speed Compression for AI Models

📌 **Repo:** [GitHub - zipnn/zipnn](https://github.com/zipnn/zipnn)

# 📌 What My Project Does

ZipNN is a compression library designed for **AI models, embeddings, KV-cache, gradients, and optimizers**. It enables storage savings and **fast decompression on the fly**—directly on the CPU.

* **Decompression speed**: Up to **80GB/s**
* **Compression speed**: Up to **13GB/s**
* Supports **vLLM & Safetensors** for seamless integration

# 🎯 Target Audience

* **AI researchers & engineers** working with **large models**
* **Cloud AI users** (e.g., Hugging Face, object storage users) looking to optimize **storage and bandwidth**
* **Developers handling large-scale machine learning workloads**

# 🔥 Key Features

* **High-speed compression & decompression**
* **Safetensors plugin** for easy integration with vLLM:pythonCopyEditfrom zipnn import zipnn\_safetensors zipnn\_safetensors()
* **Compression savings**:
* **BF16**: 33% reduction
* **FP32**: 17% reduction
* **FP8 (mixed precision)**: 18-24% reduction

# 📈 Benchmarks

* **Decompression speed:** 80GB/s
* **Compression speed:** 13GB/s

# ✅ Why Use ZipNN?

* **Faster uploads & downloads** (for cloud users)
* **Lower egress costs**
* **Reduced storage costs**

# 🔗 How to Get Started

* **Examples:** [GitHub - ZipNN Examples](https://github.com/zipnn/zipnn/tree/main/examples)
* **Docker:** [ZipNN on DockerHub](https://hub.docker.com/r/zipnn/vllm-openai)

ZipNN is seeing **200+ daily downloads on PyPI**—we’d love your feedback! 🚀

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

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

Python Daily

Building Infinite AI Web , using flask and Gemini api

https://redd.it/1j9pggh
@pythondaily

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

Python Daily

We launched serverless hosting option for Flask apps

Hey r/flask ,

I’ve been deploying Flask and Django apps for years, and one thing that always frustrated me is the cost—especially for small projects that don’t get much traffic.

# The problem:

Paying for idle time – Most hosting providers charge 24/7, even if your app is mostly idle.
Multiple apps, multiple bills – Want to run a few small services? You’ll likely pay for each one separately, even if they barely get used.

I wanted a more efficient way to host Flask apps, so I built Leapcell—a serverless option that deploys instantly, gives you a URL, and only charges for actual usage (no idle costs).

If you’ve struggled with the cost of Python hosting, I’d love to hear your feedback!

Try Leapcell: **https://leapcell.io/**

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

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

Python Daily

MVP codeStructure suggestion for CLOUDWISE(my multiple cloud APP)

Starting a 15-day MVP to manage AWS resources via natural language. Any tips for structuring a Flask project with multiple cloud provider integrations?

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

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

Python Daily

Ascii Video Player

Hello People!
A few months ago, I built an ASCII video player that converts any video into an ASCII art version (with audio support). Back then, I didn’t have the confidence to share it, but now I’ve decided to put it out there!

What My Project Does

ASCII-Flix lets you watch videos directly in your terminal by converting frames into ASCII characters, creating a retro, text-based viewing experience. It supports 2 modes for different ASCII rendering styles and plays the original audio alongside the video.

I used OpenCV, python-curses, and Pygame(for audio support) .

Target Audience:

This project is for anyone who enjoys creative terminal-based projects, ASCII art enthusiasts, and people who like experimenting with unconventional ways of watching videos. If you’re into tech nostalgia, retro computing aesthetics, or just want to try something fun in your terminal, you’ll probably enjoy this!

Comparison:

This was inspired by ASCII Theatre, which allows you to watch movies in ASCII art format in the terminal. However, ASCII Theatre is a more refined version of this concept. ASCII-Flix, on the other hand, is something I made for fun—it’s a lighthearted experiment that brings a unique way to experience videos in ASCII form.

How to use it:
1. pip install ascii-flix
2. Type the command ascii-flix on your

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

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

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

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

Python Daily

Javascript and python interfacing examples

Examples of interfacing between javascript and python for desktop apps and desktop games.

https://github.com/non-npc/Javascript-and-python-interfacing-examples

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

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

Python Daily

Nested Images in Wagtail

I have noticed by default images break the list structure and is inserted outside of the list. Is it possible to have nested images within a list item in Wagtail?

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

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

Python Daily

The best CI/CD strategy with Django App

Hi everyone! I've launched the personal project based on django and untill the last moment, after some updates I just log in to the server and update everything on my own via ftp, and then just restart gunicorn, which was fine until now. Since it starts being hard to manage project in such a way, there is a need to implement CI/CD for it, so i would really like to get an advise from expirienced (or who has dealt with it at least) developers, what are the best steps to do that without Docker (in case of Docker everything is kinda clear), but with Git for sure

The questions ISN'T about certain CI/CD tool or piece of code, but just about strategy. I definitely reffered to SO, but it's all about specific issues with particular pieces of advise.

Ideally, i would like to see the following: there is a stable version (should it be another branch or just a generated folder with timestamp? - also the question), there is a new version with features - I deliver it with job to the server and if everything is ok - mark it as stable, if it's not - to rollback to previous one.

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

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

Python Daily

Your notes on Django Fundamentals

Does anyone here have an organised notes that you have written on Django Fundamentals while you learned it? And if you did could you please share it. It’ll be useful for me to refer and also update my existing notes.

/r/djangolearning
https://redd.it/1j5kmk0

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

Python Daily

Keeping Azure Blob synchronised with Django Database

This is the Image Model for a Gallery app. I realised that the default behaviour of django-storages is that it uploads files to AzureBlob but doesn't delete the files when the database entry is deleted. Not sure if this is the way to do it? It seems like it should be really common but I've had to dig up the AzureBlob SDK manually to do it. I also have a thumbnail function for faster loading (will change some parameters later)

class Image(models.Model):
    user = models.ForeignKey(User, on_delete=models.CASCADE)
    title = models.CharField(max_length=255)
    description = models.TextField()
    image_file = models.ImageField(upload_to='images/')
    thumbnail_file = models.URLField(null=True, blank=True)  # Store Azure URL instead of ImageField
    uploaded_at = models.DateTimeField(auto_now_add=True)

    def save(self, *args, **kwargs):       


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

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

Python Daily

What is your go-to way of structuring Django projects?

Been using Django for a bit now and I feel like my structure is lacking. Sometimes I just put all models in the main app, sometimes I split them across apps and that's a mess.

Wondering how to test out for the sweet spot.

/r/djangolearning
https://redd.it/1j7u3bc

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

Python Daily

blob-path: pathlib-like cloud agnostic object storage library

# What My Project Does
Having worked with applications which run on multiple clouds and on-premise systems, I’ve been developing a library which abstracts away some common functionalities, while being close to the pathlib interface
tutorial notebook

Example snippet

from blob_path.backends.s3 import S3BlobPath
from pathlib import PurePath

bucket_name = "my-bucket"
object_key = PurePath(
"hello_world.txt"
)
region = "us-east-1"
blob_path = S3BlobPath(
bucket_name,
region,
object_key,
)

# check if the file exists
print(blob_path.exists())

# read the file
with blob_path.open("rb") as f:
# a file handle is returned here, just like `open`
print(f.read())


destination = AzureBlobPath(
"my-blob-store",
"testcontainer",
PurePath("copied_from") / "s3.txt"
)

blob_path.cp(destination)



Features:
- A pathlib-like interface for handling cloud object storage paths, I just love that interface
- Built-in serialisation and deserialisation: this, in my experience, is something people have trouble with when they begin abstracting away cloud storages. Generally because they don’t realise it after some time and it keeps getting deprioritised. Users instead rely on stuff like using the same bucket across the application
- Having a pathlib interface where all the functionality is packaged in the path itself (instead of writing “clients” for each cloud backend make this trivial)
-

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

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

Python Daily

I built a better Python playground with file handling and libraries

**What My Project Does**

Online Python compiler with:

* file uploads
* data viz
* Python libraries
* script scheduling
* keyboard shortcuts, dark mode, autocomplete, etc.

**Target Audience**

Python students, low-coders

**Comparison**

No sign up or usage limits (unlike Replit, PythonAnywhere). Has libraries, file uploads and scheduling, which most online Python environments don't have.

Uses the incredible Pyodide to execute Python using WebAssembly: [https://github.com/pyodide/pyodide](https://github.com/pyodide/pyodide)

**Try it here:** [https://cliprun.com/online-python-compiler-with-file-upload](https://cliprun.com/online-python-compiler-with-file-upload)

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

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

Python Daily

UV or PyEnv for student python teaching / python installs (linux)

I teach python across a number of courses (primarily on linux) from 1st year just learning to program to MSc Level Machine learning.

For the last few years I have used pyenv to manage the python versions the students are using, either as a pyenv global for a specific version of python for the 1st years. To using pyenv for anaconda install for the MSc students.

I have not really used virtual envs with the students as it adds a lot of complexity to the students learning and they tend not te be very good at tidying up etc.

I'm thinking of moving to uv but as it doesn't quite work like pyenv I'm not sure how to manage the students python installs.

My initial idea is to write a script to install uv and then install the required python version and then install the required default packages (numpy etc etc) and generate a default root / home level venv and make this transparent to the students so basically when they login they are in a venv with everything they need.

Pros to this is the students just run python and it works which for the 1st years is a big win.

In

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

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

Python Daily

For Hire Full Remote Software engineer with 6+ years of experience

I’m a Software Engineer with over 6 years of experience - including YC backed startups as founding engineer - building scalable systems, crafting high-performance backends, LLM based features and delivering impactful AI/ML-driven solutions.

I've worked on everything from scaling products to millions of users at startups to optimizing workflows in enterprise environments.

Open to consulting gigs and full time roles.

Tech Stack

Languages — Python, JavaScript, Typescript

Frameworks & Packages — Django, React

Datastores & Caches — PostgreSQL, Redis, RabbitMQ, Kafka, DynamoDB

Deployment Tools — Docker, Docker Compose

Cloud providers — AWS, GCP

Feel free to comment or DM.

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

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

Python Daily

13 Months into Django - Built a Boilerplate to Share

I started learning Django 13 months ago and I really enjoy it. I've been building web apps and improving my skills ever since.

The more I built, the more I noticed setup was eating my time: auth, payments, same old grind.

So I put together a little boilerplate to skip the hassle - Django with HTMX, Tailwind + Kutty, Stripe, Wagtail, Django-Allauth all ready in 15 minutes.

It’s been a time-saver for me, and a couple friends didn’t hate it. Figured I’d share with the community that got me started.

Here's the repo if you're curious

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

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

Python Daily

LambdaLabs: Create HTTP routes, lambdas and databases in runtime.

What My Project Does:
LambdaLabs is a small-scale, hobby and proof-of-concept project that enables dynamic creation of routes, serverless lambdas, and databases. It runs over FastAPI with almost no performance overhead.

Target Audience:
Currently this project is just a toy / hobby project for getting more into python.

The goal with this project was to build a small-scale, lightweight application that allows the same power as FastAPI without introducing overhead usually associated with these kind of applications.


https://github.com/joexbayer/LambdaLabs

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

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

Python Daily

Need help with authentication

I am currently working on a project with django rest api and react js. I am confused in selecting a proper authentication method. It's a small internal web based app that would only be used within the company and targeting less than 60 users.
Should I go for jwt based authentication or try to implement session based authentication. Even though I have experience in the backend Development, I am used to code in jwt based authentication since we had a react native based app.
Does jwt have any security issues?
If session authentication is better how can I make it work with react js. I remember trying this few years back and cookies were not working when on different domains. I am planning to dockerize entire thing. Will the session work properly then?

Nb: I have been working on spring boot project for few years. My first few years was with django. Returning to django now.

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

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

Python Daily

I didn't want to go, but PyCharm finally drove me into the arms of VSCode, after 5+ years.

I just switched to VSCode after well over five years with PyCharm. I didn't want to do it, but I just can't stand it anymore.

Things I love about PyCharm and will miss

1. The refactoring functionality. VSCode's Python extension has that too, but it isn't as nice.

At this point, that's pretty much it.

Things that drove me nuts

1. IdeaVim. It actually got better recently, but for years and years, the undo function was busted, so you had to hit u over and over to undo what in real vim is a single operation. VSCode's neovim plugin uses actual neovim under the hood, which is obviously so much more robust and faithful, while IdeaVim will never be a full implementation.
2. The gradual accumulation of simple bugs that never get fixed.
3. It's so slow. I didn't appreciate just how slow until I switched over to VSCode. I mean, holy crap, it's 10x faster for a lot of things (opening a project, installing or restarting extensions, for example).

Here are the bugs that have bugged me the worst:

The "usages" window (cmd-click on a definition, see where it's used) constantly resizes itself too small. It's been a problem for years. They won't fix the way autosize

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

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

Python Daily

My flask open source alternative to Nexcloud !

I created an alternative to Nexcloud with flask, I'm really proud of myself honestly.

The goal is to be able to host a cloud storage service at home and control 100% of our files etc..

It's easy to use + compatible with linux and windows!

What do you think? Here's the github repo, it's open source and totally free.
https://github.com/Ciela2002/openhosting/tree/main

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

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

Python Daily

Turtle.py app to demo RGB color values

* What My Project Does

I've been working on turtle-related projects and I needed a simple, interactive, single-file Python program to explain RGB color values. I wrote this one up as part of my work writing [a Simple Turtle Tutorial written in Wikipedia-style Simple English](https://github.com/asweigart/simple-turtle-tutorial-for-python/) so it can be translated to non-English languages.

The app has three sliders for the amount of red, blue, and green for the window's background color. The RGB values are presented under the sliders for the 0.0 to 1.0 scale, 0 to 255 scale, and hexadecimal 0x00 to 0xFF scale. You can drag the sliders or click on the slider lines directly. There are also 14 preset color buttons along the top to click on.



PyPI page: https://pypi.org/project/turtlecolors/

GitHub repo: https://github.com/asweigart/turtlecolors

Install with `python -m pip install turtlecolors` on Windows or `python3 -m pip install turtlecolors` on macOS/Linux.

Run with `python -m turtlecolors` on Windows or `python3 -m turtlecolors` on macOS/Linux. Or run the code `import turtlecolors;turtlecolors.main()`

When the program first runs, it also prints out the color name strings that Python's turtle module uses. Unlike other lists of color names, I actually checked my list against the turtle.py to make sure they're correct. (I'm pretty sure clickbait articles just use chatgpt

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

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

Python Daily

I built a simple Terminal UI for pytest, feedback welcome!

# What My Project Does

I missed an easy, simple and quick way to run pytests in the terminal.

Link to project: https://github.com/0-sv/pytesttui.

My project lets you run `pytesttui` in your terminal. After opening, it shows you a tree of all your tests in the tests directory. Still in an early stage, so all it does is if you hit "r" and selected your test, it will run it. It scaled in the repository I use at work which contains about 500 tests. It is more efficient than running it in an IDE because it runs instantly, which is why I like terminal UIs.

If you'd like to try it and you have a Macbook, then visit my github page and download the release. Extract the files and place it in a PATH location like \~/.local/bin. You will probaby have to accept a security warning by MacOS, which is done by browsing to the "Privacy & Security" tab in settings and clicking on "Allow anyway" after running it. Make sure `pytest` is also accessible in a PATH location or installed using pip.

# Target Audience

This is meant as a toy project and just to get some feedback, and if there's enough attention, then I will keep

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

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

Python Daily

What are the best linters and language servers for python?

I am confused at the different language servers, linters, and formatters available. Here is what I have been able to figure out, is this correct?

Ruff is a linter / code formatter. It has overtaken Black and Flake8 as the best / most popular. Rust.\
\
JEDI is a library (~~but not a language server?~~) that supports autocompletion, goto, and refactoring.

Pyright is a language server maintained by Microsoft. It supports type checking, goto, autocomplete, similar to JEDI. It is written in TypeScript. I think Pylance is technically the language server and Pyright is the type checker (??)

MyPy is also a language server. It is considered slower and less fully featured than Pyright. It is used primarily because it supports plugins, such as for Pydantic and Django. It was started in 2012 and is written in Python.\
\
PyLSP/Python LSP Server is another language server but it requires another implementation such as JEDI to work. I am not sure what the advantages/disadvantages of it are.\
\
Some commercial IDEs like PyCharm use their own linters and type checkers.\
\
I use the Helix editor and by default it will use Ruff, JEDI, and pylsp together. While it works great,

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

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

Python Daily

Launched a hosting platform optimized for Django deployment

Hey, I'm Isaac. I've been deploying Django apps for years, and one thing that always annoyed me is how expensive it is—especially if you have multiple small projects.



The problem:

1. Paying for idle time – Most hosting options charge you 24/7, even though your app is idle most of the time.

2. Multiple apps, multiple bills – Want to deploy more than one Django service? Get ready to pay for each, even if they get minimal traffic.



I built Leapcell to fix this. It lets you deploy Django apps instantly, get a URL, and only pay for actual usage. No more idle costs.



If you’ve struggled with the cost of Django hosting, I’d love to hear your thoughts!

Try Leapcell: **https://leapcell.io/**

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

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

Python Daily

Tuesday Daily Thread: Advanced questions

# Weekly Wednesday Thread: Advanced Questions 🐍

Dive deep into Python with our Advanced Questions thread! This space is reserved for questions about more advanced Python topics, frameworks, and best practices.

## How it Works:

1. **Ask Away**: Post your advanced Python questions here.
2. **Expert Insights**: Get answers from experienced developers.
3. **Resource Pool**: Share or discover tutorials, articles, and tips.

## Guidelines:

* This thread is for **advanced questions only**. Beginner questions are welcome in our [Daily Beginner Thread](#daily-beginner-thread-link) every Thursday.
* Questions that are not advanced may be removed and redirected to the appropriate thread.

## Recommended Resources:

* If you don't receive a response, consider exploring r/LearnPython or join the [Python Discord Server](https://discord.gg/python) for quicker assistance.

## Example Questions:

1. **How can you implement a custom memory allocator in Python?**
2. **What are the best practices for optimizing Cython code for heavy numerical computations?**
3. **How do you set up a multi-threaded architecture using Python's Global Interpreter Lock (GIL)?**
4. **Can you explain the intricacies of metaclasses and how they influence object-oriented design in Python?**
5. **How would you go about implementing a distributed task queue using Celery and RabbitMQ?**
6. **What are some advanced use-cases for Python's decorators?**
7. **How can you achieve real-time data streaming in Python with WebSockets?**
8. **What are the

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

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

Python Daily

Should I Use CDNs for Bootstrap & HTMX in My Django App?

Hey everyone,

I'm currently building a Django app and considering using CDNs to serve Bootstrap and HTMX. A friend of mine warned me against using CDNs in production, but neither of us have much experience, so I wanted to get insights from more experienced developers.

Are there any security, performance, or reliability concerns I should be aware of when relying on CDNs for these libraries? Would it be better to self-host them instead? If so, what’s the best approach for managing updates efficiently?

I’d really appreciate any advice or best practices you can share. Thanks in advance!

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

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

Python Daily

At what point is HTMx not going to suffice for large ERP?

I'm starting a new project that will be large with lots of moving parts, complex modules, and different spaces for different users. Its an ERP, so you can imagine the types of data and functionality I will be building.

For past large projects, I have always used Django DRF as an API backend and a VueJS frontend to consume the API. This has worked well in the past, providing a rich user interface and experience. However, it always comes at the cost of overall project complexity given that there are two separate code bases to manage.

So, instead of DRF + VueJS I'm considering Django templates + HTMx. I've worked with HTMx in the past, but not extensively. I've also always heard the phrase "unless you're building a spreadsheet type app, HTMx will be fine". OK - but, I might need some of that level of complexity given that I'm building an ERP. I just don't want to get into Django + HTMx and realize 6 months down the road, HTMx isn't going to cut it.

My question is - have any of you built really large projects with complex UI/UX and only used the Django templates + HTMx? Can

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

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

Python Daily

Redis as cache.


At work, we needed to implement Redis for a caching solution. After some searching, btw clickhouse has great website for searching python packages here.
I found a library that that made working with redis a breeze Redis-Dict.


from redis_dict import RedisDict
from datetime import timedelta

cache = RedisDict(expire=timedelta(minutes=60))

request = {"data": {"1": "23"}}

web_id = "123"
cache[web_id] = request["data"]


Finished implementing our entire caching feature the same day I found this library (didn't push until the end of the week though...).



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

Читать полностью…
Subscribe to a channel