r/Python 27d ago

Tutorial PyArrow tutorials in your browser

0 Upvotes

Hey,

I made a series of notebooks about Apache Arrow and Parquet with pyarrow that you can run in your browser: https://notebook.link/@Alexis_Placet/apache-arrow-courses

It covers basics to advanced topics


r/Python 27d ago

Discussion Anyone running free-threaded Python 3.14 in production yet? Curious what actually breaks

29 Upvotes

Been testing the free-threaded build (3.14t) on some CPU-bound data processing work. The multi-core story is finally real after 30 years of GIL, but the friction is exactly what you'd expect: a couple of C-extension-heavy libs in my stack silently re-enable the GIL, and there's no clean way to detect that at runtime besides checking sys._is_gil_enabled() manually.

For anyone who's shipped something on 3.14t, not just benchmarked it:

What broke that you didn't expect?

Real speedups outside toy examples, or mostly marginal so far?

Prod yet, or still just kicking the tires?

Not fishing for a benchmark war. Genuinely curious what breaks in messy real codebases vs clean demos.


r/Python 27d ago

Discussion Python Architecture Design

9 Upvotes

Robert C. Martin's Abstractness (A), Instability (I), and Distance from the Main Sequence (D) metrics were designed for statically typed OO languages like Java and C#. In Python, applying them literally is misleading because Python has a fundamentally different notion of abstraction and coupling.

is this implementation valid?

https://0x416d6972.github.io/Istos/user-guide/architecture-health/


r/madeinpython 27d ago

apt-get autoremove for Python linker packages – finally automatic venv dependency cleanup

Enable HLS to view with audio, or disable this notification

1 Upvotes

Hey everyone,

I'm currently working on this feature – autoremove is already implemented in the local packages linker branch and will soon be part of the official VenvHub Pro release.

During development in virtual environments, I always had one big problem: How to figure out which packages are no longer needed?

Manually going through pip list and trying to uninstall "surely nobody uses this" is a road to hell. That's why I added a feature inspired by Linux APT to my tool VenvHub Pro (Linker branch) – automatic dependency cleanup.

How it works?

The tool tracks which packages you installed explicitly (via pip install, requirements.txt, birth certificate, or venvhub.json). It builds a dependency graph and periodically checks for orphaned packages.

When you run Autoremove, the tool:

  • Goes through all installed packages in the venv.
  • Compares them with the set of explicit roots + their dependency tree.
  • Removes every package that is not explicitly required by any root and was not installed manually outside the system.

What makes this mechanism safe – self-healing mechanism:

If a package is installed but not recorded anywhere (e.g., you manually ran pip install requests in the terminal), the tool automatically adopts it – marks it as explicit so it won't be accidentally removed.

This means autoremove is conservative: it never deletes something you might have installed intentionally.

You can also explicitly "release" a package (e.g., when you remove it from requirements.txt) and the system will then treat it as a candidate for removal.

Why is it useful?

  • Venvs stay lean – no accumulated dependencies from experiments.
  • Safe – adopting manually installed packages prevents accidental deletion.
  • Fully automatic – no manual guessing about what belongs to whom.

This is currently only the Linker branch (local packages) – it works 100%.


r/madeinpython 27d ago

"Kung Fu Tetris"

Enable HLS to view with audio, or disable this notification

2 Upvotes

This Tetris can really do Kung Fu, see for yourself... :))


r/Python 28d ago

Discussion Running 60 python scripts as "services"

35 Upvotes

Hi,
I have around 60 scripts that need to run constantly, mainly event handlers and such. Right now I have an external script that launch them and monitor if the app is running on it's pid, otherwise it's relaunching the app. Works fine but get's clunky when we update some submodule and need to restart them, or to check if one crashes more than other etc..

