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
How to

Im 18 M (college student)and have an solid saas idea and i have some experience in python and genric programming and i dont have a lot of money to build my idea and i dont have any experience in django and web dev how can i make an mvp for my saas without hiring or spending money.

/r/djangolearning
https://redd.it/1k6qfqn
Seeking a package/library that handles rectangles containing rectangles recursively

Hi, I am trying to find some pointers to existing packages/libraries that can handle the rectangles containing rectangles.

1. Each rectangle can contain multiple child rectangles. Each child rectangles can also contain grand children rectangles.

2. The location coordinates of the child rectangles are basing on the lower left corner of the parent rectangle relatively. E.g., Rect A contains Rect B (at [1, 1\]). Draw A at [2, 2\] of the canvas, then Rect B should be drawn at [3, 3\] of the canvas.

3. Each rectangle, child rectangle, ..., has an attribute denoting its rotation (0, 90, 180, 270 degs). E.g., If the above Rect B is set to rotate 90 degs, it will be rotate 90 degs, then place at [1, 1\] of the Rect A.

4. All the placement and rotation, ..., are happening recursively. I.e., when Rect B is rotated, its children also rotate respectively.

This seems to have quite common behaviors in diagramming/geometry programming practices. Could some kind souls suggest good packages/libraries doing these?

I have checked shapely. However, it does not handle child rectangles very well. The child rectangles are using the absolute coordinate, same as the parent rectangles.



/r/Python
https://redd.it/1k7xqal
Science 3d plots animation

**What My Project Does**

I made a repository using python to create 3d plots and export them in video.

**Target Audience**

Science enthusiasts, professors, anyone who knows math and/or loves beautiful science.

**Comparison**

The idea differs from others repos because my structure is/will be scalable to add any 3d plot using only the model. I already added the Lorenz attractor and Rössler attractor, but many more will be added.

I will cover all strange/chaotic attractors and related plots that I find beautiful, and improve the framework along the way. If you have any tip, I'm all ears, I plan to do more things using python to show the potential of the language in fields not so explored in the dev community (hard science).

If you want to simulate and generate a new 3d plot, create your PR.

I will use this repo and this Instagram profile to show the progress:

Instagram: https://www.instagram.com/science_plots_3d?igsh=eXhhOHF5NzV2aXV6

GitHub: https://github.com/matheusvra/scientific_plots

/r/Python
https://redd.it/1k7uw2f
PyData Paris 2025

The 2025 edition of the PyData Paris conference will take place on 30th September and 1st October at the Cité des Sciences et de l’Industrie. 🎉
We would love to hear from open-source and data enthusiasts! Please submit a proposal, the CfP is open until Sunday 27th April (yes, in 2 days !).
If you want to support and sponsor the event, please contact us !

You can find the information on our website: https://pydata.org/paris2025

/r/Python
https://redd.it/1k7kke7
The Complete Flask Rest Api Python Guide


Hey, I have made a guide about building rest apis in python with flask, it starts from the basics and covers the crud operations.

In the guide we use Sql with Postgres, and threading is also involved.

I would love to share it in case any one is interested.

The link is: https://www.youtube.com/watch?v=vW-DKBuIQsE

/r/Python
https://redd.it/1k7sarf
A minimalist web agent for sentiment analysis

Hi folks,

I've spent the last few weeks working on a Software Development Kit for sentiment analysis. I'm using Gemini-flash 2.0 as a planner.

Rabbit SDK is different because the primary focus is research by providing sentiment analysis. Its also minimalist, I've mads it super easy to set up.

What my project does: Gathers web data and provides sentiment analysis. The output is a JSON file.

Target Audience: Version 0.1.0 is a toy project with plans to expand to production.

Comparison: Its similar to browseruse except Rabbit is focused on sentiment analysis.

Github : https://github.com/wchisasa/rabbit


/r/Python
https://redd.it/1k8c2lx
Can AI play a role in creating automated software tests?

In the latest episode of Test & Code, Anthony Shaw and Brian Okken discuss using copilot and other AI tools to generate automated software tests.

Here's the episode: The role of AI in software testing - Anthony Shaw

AI is helping people write code.  
Tests are one of those things that some people don't like to write.   

Can AI play a role in creating automated software tests?  
Well, yes. But it's a nuanced yes.  

Anthony Shaw comes on the show to discuss the topic and try to get AI to write some test for my very own cards project.

We discuss:

The promise of AI writing your tests for you
Downsides to not writing tests yourself
Bad ways to generate tests
Good ways to ask AI for help in writing tests
Tricks to get better results while using copilot and other AI tools

