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
Scope Boundaries for Notebooks — Research Study on an extension I've been developing

Hi Everyone. My name is Eric Rawn. I’m a PhD student at UC Berkeley working with my advisor Professor Sarah Chasins. I research how to make notebook programming environments better, and have been working on an extension for notebooks which introduces scope boundaries to collections of cells. We think this might help programmers avoid some of the pain points with notebooks, but we won’t know until we study its use in the real world. The goal is to make it easier to keep variables tidy within a notebook without requiring programmers to change how they like to use notebooks. We’re interested in evaluating how our extension aids how real users program (you all!), and so we’re running a 4-6 week study with folks who use Jupyter notebooks regularly in their everyday programming.

The extension will log some usage data locally on your machine, which you'll send to me at the end of the study. We'll then spend about an hour chatting about your experience, the kind of work you do daily, how you use notebooks, and any other thoughts or feedback you have. Participants will be compensated for their time spent interviewing, at $30/hour. The consent form has detailed information about the

/r/JupyterNotebooks
https://redd.it/1dwbgqr
App 100% python with django. What python frontend can I use?

Hi,
I'm currently using flask + dash bootstrap components for my app.
I'm looking for a 100% python frontend (no react, vue etc).
Any suggestions?

/r/django
https://redd.it/1dwnf3p
Shed Skin restricted-Python-to-C++-compiler 0.9.9

I have just released version 0.9.9 of Shed Skin, a restricted-Python-to-C++ compiler. It comes with a whole host of small improvements, and also a nice new (constructive solid geometry) example, which becomes about 15 times faster on my system (not 15%.. 15 times!).

If you think this is a cool project, please consider helping out. There is always enough work (low-hanging fruit even) on both the Python and C++ side.

/r/Python
https://redd.it/1dwkz20
zealot: prevent N+1 queries in Django

hey everyone!

i just released zealot, a library for detecting N+1 queries in your Django project.

i've wanted something like this for a long time. there are some similar libraries out there, but none of them did everything i wanted, and the most popular would miss certain types of N+1.

zealot is pretty simply: install it, and it'll raise an exception (or log a warning) whenever it detects an N+1 query, with a helpful error message so you can fix it and be on your way.

all feedback is very welcome!

/r/django
https://redd.it/1dwvpjo
Tango with Django

I cant buy tango with Django 2023 version, but i got access to 2017 version of the book. Can i read and do django for this or is there any major difference to the both. (I am a initial learner of django)

/r/djangolearning
https://redd.it/1dvbjoa
I made a Python library to plot chemical trends | Plotium

# What does my Project do?

Plotium is a python library used to plot chemical trends like Atomic radii, Electronegativity, etc of specific parts of the periodic table, like types of elements, group or a specific block.

Right now, Plotium can plot trends of:

1. Electronegativity

2. Density

3. Atomic Radii

4. Melting Point

5. Boiling Point



Divided into:

1. Block Wise (S,P,D,F)

2. Types (Actinoids, Lanthanoids, etc)

3. Groups (1 - 18)

# Target Audience

Students/people who love chemistry. This library will also be useful for teaching students several exceptions and trends.

# Comparison

I haven't seen any trend plotter other than one hotmap plotter. But what I'm aiming is graphing these trends.

# GitHub

GitHub Link: https://github.com/rohankishore/Plotium

/r/Python
https://redd.it/1dwy0bg
Do not know how to speedup your code? Just distribute!

Hi all!

I have created just-distribute package aimed mainly at those at the beginning of their Python journey, but it may be handy also for advanced users.

pip install just-distribute

https://github.com/jakubgajski/just\_distribute

It is basically wrapping up popular libraries / approaches to speeding up code into one handy decorator \\@distribute.

I would appreciate any suggestions and feedback! Hope it will help someone :)

/r/Python
https://redd.it/1dwzx4j
Ultimate SQL Learning Resource: Case Studies, Projects, and Platform Solutions in One Place!

Hi everyone !!

Check out Faizan's SQL Portfolio on GitHub! 🚀

This comprehensive resource includes:

Case Studies: Real-world scenarios from Danny Ma's 8 Week SQL Challenge.
Platform Solutions: SQL problems & solutions from 7 different platforms including DataLemur, Leetcode, Hackerrank, Stratascratch and more.
Projects: Detailed SQL projects with data analysis techniques.
Resources: List of compiled SQL resources from different channels like YT, Books, Tutorials etc.

and much more!!

Perfect for students and professionals to enhance their SQL skills through practical applications. Explore, learn, and improve your SQL expertise!

🔗 https://github.com/faizanxmulla/sql-portfolio

Thank you so much for considering! If you would like to connect, feel free to reach out to me on LinkedIn.

Happy learning! 

/r/flask
https://redd.it/1dwq55m
Flask authentication and clean architecture

I am a beginner with flask. I am receiving auth token from a flutter firebase setup using google sso login. How to get the data encrypted using secret key in flask app. I am actually looking for good coding practices (clean architecture) developer uses generally on flask apps.

/r/flask
https://redd.it/1dx3v9j
Does anyone know of an extension that will auto create a client class for all my endpoints?

Say I’m using DRF with a bunch of model viewsets. I have a swagger gen extension but is there one that will collect all those same endpoints and create a Python class or file containing all of them? Like using requests or urllib or something like that and have all the endpoints auto implemented for you? I’m sure it’s possible (and opinionated) just haven’t come across anything I’m aware of or could find on google.

/r/django
https://redd.it/1dx33uk
Django cache does not support hash(redis)

I am studying django and i just learned that django's build in cache framework DOES NOT support redis's hash.

Is it strange? for such a mature framework but its built in cache does not support in-memory database's hash? i asked chatgpt and they confirmed it.

