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
Help needed. Problem with my jupyter notebook.

Well i installed conda and when i open jupyter notebook it looks like this:

https://preview.redd.it/e58njrswim2d1.png?width=1902&format=png&auto=webp&s=8ceaec4d9b73ef4988abf1c3f99b474fc957fc58

It didnt use to look like that. Now its just ugly. The problem happened after i uninstalled anaconda and reinstalled it.

/r/JupyterNotebooks
https://redd.it/1d0jisk
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/1d0p0iv
Custom authentication

I have a custom email authentication system. What I do not fully understand is why it works with login_view() without creating a specific view for logging in with email. The form works with email or username and the email gets authenticated in the login_view authenticate() method event though email=username is not being passed. Any assistance will be greatly appreciated. Thank you.

login.html

<div class="login-form-container">
<h1 class="login-form-containerheader" >Please Login</h1>
<form action="" method="POST" class="login-form-containerform">
{% csrftoken %}
{{ form.as
p }}
<button type='submit'>Login</button>
</form>
</div>

settings.py

AUTHENTICATIONBACKENDS = [
'django.contrib.auth.backends.ModelBackend',
'account.email
authentication.EmailAuthBackend',
]

views.py

def loginview(request):
form = LoginForm(
request.POST or None)
if form.is
valid():


/r/django
https://redd.it/1d0sxn2
Looking for open source projects

Hello. Let me introduce myself briefly: I live in Turkey. I have a bachelor's degree in engineering, a master's degree in philosophy, and I am currently a doctoral student in philosophy. I worked as a full-time back-end developer at one of Big4 companies for 4 months. I used technologies such as Python, Java, Django in my amateur projects, but in my professional experience I used PHP and Spryker.

I want to continue my career abroad (Germany, UK). I am aware of the crisis in the IT industry. I am looking for alternative ways other than constantly seeing the same ads on LinkedIn and applying. Maybe reddit can help me, who knows.

I want to expand my network and evaluate my chances of finding a possible job. If you have open-source projects, I would like to be involved. Also, I am open to any suggestions. If anyone wishes, I can share my GitHub and LinkedIn accounts via DM.

/r/django
https://redd.it/1d0ndh2
Spotify Lyrics visualizer

What My Project Does

Because spotify made their lyrics menu a premium only feature, I thought I'd make my own replacement for it.
The app connects to your spotify account, fetches the lyrics from various websites, and then syncs them automatically to what is currently playing. Basically does the exact same as the lyrics menu used to do.

Target Audience

Anyone who wants to see the lyrics to songs really.

Comparison

Most other apps that I've found are either browser only, or don't actually sync the lyrics to the song, they just show the entire lyrics at once.
In comparison, my app shows the lyrics line by line, synced with the song, and also has (in my opinion lol) a fairly nice looking ui.
It's also very easy to use for non programmers too, since you can just download an executable to use the app.

It's available for free here https://github.com/Mews/spotify-lyrics



/r/Python
https://redd.it/1d0nb3k
I created an unofficial module for the ShipEngine API

What My Project Does

Simplifies the interaction with the ShipEngine API with most response and requests built as objects, which in my opinion makes interaction much easier. This is my first released package so all criticism and feedback is very welcome.


Target Audience

Anyone who deals with the current ShipEngine API using Python.


Comparison

There is an official ShipEngine API module that is created by the company but I have found it somewhat lack luster with no way to create batches or bulk shipments (and other missing functionality), this is much more suited to accomplishing that task.


Links

https://github.com/Sen-tio/unofficial-shipengine

/r/Python
https://redd.it/1d0qkfd
Rye-Tui, a Text-based User Interface (TUI) to manage rye projects

Hi everyone, Ive reached a state of my current project, where I want to share it with you, and gather some feedback. This is my first time using rye and I am surprised, how Hassle-Free building a package with it went.
Source Code: github

# Installation
python -m pip install rye-tui

for CLI Tools I recommend using pipx or rye.
pipx install rye-tui

rye install rye-tui

After Installation you can open the TUI using trye in your Terminal. On first use a config file is generated. After that use trye again in your rye managed project

# What My Project Does
A Text-based User Interface (TUI) for rye written in python using Textual

# Current State
Currently rye-tui supports the following functionalities of rye:

- creating new projects (flag-support coming soon)
- adding normal and dev dependencies (flag-support coming soon)
- pinning versions
- Syncing (flag-support coming soon)
- changing rye's configuration (sources and default coming soon)

# Target Audience
Python developers and rye users who like a UI to manage their rye projects.

# Comparison
To my knowledge there is no similar tool for rye. Maybe the Anaconda UI comes closest for Anaconda Users.

# Last Words
Feel free to try(e) it out. Happy to hear your feedback.