A video version of this discussion was posted by Anthony: [Should AI write tests?](
https://www.youtube.com/watch?v=a_V-BH_luJ4)

I'd love to hear from others:

Are you using AI to help generate (or completely generate) tests?
Do you have any good tricks?
Are there other reasons to NOT try this at home?



/r/Python
https://redd.it/1k8glge
Global private functions? Is this "good practice" in any setting?

I was looking at the `xarray` repo and found this file: [https://github.com/pydata/xarray/blob/2f1751df7fb1d7c2baab9f559b220eb37ecc14e0/xarray/backends/api.py#L4](https://github.com/pydata/xarray/blob/2f1751df7fb1d7c2baab9f559b220eb37ecc14e0/xarray/backends/api.py#L4)

<importing section>


def _get_default_engine_remote_uri() -> Literal["netcdf4", "pydap"]:

# Code.....


I'm not particularly new to the language but I don't recall private functions being outside of a class ever being a good thing, quality-wise.

What am I missing here? Do "API" libraries follow different paradigms?

/r/Python
https://redd.it/1k8kkaq
Pip 25.1 is here - install dependency groups and output lock files!

This weekend pip 25.1 has been released, the big new features are that you can now install a dependency group, e.g. pip install --group test, and there is experimental support for outputting a PEP 751 lock file, e.g. pip lock requests -o -.

There is a larger changelog than normal but but one of our maintainers has wrote up an excellent highlights blog post: https://ichard26.github.io/blog/2025/04/whats-new-in-pip-25.1/

Otherwise here is the full changelog: https://github.com/pypa/pip/blob/main/NEWS.rst#251-2025-04-26

/r/Python
https://redd.it/1k8lav8
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/1k8qtm2
Django Mentor or Learning Partner in Taiwan

Learning Django in Taiwan was kind of hard to find a mentor or people to work with. I can barely find people that using Django or talking about it.
Currently, I'm learning it on my own, but I really happy to have a person that can talk to, even help me to check or discuss even just sharing the progress , so just wondering is there any people that were also into Django are in Taiwan.

/r/django
https://redd.it/1k8t7aj
Posted Hyperion on Product Hunt today

Just a quick update — I posted Hyperion on Product Hunt today, mainly because… why not?
If you want to check it out or leave some love, here’s the link:

https://www.producthunt.com/posts/hyperion-2?utmsource=twitter&utmmedium=social

Thanks again for all the early support!


/r/django
https://redd.it/1k8d5s5
How does Python 3.13 perform vs 3.11 in single-threaded mode?

When Python 3.12 was released, I had held back from migrating my Python 3.11 applications as there were some mixed opinions back then about Python 3.12's performance vs 3.11. Then, 3.13 was released, and I decided to give it some time to mature before evaluating it.

Now, we're in Python 3.13.3 and the last bugfix release of 3.11 is out. When I Google'd, I only found performance studies on Python 3.13 in its experimental free-threaded mode, which is definitely slower than 3.11. However, I found nothing about 3.13 in regular GIL mode.

What are you guys' thoughts on this? Performance-wise, how is Python 3.13 compared to Python 3.11 when both are in GIL-enabled, single-threaded mode? Does the experimental JIT compiler in 3.13 help in this regard?

/r/Python
https://redd.it/1k8zcdi
I've created a simple social media scheduling app with just Django and Alpinejs

Django is such an underrated web framework.

Not sure about you, but my feed is full of javascript frameworks like Nextjs (which introduces breaking changes every 3 months) and is no where near the features Django provides.

But, that's probably because there are more javascript devs than python devs?

And since Django is an old framework with great documentation and questions on the internet on various topics - it works pretty well with LLMs and it helps with speeding up development.

The app is open-source you can check it out here:

https://github.com/ClimenteA/social-media-posts-scheduler


Works as a boilerplate too if you remove the specific code for the app.





/r/django
https://redd.it/1k91zuw
Favorite Admin UI configs

What are some of your favorite admin UI configurations?

Django examples, libraries, packages all welcome!

I’m super basic, just adding backend functionality stuff, organizing custom app labels with a simple 50 line custom_admin.py file etc, but I’m thinking to give the ui a makeover, might even do something dynamic..?

I see some neat lil packages and stuff on a few YT vids but -

Whatchy’all doin’?

🙂

/r/django
https://redd.it/1k975fm
Server and my flask app keeps crashing on VPS.

Hello, I am running a VPS with my flask [app.py](http://app.py) which I can access with ssh. My application is running well for one or two days and then it suddenly stops. I tried to resolve it for many rounds with ChatGPT or LeChat but it won't stop happening. My logs are not helping so much and all the logs in error.txt and output.log also appear when the server is still running fine.

**Now I wanted to ask if I am doing something fundamentally wrong? What am I missing..**

I tried:

* fail2ban. Are bots crashing it?
* checking memory which seemed to be fine
* running a cronjob (monitor\_flask.sh) to at least restart it. But that does not seem to work either.

**Last logs from my error.txt**:

>multiple of these lines >>> 2025-04-26 21:20:06,126 - app - ERROR - Unhandled Exception: 403 Forbidden: You don't have the permission to access the requested resource. It is either read-protected or not readable by the server.

**Last logs from my output.log**

>

>multiple of these lines >>>
\[Sun Apr 27 09:29:01 UTC 2025\] Starting monitor\_flask.sh - Unique Message

>\[Sun Apr 27 09:29:01 UTC 2025\] Activating virtual environment...

>\[Sun Apr 27 09:29:01 UTC 2025\] Virtual environment activated.

>\[Sun Apr 27 09:29:01 UTC 2025\] Flask app

/r/flask
https://redd.it/1k90a8h
RESTful APIs with Flask!!

hello friends! I saw that many of you liked the unofficial flask wiki that me and my colleagues created. We've created a full wiki article on RESTful APIs at the request of some people :)!!! https://flaskwiki.wiki/rs/restful-apis

So I'm coming to you again to ask for feedback, if you have any opinion or even want to add content to the article you can contact me or comment here !!!

Guys really, thank you so much to the people who contributed and the people who helped, especially superchose43, Aland_L, Jason32 they brought a real expertise to this article, I knew so little about restfull ... now i've been in for 3 days straight and I feel like I have hundreds of ideas lmaoo TT

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