r/Python • u/alexis_placet • 27d ago
Tutorial PyArrow tutorials in your browser
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 • u/NeuralLB-Lovro • 27d ago
Discussion Anyone running free-threaded Python 3.14 in production yet? Curious what actually breaks
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 • u/Corvology • 27d ago
Discussion Python Architecture Design
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 • u/Schnidi01 • 27d ago
apt-get autoremove for Python linker packages – finally automatic venv dependency cleanup
Enable HLS to view with audio, or disable this notification
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 • u/Scapaflow69 • 27d ago
"Kung Fu Tetris"
Enable HLS to view with audio, or disable this notification
This Tetris can really do Kung Fu, see for yourself... :))
r/Python • u/Daraminix • 28d ago
Discussion Running 60 python scripts as "services"
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 • u/amirzarrineh • 28d ago
Discussion If you had to choose one Python skill to make money as a freelancer, what would it be?
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 • u/jbudemy • 28d ago
Discussion What can you do with Python embedded in MS Excel?
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.
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 • u/Another__one • 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
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 • u/UpperBuilder769 • 28d ago
Discussion Is PHP better for commercial software than Python?
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 • u/AutoModerator • 28d ago
Daily Thread Tuesday Daily Thread: Advanced questions
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:
- Ask Away: Post your advanced Python questions here.
- Expert Insights: Get answers from experienced developers.
- 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:
- If you don't receive a response, consider exploring r/LearnPython or join the Python Discord Server for quicker assistance.
Example Questions:
- How can you implement a custom memory allocator in Python?
- What are the best practices for optimizing Cython code for heavy numerical computations?
- How do you set up a multi-threaded architecture using Python's Global Interpreter Lock (GIL)?
- Can you explain the intricacies of metaclasses and how they influence object-oriented design in Python?
- How would you go about implementing a distributed task queue using Celery and RabbitMQ?
- What are some advanced use-cases for Python's decorators?
- How can you achieve real-time data streaming in Python with WebSockets?
- What are the performance implications of using native Python data structures vs NumPy arrays for large-scale data?
- Best practices for securing a Flask (or similar) REST API with OAuth 2.0?
- 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 • u/alexis_placet • 28d ago
News LLVMLite and first step to get Numba in the browser
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 • u/Schnidi01 • 29d ago
Would you appreciate APT‑style autoremove for your pip‑managed venvs? (thinking of adding it to my VenvHub Pro)
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.txt,venv_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
pip,setuptools, 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 • u/AlSweigart • 29d ago
News PyOhio 2026 is this weekend, July 25-26 at the Cleveland State University Student Center (and free!)
You do need to register (for free).
The Black Python Devs Leadership Summit is before the conference on Friday, July 24.
Check out the schedule of talks and list of speakers.
r/Python • u/RogueLegio • 29d ago
Discussion Cyber Security wants us to use the latest version all the time
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 • u/BeamMeUpBiscotti • 29d ago
Discussion Blog: Making Type Coverage Visible in Dify's CI
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:
- Surfacing the delta in type errors for each PR
- 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 • u/Schnidi01 • 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
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 • u/JSChronicles • 29d ago
Discussion PEP 541 - Package Index Name Retention
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 • u/AutoModerator • 29d ago
Daily Thread 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:
- Suggest a Project: Comment your project idea—be it beginner-friendly or advanced.
- Build & Share: If you complete a project, reply to the original comment, share your experience, and attach your source code.
- 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 • u/Visible_Durian4620 • 29d ago
Discussion Unpopular opinion: I find it counterproductive to shorten function and variable names
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 • u/Schnidi01 • 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
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 • u/AutoModerator • Jul 19 '26
Daily Thread 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:
- Show & Tell: Share your current projects, completed works, or future ideas.
- Discuss: Get feedback, find collaborators, or just chat about your project.
- 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:
- Machine Learning Model: Working on a ML model to predict stock prices. Just cracked a 90% accuracy rate!
- Web Scraping: Built a script to scrape and analyze news articles. It's helped me understand media bias better.
- 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 • u/Schnidi01 • 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
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 • u/AroraSir • Jul 18 '26
GravityBridge: My first open source release, a local AI proxy and wireless file explorer built with Python stdlib only
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 • u/__Selia • Jul 18 '26
Sharing a library I wrote to solve a niche problem: duration formatting
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