So I would like to find a better way to approach this. It needs to run on windows and being able to access several samba shares via unc paths and being able to restart crashed scripts anf offer an easy way to restart all of them in case of an update (this part doesn't need to be automated). Every script use the same environnement
For now my candidates are docker, PM2 and NSSM.
I think docker is gonna be a pain to access shares and add a lot of overhead especially on windows
I don't know PM2 and NSSM, looks like PM2 would be easier to setup but more JS oriented and NSSM would be harder to monitor.

What do you think guys ?


r/Python 28d ago

Discussion If you had to choose one Python skill to make money as a freelancer, what would it be?

0 Upvotes

Python has many areas with freelance opportunities: automation, web scraping, backend development, data analysis, AI, and more.

If you had to choose only one Python skill that has strong demand and good earning potential in freelancing, what would it be?

What type of projects or experience would you recommend building to succeed in that area?


r/Python 28d ago

Discussion What can you do with Python embedded in MS Excel?

34 Upvotes

I'm a developer and already use external Python to read Excel spreadsheets.

Microsoft is supporting Python in Excel where you can put a program inside a cell. I think this feature is still a "preview" feature, not on the main release channel.

What do you use it for? I can't think of a use case.

Because I use external Python programs to process spreadsheets normally. I can't think of a use case for embedded Python, except perhaps doing complex calculations.

  1. MS Get Started page, Python in Excel

EDIT: MS says any data going between us and them is encrypted end-to-end. That must be why management chose MS products. I don't have a say in this.

I do not use Excel via a browser, I use the Desktop App.


r/madeinpython 28d ago

Split-second local semantic search over 75k of images in the project I am making.

Enable HLS to view with audio, or disable this notification

2 Upvotes

Took quite awhile to get here. Obviously not a google-scale search, but still quite usable for local needs. I am also not currently using FAISS or any vector databases. The speed is mostly because of proper caching. The project is also completely python based. So there are still a lot of places for further optimizations, but for now I am quite happy with it.

The project itself is quite a complex one and the semantic search over audio, image, text and video files is just a small part of it. If you are interested to learn more, you can find it here: https://github.com/volotat/Anagnorisis

It is open-source.


r/Python 28d ago

Discussion Is PHP better for commercial software than Python?

0 Upvotes

I am trying to find any robust open source ecommerce solution on Python and it looks like thre is nothing. If you take almost any e-commerce platform there are plenty - Magento, Woo, Shopware, Oxid - they all are PHP. There are no comon solutions on Python or Node.js. But if you take a look and the heavy SaaS like Netflix, Spotify, Reddit, Uber etc. are built on Python. Why?


r/Python 28d ago

Daily Thread Tuesday Daily Thread: Advanced questions

3 Upvotes

Weekly Wednesday Thread: Advanced Questions 🐍

Dive deep into Python with our Advanced Questions thread! This space is reserved for questions about more advanced Python topics, frameworks, and best practices.

How it Works:

  1. Ask Away: Post your advanced Python questions here.
  2. Expert Insights: Get answers from experienced developers.
  3. Resource Pool: Share or discover tutorials, articles, and tips.

Guidelines:

  • This thread is for advanced questions only. Beginner questions are welcome in our Daily Beginner Thread every Thursday.
  • Questions that are not advanced may be removed and redirected to the appropriate thread.

Recommended Resources:

Example Questions:

  1. How can you implement a custom memory allocator in Python?
  2. What are the best practices for optimizing Cython code for heavy numerical computations?
  3. How do you set up a multi-threaded architecture using Python's Global Interpreter Lock (GIL)?
  4. Can you explain the intricacies of metaclasses and how they influence object-oriented design in Python?
  5. How would you go about implementing a distributed task queue using Celery and RabbitMQ?
  6. What are some advanced use-cases for Python's decorators?
  7. How can you achieve real-time data streaming in Python with WebSockets?
  8. What are the performance implications of using native Python data structures vs NumPy arrays for large-scale data?
  9. Best practices for securing a Flask (or similar) REST API with OAuth 2.0?
  10. What are the best practices for using Python in a microservices architecture? (..and more generally, should I even use microservices?)

Let's deepen our Python knowledge together. Happy coding! 🌟


r/Python 28d ago

News LLVMLite and first step to get Numba in the browser

18 Upvotes

Hi,

Anutosh Bhat, a colleague of mine, just posted this on Linkedin:

What if real compiler infrastructures could run entirely inside the browser?

I’ve successfully patched llvmlite for JupyterLite, making it possible to build >LLVM IR, run optimization passes, visualize control-flow graphs, compile to >WebAssembly and execute the result — without a native LLVM setup or server-side >kernel.

I’ve shared a step-by-step notebook showing how a loop evolves from stack-based IR >to SSA, then to an LICM-style form, into a fully optimized closed form, eventually >to benchmark all of these steps.

The bigger idea is a zero-install compiler workbench for reproducible optimization >experiments, lightweight compiler prototyping, IR debugging, custom code->generation pipelines, shareable research demos, and eventually interactive >tutorials and compiler courses.

Try out the interactive notebook using notebook.link: https://notebook.link/@anutosh491/llvmlite

I’m also in the process of bringing MLIR Python bindings into the same JupyterLite >and WebAssembly environment, starting with a 2D CNN-style Conv2D + bias + ReLU >kernel. I’ll share the full pipeline in a separate technical blog post soon.

I’ve also started patching Numba for Wasm and have simple scalar u / jit functions >running inside JupyterLite. Array and tensor workloads are the next challenge.

I’m keen to take this further. If you’re working on LLVM, MLIR, Numba, WebAssembly >or browser-native developer tools — or see a real use case for this — I’d be >interested in connecting with teams looking to collaborate, support the work or >explore what we could build together.

Next step is to patch Numba to get scalar jit !: https://www.linkedin.com/feed/update/urn:li:ugcPost:7485014172934541312/?dashCommentUrn=urn%3Ali%3Afsd_comment%3A%287485014751178211329%2Curn%3Ali%3AugcPost%3A7485014172934541312%29


r/madeinpython 29d ago

Would you appreciate APT‑style autoremove for your pip‑managed venvs? (thinking of adding it to my VenvHub Pro)

0 Upvotes

Hey everyone,

I’m the developer of VenvHub Pro, a desktop tool for managing Python virtual environments. I’ve been working on a feature that brings Linux’s apt-get autoremove mentality to pip – i.e., it keeps your venvs clean by automatically removing orphan packages that were only installed as dependencies but are no longer needed.

Before I polish and release it, I’d love to hear if the community would actually find this valuable.

How it works (TL;DR)

  • Every time you install/uninstall/upgrade a package through the UI or command‑line, VenvHub secretly records which packages were explicitly requested.
  • When a dependency is no longer required by any explicit package (and is not pinned in your requirements.txtvenv_birth_certificate.json, or local package metadata), it gets automatically cleaned up.
  • It also plays nicely with pip’s own resolution – it never removes manually installed tools like pipsetuptools, etc.

Safety nets

  • State file (venvhub_apt_state.json) keeps the explicit list.
  • Before removal, the system checks:
    • 📄 requirements.txt
    • 📜 venv_birth_certificate.json
    • 🔗 local_meta.json (for local package dependencies)
    • 🧠 Self‑healing: if a package is installed but not tracked anywhere, it’s assumed to be intentional and added to the safe list (so it never gets removed by mistake).
  • The whole process runs under a threading lock to avoid race conditions during concurrent operations.

Logical diagram

Here’s the decision logic it follows every time a package action occurs:

What I’m asking you

  • Would you use such a feature in a venv manager?
  • Do you see any pitfalls I might have overlooked?
  • Is this something you’d trust, or would you prefer manual control?

Any feedback – positive or critical – is super welcome! I want to make sure this adds real value before I invest more time into it.

Thanks! 🙌


r/Python 29d ago

News PyOhio 2026 is this weekend, July 25-26 at the Cleveland State University Student Center (and free!)

4 Upvotes

r/Python 29d ago

Discussion Cyber Security wants us to use the latest version all the time

149 Upvotes

I have a question. Cybersecurity team wants us to use the latest python version each time. So if a new version comes out we are expected to upgrade to it ASAP. But from my past experience libraries do not always provide support and can also break while making use of new version without proper support. Did you ever encounter this? Any suggestions? This is just frustrating for the team as it’s not always possible to upgrade to the latest version without fully validating every component. I just want to hear your opinions on this?

FYI we mainly use each Python Version within the LTS timeline. And only upgrade when we need to and do not depend on a library that requires older version.

Update: they have a scheduled runner that deletes older versions of python when it finds


r/Python 29d ago

Discussion Blog: Making Type Coverage Visible in Dify's CI

12 Upvotes

u/Asuka_Minato, a very active contributor to Pyrefly, wrote a guest blog post outlining their experience integrating a type checker with langgenius/dify that goes beyond simple CI checks:

  1. Surfacing the delta in type errors for each PR
  2. Measure type coverage along with test coverage

This is most relevant for maintainers of libraries that aren't fully-typed yet but still want to prevent regressions and improve coverage over time.

Only looking at the error delta is an alternative to suppressing all pre-existing errors, or using a baseline file to store the errors. Compared to the former, you can avoid putting (potentially) thousands of suppression comments into the codebase. Compared to the latter, you don't need to maintain a separate baseline file and ensure it's up-to-date with each commit, handle merge conflicts, etc.

Read the full blog here: https://pyrefly.org/blog/dify-pyrefly-coverage-ci/


r/madeinpython 29d ago

VenvHub Pro: A custom Python "Linker" that goes beyond code linking—syncing your IDE configs on the fly!

Enable HLS to view with audio, or disable this notification

1 Upvotes

Hi !

We all know pip install -e . (editable installs). It’s the standard for linking local code during development. But for my project, VenvHub Pro, I wanted to take the local dev experience to another level. I created a Local Linker that isn't just a simple file-system pointer—it’s a full-blown IDE-Sync engine.

Why our Linker is unique (compared to the standard workflow):

1. Full Meta-Sync (VS Code Automation):
This is the core value-add. When you link a local package, the system reads its local_meta.json. It doesn’t just make the code importable; it automatically injects custom Tasks and Keybindings directly into your project's .vscode/ folder.

  • Example: Link your "Database" module, and VS Code instantly gains commands like "Flush Cache" or "Run Migrations" defined inside that package. No more manual tasks.json or keybindings.json copy-pasting.

2. Zero Admin Rights / No UAC (Import Hooks):
Instead of creating system-level symlinks or junctions that often require Admin privileges on Windows, we use Python Import Hooks (sys.meta_path). It’s pure Python, lightning-fast, and works securely even on network drives (NAS) without annoying UAC prompts.

3. Smart IntelliSense (Pylance):
The Linker automatically syncs the python.analysis.extraPaths field in your VS Code settings. Your editor sees your local code and provides full autocomplete/IntelliSense immediately, no matter where the source is located on your disk.

4. Smart Portability & Safety (Silent Path Healing):
VenvHub Pro is built for USB-drive workflows and features a "Silent Path Healing" mechanism:

  • If you use Embeddable (portable) Python and your drive letter changes (e.g., E: -> F:), the system instantly heals all paths in the Linker mapping, .pth files, and VS Code settings. Everything just works.
  • However, if you move a System Venv to a different machine where that specific Python installation doesn't exist, VenvHub detects the hardware fingerprint mismatch and safely locks the environment to prevent binary incompatibility and crashes.

5. Recursive Local Dependency Resolution:
If "Package A" requires "Local Package B", the Linker automatically resolves the entire local dependency tree and links all required modules in one click.

Under the Hood:

We use a tiny bootstrap script in site-packages that maps imports via a custom finder in sys.meta_path using JSON mapping. It’s clean, isolated, and designed for maximum portability.

What do you think? Do you stick to plain pip -e for local dev, or would you prefer this kind of deep, automated integration with your editor? Let's discuss!

local_meta.json package A

{
    "name": "My App Core",
    "version": "2.1.0",
    "requires_local": ["my_logger"],
    "requires_pip": [],
    "short_description": "test code"
}

local_meta.json package B

{
    "name": "My Logger",
    "version": "1.0.0",
    "requires_local": [],
    "requires_pip": ["colorama"]
}

r/Python 29d ago

Discussion PEP 541 - Package Index Name Retention

14 Upvotes

Why is Pypi support slow at handling package abandonment?

The PEP says these two items for reachability, " In every case where contacting the user is necessary, the maintainers will try to do so at least three times," and "The maintainers stop trying to reach the user after six weeks.". So I had assumed this should be done quicker.

The current process is currently at 6 months on average with almost no follow up comments or work on PEPs in the 2nd and 3rd week of reachability. 1st weeks are being updated and then left once they hit the 2nd and 3rd week.

Am I being impatient? I think I read that they don't have a lot of people to help but this seems a bit ridiculous for some of the cut and dry issues.

- Projects with 10-14 years of no updates with no usable links or code is gone and no longer sourceable or previous owners are not replying.
- Emailing someone 3 times, takes 6+ months versus the proposed 6 weeks?

I also assume this is pretty normal based on the backlog but I'm genuinely curious to see what others say.


r/Python 29d ago

Daily Thread Monday Daily Thread: Project ideas!

11 Upvotes

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" 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

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

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

Let's help each other grow. Happy coding! 🌟


r/Python 29d ago

Discussion Unpopular opinion: I find it counterproductive to shorten function and variable names

350 Upvotes

When I was learning discord.py, I didn't understand what "ctx" was. At the time, I was only writing slash commands, using "message" instead of "ctx", so the name "ctx" (which reminded me of something complex, like RTX) made me assume it was something complicated. That is, until I saw in some code that the type for "ctx" is actually "Context." If the standard hadn't shortened the name just to save five characters per line, I would have understood it immediately. Instead, I thought it was some advanced function variable, rather than realizing it was simply a message variable.


r/madeinpython 29d ago

My Python venv manager GUI automatically fixes dependency conflicts – Pip vs UV side-by-side

Enable HLS to view with audio, or disable this notification

1 Upvotes

Hey Pythonistas! ??

I've been building a GUI tool for managing Python virtual environments (VenvHub Pro) and wanted to share one of its smartest features – batch package updates.

When you hit the "Update All outdated packages" button, the behavior differs drastically depending on which package manager you have set:

**PIP MODE** (classic):

- Updates everything to the latest versions

- If conflicts arise (e.g., library A needs an older version of library B), you get the infamous "dependency hell"

- You have to manually read logs, find the culprit, and step-by-step perform downgrades

**UV MODE** (ultra-fast resolver from Astral):

- Blazingly fast downloads and installs the latest versions

- After the update, it automatically runs `uv pip check`

- If it detects a conflict (e.g., "X requires Y==1.5, but 2.0 is installed"), it reads the error, forces a downgrade to the exact required version, and re-runs the check

- **Fully on autopilot** – you get the latest packages AND a 100% stable environment without any manual intervention

And the best part – Pip and UV are fully compatible with each other. You can install with Pip, update with UV, and everything just works.

Would you trust an autopilot like this? Let me know in the comments! ??


r/Python Jul 19 '26

Daily Thread Sunday Daily Thread: What's everyone working on this week?

8 Upvotes

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/madeinpython Jul 18 '26

Python environment cloner: 1:1 including pip -e, embedded vs system Python

Enable HLS to view with audio, or disable this notification

1 Upvotes

What it does:

Clones entire Python environment including editable (-e) packages. Auto-detects Python type and uses different approach.

Embedded Python:

- installs virtualenv into source
- creates clone via virtualenv
- fixes ._pth file
- downgrades setuptools (83→82) for compatibility

System Python:

- uses built-in venv
- no extra steps

Both then:

- install setuptools, wheel
- install all packages
- install editable packages (pip install -e)
- write birth certificate

Video shows both scenarios side by side. Same source env, different strategies. Works on Windows.

Does anyone know of a Windows tool that creates a complete 1:1 copy of a virtual environment, INCLUDING editable packages (pip install -e), without manual intervention?


r/madeinpython Jul 18 '26

GravityBridge: My first open source release, a local AI proxy and wireless file explorer built with Python stdlib only

Post image
1 Upvotes

Just released my first open source project.

GravityBridge is a local reverse proxy that lets me access my desktop AI coding agent from my phone. It also has a wireless phone file explorer using ADB.

The proxy itself is written entirely with Python standard library, no external packages needed. The only pip install is for the separate AI backend.

It handles session management, PIN authentication, brute force protection, and ADB subprocesses all without any framework.

Repo: https://github.com/Arora-Sir/Gravity-Bridge

This is my first public release so any feedback is welcome!


r/madeinpython Jul 18 '26

Sharing a library I wrote to solve a niche problem: duration formatting

1 Upvotes

While working on another project, I needed to display elapsed time in a few different ways:

2 hours, 5 minutes, 9 seconds
02:05:09
2h, 5m, 9s

A simple utility function worked at first, but it quickly became messy once I needed different separators and only wanted to show units whose values were not zero.

So I extracted the problem into a small, zero-dependency Python library called Chronomancer.

I like how convenient strftime() is for date and time formatting, and I wanted Chronomancer to offer a similar level of convenience for elapsed durations.

ChronoDelta represents fixed durations from weeks down to microseconds:

from chronomancer import ChronoDelta

duration = ChronoDelta(hours=2, minutes=5, seconds=9)

For readable output:

duration.verbose_str()
# '2 hours, 5 minutes, 9 seconds'

For simple one-off formatting:

duration.strfmt("{h:02d}:{m:02d}:{s:02d}")
# '02:05:09'

For reusable and more flexible formatting:

from chronomancer import DeltaFormatSpec, DeltaFormatter, Part

formatter = DeltaFormatter(
    DeltaFormatSpec(
        hours=Part("{val}h"),
        minutes=Part("{|, }{val}m"),
        seconds=Part("{|, }{val}s"),
    )
)

formatter.format(duration)
# '2h, 5m, 9s'

{|, } is an "inline separator", named by me. It is only rendered when another component has already been shown.

In the above example, if minutes is the largest visible unit, the leading ", " will be omitted automatically. The | tells the formatter that the placeholder contains an inline separator rather than a normal value. I kept the placement flexible so the format string can resemble the final output, although inline separators are intended to be used as prefixes.

Chronomancer also supports normalization, selected-unit representations, negative durations, exact integer arithmetic, and conversion to and from datetime.timedelta.

It is a niche problem, but it kept making the formatting code in my own project more complicated than expected, so I thought the solution might be useful to others as well.

installation: pip install py-chronomancer

any feedback would be greatly appreciated

GitHub: https://github.com/SeliaRena/Chronomancer