I manually created my own function that uses the built in cache.set and put a json.dumps(dict) in it and in my redis GUI it still shows up under the string. I am worried that my own custom function may not be as efficient as the redis's hash since its really considered as a string. Is it advisable to put a dict as string or should i just opt out of the django cache and use a third party library to handle redis?

/r/django
https://redd.it/1dwthj6
Migration issue after Wagtail Update

I have updated Wagtail from 5.2.2 to 6.1.2 and it's telling me that I need to run migrate. When I do I get the below error.

django.db.utils.OperationalError: (3821, "Check constraint 'permission_or_permission_type_not_null' is not found in the table.")

I have no idea how to fix this.

I updated Wagtail with pip install -upgrade wagtail

/r/django
https://redd.it/1dx9fia
Experienced django dev looking for opportunities

Hello everyone,
As mentioned in the title, I’m a software developer with good experience in Django, used it professionally for 3 year and also used it before that during my college for some projects. I’ve also answered queries on this community whenever I could. Now I’m looking for new opportunities, I’ve used Django with react and have good understanding of both, I do not want to limit myself to a specific stack because I’m also eager to learn new technologies. That said if any of you are looking to hire someone with this skill set and experience then please reach out

/r/django
https://redd.it/1dwst1j
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/1dx3ae2
My jupyter notebook doesn't have the "In" (function?)?

I have a 64-bit PC with Windows 10. I installed the latest Anaconda download. And when I try running Jupyter notebook, I don't have the "In" function to the left of the cell that allows me to execute code

https://preview.redd.it/b6qcqhu2b1bd1.png?width=1254&format=png&auto=webp&s=29369cd401edcf9a672cc3ecdbfa2b6eb605f686

Took this screenshot from a video

https://preview.redd.it/kaglsch5b1bd1.png?width=1025&format=png&auto=webp&s=2baf582197f3858795fcda5e28d822bc2172ff3a

I tried asking ChatGPT why my Jupyter notebook doesn't have the "In" function, but none of its suggestions are fixing the problem





/r/IPython
https://redd.it/1dx9c6w
D Self-Promotion Thread

Please post your personal projects, startups, product placements, collaboration needs, blogs etc.

Please mention the payment and pricing requirements for products and services.

Please do not post link shorteners, link aggregator websites , or auto-subscribe links.

--

Any abuse of trust will lead to bans.

Encourage others who create new posts for questions to post here instead!

Thread will stay alive until next one so keep posting after the date in the title.

--

Meta: This is an experiment. If the community doesnt like this, we will cancel it. This is to encourage those in the community to promote their work by not spamming the main threads.

/r/MachineLearning
https://redd.it/1dx5tpo
Flask, Django, or FastAPI?

From your experiences as a developer, which of these 3 frameworks would you guys recommend learning for the backend? What are some of the pro and con of each framework that you've notice? If you were to start over again, which framework will you choose to learn first?

/r/Python
https://redd.it/1dxcdiy
How to deploy selenium based flask app to VPS with gunicorn and nginx

Hi, I have a basic web scraping price comparison app. I wanted to deploy it on the oracle free tier for cloud hosting. I’m quite new to this so I have a few questions.

How can I set up multiple workers to service multiple requests simultaneously? What would I need for that?

What is the procedure for deploying this app to oracle cloud? I do have a domain but I don’t know how to make that work.

I’ve gone through way too many YouTube videos and it’s all quite confusing. I’d really appreciate any help or video links.

/r/flask
https://redd.it/1dxf932
Just finished my first week learning Python!!

Hey guys! My name is Christian (22M). Ever since my sophomore year in high school, when I began to learn more and more about computers by taking a simple html class for my cs credit, I have wanted to do more in this field. However, between bouncing around from many different ideas of what I wanted to do for the rest of my life, I ended up landing myself graduating from college with an associate in applied science for Engineering Systems Technology.

Since I turned 18, I have continuously worked in a field with utility scale electrical equipment, focusing on the software/programming side for the components that control the flow/state of that energy. I.E. PLC, STM32, JTAG, DSP, Custom Mod-bus. I have a decent amount of experience in several different applications but could never say that I truly KNEW what to do beyond basic debugging and integration.

I have recently started the 100 Days of Code challenge course on Udemy which was one of the highest rated courses for learning Python. I seem to be picking it up pretty quick but and truly starting to wonder if even after completing this course will I actually be able to land a

/r/Python
https://redd.it/1dxkr3f
How much data validation is healthy?

How much manual validation do you think is healthy in Python code?

I almost never do validation. I mean, when reading data from files or via an API, or from anywhere that I don’t control with my code, I would generally do validation via Pydantic or Pandera, depending on the type of data. But in all other cases, I usually supply type hints and I write functions in complete trust that the things that actually get passed live up to what they claim to be, especially because my point of view is that MyPy or Pyright should be part of a modern CI pipeline (and even if not, people get IDE support when writing calls). Sometimes you have to use # type: ignore, but then the onus is on the callers’ side to know what they’re doing. I would make some exception perhaps for certain libraries like pandas that have poor type support, in those cases it probably makes sense to be a little more defensive.

But I’ve seen code from colleagues that basically validates everything, so every function starts with checks for None or isinstance, and ValueErrors with nice messages are raised if conditions are violated. I really don’t like this

/r/Python
https://redd.it/1dxmp46
Django book recommendations

Hello, I'm a new developer. Currently really proficient with the flutter framework and I have a rather solid understanding of OOP. I love to read on frameworks and coding I'm general as I am able to get the knowledge in more depth than I would in a video or tutorial.

Do any of you know an excellent Django book for me to get to know the framework.

P.S I prefer human recommendations than Google search results when it comes to book recommendations. Because with good seo and marketing even a not so good book can be a first result.

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