/r/Python
https://redd.it/1czvlns
Render Images from DB with image path value

Hello guys, I'm having trouble with loading up images, as it would just show me a broken image icon,
So my DB gets updated once I run this script which takes an input video, detects a rider not wearing helmets, fetches the number plate, runs ocr, extract the text and accordingly stores the images of these riders in output directory and the Vehicle_number along with their respective image_path in the DB.
Now what I want to do is, get this info from the DB, and make an webapp which would have an action button i,e Correct, if I tap on correct, the image would be move to a verified directory. The information is updated every 5 secs from the DB. I've attached screenshots of my codes

App_test.py

1

2

3

index.html

https://preview.redd.it/vi0hglqcqq2d1.png?width=668&format=png&auto=webp&s=ac296d4fdb0bb0eab89b68c3fe94ca242fb94f29

Here's the structure
Your_Project

..App_test.py
..Vehicle_data.db

..templates -
......\\index.html

..static -
......\\output
..........\\jpg files
..........\\verified

/r/flask
https://redd.it/1d0xspv
Adding Stimulus.js to Django

Hey all,

I wrote a small tutorial on how to integrate Stimulus.js into your Django application. I know Stimulus.js is not the most popular framework out there, but it is the one I enjoy using when I need to (which is very rare). I hope this is useful for someone out there.

Thanks for reading. Can't wait hear for your feedback.

https://builtwithdjango.com/blog/stimulusjs

/r/djangolearning
https://redd.it/1d0u1dz
Yet Another REST Client

A developer shares the journey of creating a new API client called Yaak after experiencing frustrations with existing tools like Insomnia. The post discusses the motivation behind Yaak, the burnout faced by the developer, and the future plans for the tool.

Source:https://app.daily.dev/posts/yet-another-rest-client--mkaukg8if

/r/Python
https://redd.it/1d16s91
An IDE with the same step by step functionality as in Matlab

When working with Matlab I love how I can run the code step by step to debug it. Even being able to "step in" functions and loops.

Then, I was looking to an IDE with a similar functionality for Python. Nowadays I'm using Spyder.

/r/Python
https://redd.it/1d15leb
Learnt basics django did some projects. What next?

/r/django
https://redd.it/1d13vng
AI planner: AI tool for efficient event scheduling in Google Calendar.

Good evening! I have created a new projectfor adding events to google calendar based on the text a user inputs.

## What My Project Does

The project is a tool that uses large language models to understand the user's input and add events to the user's Google Calendar based on the user's input. It uses Ollama for natural language understanding and Google Calendar API for adding events to the user's calendar.

## How My Project Works

Ollama uses Llama 3 with pre-instructions to act as a calendar event planner. The tool uses the model to generate responses to extract the event's details from the user's input inserted in the Web Interface. tool then asks the user to confirm the details extracted from the user's input and adds the event to the user's Google Calendar (example shown here)

## References

Checkout my github repository AIPlanner for more details about the project.

/r/Python
https://redd.it/1d11nfg
I cant load images in my flask application

I have a collage project and i made a recipe finder using flask. I created a database for all of my recipes with images, I saved all of my images in the static/images/name.jpg but when I load the site it doesn't load the images, I tried with chatgpt but I still don't manage to make it work. If you could help me it would be welcomed.

https://github.com/antalkrisztian10/recipe\_finder1

/r/flask
https://redd.it/1d16ckx
Getting Started with Django 2024: Enhancing Security in Django[Part 13/16] I have covered common security threats, built-in Django security features, best practices, implementing HTTPS, and using security middleware. Perfect for beginners looking to secure their Django applications.
https://medium.com/@mathur.danduprolu/getting-started-with-django-2024-performance-and-optimization-in-django-part-13-16-ab3042ccdc16

/r/djangolearning
https://redd.it/1d1efpu
Monday Daily Thread: Project ideas!

# Weekly Thread: Project Ideas 💡

Welcome to our weekly Project Ideas thread! Whether you're a newbie looking for a first project or an expert seeking a new challenge, this is the place for you.

## How it Works:

1. **Suggest a Project**: Comment your project idea—be it beginner-friendly or advanced.
2. **Build & Share**: If you complete a project, reply to the original comment, share your experience, and attach your source code.
3. **Explore**: Looking for ideas? Check out Al Sweigart's ["The Big Book of Small Python Projects"](https://www.amazon.com/Big-Book-Small-Python-Programming/dp/1718501242) for inspiration.

## Guidelines:

* Clearly state the difficulty level.
* Provide a brief description and, if possible, outline the tech stack.
* Feel free to link to tutorials or resources that might help.

# Example Submissions:

## Project Idea: Chatbot

**Difficulty**: Intermediate

**Tech Stack**: Python, NLP, Flask/FastAPI/Litestar

