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
Senior Developer Live Coding

Hey everyone,

I’m a senior software engineer with 10 years of experience, and I’m currently building a fitness app to help users achieve their goals through personalized workout plans and cutting-edge tech.

Here’s what the project involves:

* **AI-Powered Customization**: The app will use AI (via ChatGPT) to help users design workout plans tailored to their goals and preferences, whether they're beginners or seasoned lifters.
* **Full-Stack Development**: The project features a Django backend and a modern frontend, all built within a monorepo structure for streamlined development.
* **Open Collaboration**: I’m hosting weekly live coding sessions where I’ll be sharing the process, tackling challenges, and taking feedback from the community.

To bring you along for the journey, I’ll be hosting **weekly live coding sessions** on Twitch and YouTube. These sessions will cover everything from backend architecture and frontend design to integrating AI and deployment workflows. If you're interested in software development, fitness tech, or both, this is a chance to see a real-world app being built from the ground up.

**Next stream details:**

* **When**: Friday January 10th around 12pm Eastern
* **Where**: Twitch ([https://www.twitch.tv/soccer\_head\_](https://www.twitch.tv/soccer_head_)) and YouTube (\[[https://www.youtube.com/@soccerhead9525](https://www.youtube.com/@soccerhead9525)\])

I’d love for you to join the stream, share your ideas, and maybe even help me debug a thing or two. Follow

/r/django
https://redd.it/1hxrz2k
obliquetree: Advanced Decision Tree Implementation

# obliquetree

`obliquetree` is an advanced decision tree library designed to offer high-performance and interpretable models. It supports both classification and regression tasks, enabling a wide range of applications. By leveraging both traditional and oblique splits, `obliquetree` provides flexibility and improved generalization, particularly in shallow trees, making it a powerful alternative to conventional decision trees.

You can access the project from here: [ObliqueTree GitHub Repository](https://github.com/sametcopur/obliquetree)

What `obliquetree` Does:

* **Oblique Splits for Better Patterns**: Utilizes linear combinations of features for splitting, capturing complex patterns effectively.
* **Traditional Splits for Simplicity**: Supports axis-aligned splits, maintaining simplicity and interpretability.
* **Performance Optimization**: Ensures high speed and efficiency while supporting categorical features and missing value handling.
* **Scalability and Interpretability**: Excels at providing interpretable models with fewer splits.

# Key Features

* **Oblique Splits**: Use linear combinations of features to capture complex data patterns.
* **Axis-Aligned Splits**: Supports conventional decision tree behavior for simplicity.
* **Categorical Feature Handling**: Works seamlessly with categorical data, requiring only label encoding.
* **Optimized Performance**: Up to 50% faster for float columns and 200% faster for integer columns compared to `scikit-learn`.
* **Feature Constraints**: Limit the number of features used in oblique splits for simpler, interpretable trees.
* **Missing Value Handling**: Automatically assigns missing values (`NaN`) to optimal leaves.
* **Seamless Integration**: Guarantees

/r/Python
https://redd.it/1hxaa85
Handling embedded iframe player (PlayerJS - bunny.net) in Django template

I am trying to create a custom video player using PlayerJS within my Django app (Plain htmx template), have tested the general setup on a static website with no problem, but the player events/methods are not working properly in Django. Feel like I am missing something obvious.

The "ready" event fires on load

player.on("ready", () => {
console.log("Player ready");
})

But all other methods/events don't fire/ have no effect. The video shows normally and I can start/stop it using the player controls provided by bunny.net. However the "play" event is not firing. I am slo getting no error messages.

player.on("play", () => {
console.log("Video is playing");
})


Console

My template

{% extends 'base.html' %}
{% load customtags %}
{% block content %}

<h1>Videos index</h1>

<iframe
id="bunny-stream-embed"
src="
https://iframe.mediadelivery.net/embed/{% settingsvalue "BUNNYCDNLIBRARYID" %}/{{ object.bunnyvideoid }}"


/r/djangolearning
https://redd.it/1hxuzb1
My django based, open source PDF manager and viewer now supports editing and markdown notes

Hi r/django,

I am the developer of PdfDing. You can find the repo [here](https://github.com/mrmn2/PdfDing). Last time I posted about PdfDing, there were a couple of features that were requested quite often. As they are now implemented I just wanted to do a quick follow up post. PdfDing now has the following features:

* it is now possible to edit PDFs by adding annotations, highlighting and drawings
* you can organize your PDFs with multi-level tags as simple tags did not work for many people
* you can add markdown notes to store additional information about your PDFs
* there is now a live demo instance. You can try PdfDing [here](https://demo.pdfding.com) without pulling the docker image.
* very soon you will be able to star and archive PDFs

If you like PdfDing I would be really happy over a star on [GitHub](https://github.com/mrmn2/PdfDing). If anyone wants to contribute you are welcome to do so!

/r/django
https://redd.it/1hy0931
how much time to learn Django ?

i have a project on django (ERP app) in which i need to understand app already developed , add new features , mantain app.. i need to estimate workload of this. Knowing that i have an intermediate level of python, what is the range of time that this project would take ?

/r/django
https://redd.it/1hy4z8q
Django Developer Job at Spotter

Hi everyone! I recently applied for a Django Developer position at Spotte (Spotter Labs). After passing an initial screening, I was told to complete a coding assessment with the promise of a $100 USD reward upon successful completion.

Has anyone else done this task and actually moved forward in the process? Did you get paid and proceed to the next stage, or do you think this might be a scam? I know some might say "why not try," but I’m really stressed with my current work and don’t have the time to invest in this. If I end up spending time on it and nothing comes of it, that would be pretty disappointing.

/r/django
https://redd.it/1hy36cz
Django APIs combined with iOS learning resources.

I've been learning Django and started building an iOS app as a first project. I followed a few iOS tutorials and used ChatGPT to get help whenever i get stuck. I struggle to fully grasp the communication and sending data between iOS and Django. I was just wondering if anyone know any good courses or resources for learning more about the Django REST API and building iOS apps that interact with Django and a database.

/r/django
https://redd.it/1hy1rpy
I created a linter for your dependencies (requirements.txt file!)

Hey there. I've been working on a dependencies-related product for the last year. A lot of engineering teams that I've seen are building their own internal tooling to check on dependencies.

In short, people either update too frequently or don't update at all.

So, I decided to create a simple linter that checks all the main issues and best practices, comes with sensible defaults, and allows you to adjust it to your needs.

It supports npm/yarn, Go, pip, and Cargo. Any feedback is welcome!

Link: https://github.com/DepsHubHQ/depshub


What My Project Does
Checks your requirements.txt file on 20+ rules.

Target Audience
Mostly developers running it locally or on the CI. Still in beta.

Comparison
There are no popular linters for dependencies at all. The most popular tool to deal with dependencies is dependabot but it works in a completely different way.

/r/Python
https://redd.it/1hy1q3n
Calling all drf repo owners - I'll do your work for you for free

Ok, slightly click-bait-ey title, but hear me out.


I'm a senior dev with over a decade of django experience, and nearly 2 decades working in AI. I have created a django specific AI to work as a mid level developer and I'd like to get some feedback on it's performance 'in the wild'.

The easiest way to do this at the moment is for me to manage it and to let it have a branch of it's own (so it's easy for you to optionally ignore anything it does). I use OpenAI and I'll cover all the costs. I'm happy to be effectively interviewed, share details of past projects (privately) etc., whatever processes you need to go through to validate this being worthwhile.

The repo can be open source or private, it can work with django, but it's not great at UI design, thus DRF, but I'm willing to try it on a django repo if there is appetite.

I use this in my current job, I'm head of department and thus able to make the call myself. I've also allowed friends to use it with their work and in general it's a positive experience - fire the request off, grab a drink and

/r/django
https://redd.it/1hydw9e
Can you suggest correct model to make for given problem?

I am assigned with a task of adding a reward/penalty type function to our work site. its a point based system.

here is what the system already has.

Employees: Users

Tasks: employees/managers create and assign task, task detail, task deadline etc., you can mark task complete, amend deadline(if self assigned), update status (ongoing, pending, completed, on hold)



points function: points added if task marked complete before deadline, points removed if missed deadline. A manager can override points like negate penalty if there is a valid reason. managers can manually add or deduct points for other things like positive for finding bugs and negative for AWOL or submitting buggy code repeatedly etc. Task based points are calculated automatically while other types are assigned manually. Managers can override points awarded automatically given valid reason. eg: If -3 points are added for missing a deadline but the employee missed it due to being hospitalised then manager would just add/award +3 points to cancel it out. So all manually given points are called manual_adjustment_points.



so I am trying to make a model as the first step. But I keep feeling I am missing something. My current model is as following.



Model: Rewards:


/r/djangolearning
https://redd.it/1hxduv3
Separate package

apps = ['silk']
if settings.DEBUG and all(app in settings.INSTALLED_APPS for app in apps):
urlpatterns += [
path('silk/', include('silk.urls', namespace='silk')),
]

It worked fine, but is this the correct approach?

/r/django
https://redd.it/1hy1oql
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/1hyivpf
How Much Should I Charge for Developing a Custom ERP System?

**Hi everyone,**

I’m currently building a web-based ERP system for a small manufacturing company in India. Here are some of the features I’ll be including:

1. **Production Module**
* **Step-by-Step Process Management**:
* Tracks production steps with barcode scanning.
* Input/output validation for each step.
* Automatically progresses to the next step after scanning.
* **Real-Time Monitoring**: Provides an overview of ongoing production processes.
* **Defect Tracking**: Logs and reports defective items at each step.
2. **Stock Monitoring**
* **Real-Time Inventory Tracking**: Automatically updates stock levels as materials are used or replenished.
* **Low Stock Alerts**: Sends notifications for stock reaching minimum thresholds.
* **Department-Wise Inventory Management**: Manages separate stock data for each department.
3. **Reporting Capability**
* **Production Reports**: Detailed insights into completed and ongoing production.
* **Inventory Reports**: Tracks usage and availability trends.
* **Financial Reports**: Summarizes costs, revenue, and invoicing.
* **Customizable Reports**: Exportable to Excel or PDF.
4. **Invoicing Module**
* Generates and manages customer invoices.
* Tracks payment statuses.


/r/django
https://redd.it/1hyoi69
[Dataset][R] 19,762 Garbage Images for Building AI Recycling Solutions

Hi ML community!

I’m excited to share the **Garbage Classification V2 Dataset**, featuring **19,762 high-quality images** of garbage categorized into **10 distinct classes** (e.g., metal, plastic, clothes, and paper).

# Why this matters:

* Train AI models for **automated waste sorting and recycling**.
* Develop **waste segregation apps** or sustainability-focused tools.
* Create innovative **computer vision projects** for environmental impact.

🔗 **Dataset Link:** [Garbage Classification V2](https://www.kaggle.com/datasets/sumn2u/garbage-classification-v2/)

This dataset has been used in the research paper, *"Managing Household Waste Through Transfer Learning,"* proving its utility in real-world applications.

Looking forward to seeing how you can use it to promote sustainability!

/r/MachineLearning
https://redd.it/1hyfaoc
Are there any actual use cases of Python in Excel?

I’m trying to understand how useful it really is/ having not really touched it at all, I imagine someone versed in Python could optimize some of their workflow were they forced to work in excel. But given the fundamental processing limitations of excel I can’t imagine how scalable this is. Has anyone had practical experience using the Python - excel plugin to accomplish things easier than you could in either excel or Python alone and if so, what?

/r/Python
https://redd.it/1hylc50
Long time listener, first time caller

I have been using Django for the last few years and always wanted to check flask out.

2 days ago i started playing around with it.... I love it.

Compared to Django development has been so fast and way more flexible (which can be good and bad)

I have built a basic app with user auth and org level and test deployed using mongodb, gunicorn, docker on google cloud run all within a day basically

Great job devs 👍

Sorry for the useless post but thought id share my experience

/r/flask
https://redd.it/1hxu65g
Open source Contribution

Can anyone guide me through the steps of contributing to Django?

/r/django
https://redd.it/1hyw6nv
PyGAD 3.4.0 Released: Python library for optimization using the genetic algorithm.

PyGAD is a Python library for solving general-purpose optimization problems using the genetic algorithm.

GitHub repository: https://github.com/ahmedfgad/GeneticAlgorithmPython

Documentation: https://pygad.readthedocs.io

Quick release notes:

1. The delay_after_gen parameter is removed from the `pygad.GA` class constructor.
2. The plot_pareto_front_curve() method added to the pygad.visualize.plot.Plot class to visualize the Pareto front for multi-objective problems.
3. Created a new method called unique_float_gene_from_range() inside the pygad.helper.unique.Unique class to find a unique floating-point number from a range.
4. The Matplotlib library is only imported when a method inside the pygad/visualize/plot.py script is used.
5. While making prediction using the pygad.torchga.predict() function, no gradients are calculated.
6. The gene_type parameter of the pygad.helper.unique.Unique.unique_int_gene_from_range() method accepts the type of the current gene only instead of the full gene_type list.
7. More bug fixes.

/r/Python
https://redd.it/1hyxjqi
Docker + uv - virtual environments

# Why?

uv uses an existing virtual environment(.venv) or creates one if it doesn't exist. But, using a Python virtual environment inside a Docker container is generally unnecessary and can even be counterproductive. As a container itself provides an isolated environment and does not need further isolation using virtual environments. When you create a Docker image, it includes its own filesystem, libraries, and dependencies. Using a virtual environment in container adds unneeded steps and unnecessary complexity. You'd need to create and activate the virtual environment during container startup. We can avoid this.

# How?

we can use uv for package installation in Docker without a virtual environment using "--system" flag

uv pip install --system <package>

uv pip install --system -r requirements.txt

NOTE: "uv run" and **"uv add"**NOTE: "uv run" and "uv add" commands will create virtual environment(.venv), if it doesn't exist. So, you will not be using those command inside the container. But, use them with in your local development virtual environment.

RUN uv add gunicorn
CMD "uv", "run", "app.py"

Instead use only "uv pip install --system" and simple "python" commands

RUN uv pip

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