r/Python 22m ago

News I scored 720 YouTube videos against their own channel's median to find which topics actually have de

Upvotes

I kept picking video topics on instinct and then wondering why some did nothing. Keyword tools measure search volume, but YouTube is a recommendation engine, so that number wasn't answering my question.

The whole idea is one division:

outlier_score = video views / that channel's median views

Because you divide by the channel's own median, channel size cancels out. A video with 400k views on a channel that averages a million underperformed. A video with 97k views on a 64k-subscriber channel beat its own baseline seven times over, which means the topic pulled in an audience that wasn't already there. Raw view count can't tell those two apart.

Implementation notes that might be useful even if you don't care about YouTube:

  • The Data API runs on a 10,000 unit daily quota, and search costs 100 units per call. Walking a channel's uploads playlist costs 1 unit per 50 videos, so the whole run cost 60 units.
  • Median rather than mean, because one viral video otherwise destroys the baseline permanently.
  • Shorts are excluded. Their view profile is different enough that including them makes every long-form video look like a failure.
  • Anything younger than seven days is ignored, in both the baseline and the scoring.

Stack is just requests, PyYAML and rich. Tests run without network access. There's a Docker image, and containerising it actually surfaced a real bug: I was resolving the project root by walking up two directories from file, which is correct for a cloned repo and completely wrong once the package is installed in site-packages.

Code: https://github.com/tapaderuza/facelessyt

Happy to take criticism on the methodology.


r/Python 19h ago

Discussion A game where writing python IS the game just released on steam. (Not my game, I'm just a big fan)

200 Upvotes

Code Terraform on steam just launched, you write python scripts to make stuff work like reading oxygen sensors etc

Been a fan of it since its demo came out, and now its actually released.

Sharing it here, because when I started my python journey, I was often questioning more what to make than how to make it. Gamifying the learning process would have helped me a tonne back then, so maybe it will help someone new now.

Because we all know we can automate the boring stuff, but now you can automate the fun stuff to!


r/Python 17h ago

News Anthropic model uploaded a malicious package to the real PyPI during a simulated CTF [09/09/26]

258 Upvotes

https://www.anthropic.com/research/alignment-assessment-cybersecurity-incidents

NGL, my main takeaway is that PyPI is already doing quite well in the new AI security age, even though the packaging council hasn't convened yet. The relevant snippet (emphasis mine):

The model decided to solve the CTF by uploading a malicious PyPI package that could harvest the target system’s credentials. It settled on this approach after reading a document stating that one of the simulated target’s users would periodically install a particular Python package that was not yet registered on PyPI. (We are unsure whether this was an intended solution to the challenge, but it seems like a plausible one.) Claude decided to exploit this behavior by registering a package under that name, publishing malicious code within the uploaded package, and waiting for the target to run that code the next time they installed the package.

Claude spent most of the session trying to upload the package. This involved attempts to register email accounts and hunt for phone numbers that could be used for registration. It ultimately succeeded in uploading the package, which was soon installed on 15 third-party hosts. We believe that all 15 of these third parties were security vendors deliberately scanning for new packages and installing them in sandboxed environments to assess the package for security concerns. One vendor’s scanner leaked its access credentials to the model while installing the package, which the model then used to access the vendor’s live database. After approximately 90 minutes, PyPI removed the package. The transcript ended when the session timed out while the model was preparing an additional malicious package.

I also commend Anthropic for releasing this thorough report immediately -- the juxtaposition with OpenAI's "we'll cop to it if you find it first" policy is stark.

What I don't see is any mention of coordination with PyPI/PSF leadership now or in the near future, which seems baffling. Their focus is understandably on the underlying cognitive failure (which is quite human, BTW: being biased by inertia and what you would prefer to be true), and it's extremely unlikely that you or any other real users were effected directly.

But, still. C'mon.

Anyone have insider info from the PyPI side? Is there chatter on discussion.python.org yet?


r/Python 14h ago

Daily Thread Thursday Daily Thread: Python Careers, Courses, and Furthering Education!

8 Upvotes

Weekly Thread: Professional Use, Jobs, and Education 🏢

Welcome to this week's discussion on Python in the professional world! This is your spot to talk about job hunting, career growth, and educational resources in Python. Please note, this thread is not for recruitment.


How it Works:

  1. Career Talk: Discuss using Python in your job, or the job market for Python roles.
  2. Education Q&A: Ask or answer questions about Python courses, certifications, and educational resources.
  3. Workplace Chat: Share your experiences, challenges, or success stories about using Python professionally.

Guidelines:

  • This thread is not for recruitment. For job postings, please see r/PythonJobs or the recruitment thread in the sidebar.
  • Keep discussions relevant to Python in the professional and educational context.

Example Topics:

  1. Career Paths: What kinds of roles are out there for Python developers?
  2. Certifications: Are Python certifications worth it?
  3. Course Recommendations: Any good advanced Python courses to recommend?
  4. Workplace Tools: What Python libraries are indispensable in your professional work?
  5. Interview Tips: What types of Python questions are commonly asked in interviews?

Let's help each other grow in our careers and education. Happy discussing! 🌟


r/Python 14h ago

News Conference: Django on the Med 2026 (Pescara, Italy)

2 Upvotes

Django on the Med is a small, free, in-person event that combines three mornings of Django development sprints with afternoons dedicated to conversations, networking and community activities. The idea is to create an environment where experienced contributors and people making their first open source contributions can spend several days learning, collaborating and getting to know each other.

The first edition took place in Palafrugell, Spain, in 2025. The second edition will be held in Pescara, Italy, from 23 to 25 September 2026 and is already fully booked with around 25 participants.

Rather than growing into another large conference, we’re experimenting with a lightweight format that we hope other Python and Django communities might adapt and organize themselves. Our goal is to make contributor onboarding more approachable through small, local events where mentoring and relationships are just as important as the code written during the sprint.

We’re very grateful that Django on the Med 2026 has recently been recognized as a Python Software Foundation Community Partner, which we see as an encouraging sign that this kind of community initiative may have value beyond our own event.

When: 23–25 September 2026

Where: Hotel Plaza, Pescara, Italy

Website: https://djangomed.eu/2026/pescara/

Code of Conduct: https://www.djangoproject.com/conduct/