**Description**: Create a chatbot that can answer FAQs for a website.

**Resources**: [Building a Chatbot with Python](https://www.youtube.com/watch?v=a37BL0stIuM)

# Project Idea: Weather Dashboard

**Difficulty**: Beginner

**Tech Stack**: HTML, CSS, JavaScript, API

**Description**: Build a dashboard that displays real-time weather information using a weather API.

**Resources**: [Weather API Tutorial](https://www.youtube.com/watch?v=9P5MY_2i7K8)

## Project Idea: File Organizer

**Difficulty**: Beginner

**Tech Stack**: Python, File I/O

**Description**: Create a script that organizes files in a directory into sub-folders based on file type.

**Resources**: [Automate the Boring Stuff: Organizing Files](https://automatetheboringstuff.com/2e/chapter9/)

Let's help each other grow. Happy

/r/Python
https://redd.it/1d1eqao
[P] ReRecall: I tried to recreate Microsoft's Recall using open-source models & tools

Recall sounds to me like a privacy nightmare, so I thought I might give it a try to make something similar using only open source components. Here is the code if you want to play around with it:

[https://github.com/AbdBarho/ReRecall](https://github.com/AbdBarho/ReRecall)

Overall it went better than I expected, I use \`mss\` to take screenshots of the monitor(s), and use ollama and llava and mxbai embed to generate descriptions and embeddings of the screenshots, and then chromadb for storage and search.

There is definitely huge room for improvement here:

* There are plenty of hallucinations in the generated descriptions of screenshots, this could be a combination of the size the MLLM used to generate the descriptions (I use a very small model because I have a rusty 1060), or because the screenshots are very high in resolutions (no resizing is done after a screenshot).
* The search is very basic, it just matches the embeddings of the query text with the embeddings of the screenshots, a potential improvement could be to use the model to enrich the user query with more information before embedding it for search.
* I am fairly certain that Microsoft does not rely solely on screenshots as I do, but also captures of individual app

/r/MachineLearning
https://redd.it/1d14pad
Getting Started with Django 2024: Performance and Optimization in Django [Part 12/16] I've covered database optimization, query optimization, caching strategies, using CDNs, and monitoring and profiling. Perfect for beginners looking to enhance their Django application's performance.
https://medium.com/@mathur.danduprolu/getting-started-with-django-2024-performance-and-optimization-in-django-part-12-16-75ef1b1a96ce

/r/djangolearning
https://redd.it/1d18fb8
SH1106 OLED Screen App Framework for Raspberry Pi - Now on PyPI

What it does:
Today, I released the first working version of my SH1106 app framework for Raspberry Pi on PyPI! The SH1106 is an affordable OLED screen, costing under $3, and it's perfect for projects of all sizes. This package enables the creation of apps for it with graphics support, state management, image conversion utilities, and custom fonts. Check it out here: SH1106 Framework on PyPI.

Target audience:
The package is mainly aimed at hobbyists who want to create small projects using the SH1106 OLED without having to manually write a lot of the graphics code typically needed on top of standard packages. I am also developing a hardware synthesizer keyboard from scratch that utilizes this framework extensively. So far, the framework handles the massive scaling required for this project excellently in terms of both code organization and performance.

Comparison:
This package offers several advantages over other SH1106 packages:

1. Improved Rendering Speed: It significantly speeds up the rendering time for a given frame by writing all graphical operations to a pixel array, which is then loaded onto the screen using low-level functions from the excellent luma.oled package.
2. Efficient Resource Management: All images and fonts are pre-loaded during the initialization

/r/Python
https://redd.it/1d1fdqb
Nutritious: A JSX preprocessor for Python enables the coder to write JSX directly in Python 🗿

Its intuitive CLI is a Python package designed to revolutionize web development by offering JSX-like syntax within Python for creating HTML elements and components. Its intuitive CLI simplifies the process of converting XML-JSX to Python objects, making it effortless to build dynamic web applications.

What My Project Does: Nutritious Litchi allows developers to leverage JSX-like syntax directly in Python, enabling them to seamlessly create HTML elements and components. The package includes a command-line interface (CLI) that facilitates the conversion of XML-JSX to Python objects, streamlining the development process for web applications.

Target Audience: This project is primarily targeted towards developers interested in web development using Python. While it is currently experimental, with plans for production readiness after version 1.5, it offers a promising solution for both hobbyists and professionals looking to build web applications with Python.

Comparison: Nutritious Litchi stands out from existing alternatives by providing a unique solution to Python web development challenges. Unlike other alternatives, such as Packed, which may suffer from compatibility issues and errors, Nutritious Litchi offers a smoother experience for developers seeking to integrate React-like syntax into their backend projects.

[PROJECT HOMEPAGE\]

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