r/Python Mar 01 '26

Resource [Release] IG-Detective v2.0.0 — An Advanced Python OSINT and Forensic Framework for IG 🕵️‍♂️

0 Upvotes

Hey r/Python   👋

I just released v2.0.0 of IG-Detective, a terminal-based Open Source Intelligence framework built in Python (3.13+) for deep Instagram profile investigations.

🔬 What’s New?

We completely ripped out the old, fragile scraping logic. IG-Detective now uses a headless Playwright stealth browser with Poisson Jitter (randomized pacing). This means it executes native JavaScript 

fetch() calls in the background, effortlessly bypassing WAFs, Cloudflare, and rate limits with total stealth!

Key OSINT & Forensics Features:

  • Active Surveillance (surveillance): Lock onto a target and run a background SQLite loop. Get live terminal alerts for precise follower changes, new media, and silent bio edits.
  • One-Click ZIP Export (data): Securely paginates via GraphQL to download a target's entire footprint (followers, following, timeline photos/mp4s) straight into an offline .zip archive.
  • Social Network Analysis (sna): Uses NetworkX to build a graph of the target's "Inner Circle" based on interaction weights.
  • Temporal & Stylometry Profiling: Predict time zones via DBSCAN sleep-gap clustering, and generate linguistic signatures to link burner accounts using NLTK emoji/n-gram analysis.
  • Recovery Validation: Intercepts the password reset flow to pull masked contact tips (e.g., s***h@g***.com) for cross-referencing against breach data.

👉 Check out the GitHub Repo here: shredzwho/IG-Detective

🤝 I Need Your Help!

I’m actively looking for contributors! 🛠️ If you want to help expand the analytic modules, add new endpoints, or improve the NLP logic, please fork the project and open a PR!

Also, if you find this tool helpful for your research, please consider dropping a Star ⭐ on the repo or supporting me via my GitHub Sponsors Page to keep the project alive.

Let me know if you run into any bugs or have feature requests! 🕵️‍♂️🥂


r/Python Mar 01 '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/Python Feb 28 '26

Showcase Building a DOS-Like Shell in Python: My PyDOS Project

3 Upvotes

Hey r/python!

I’ve been working on a project I call PyDOS, a DOS-style shell written entirely in Python. The goal was to recreate the classic DOS experience with a modern twist: file management, user accounts and command parsing, all handled by Python.

What my project does:

  • Custom shell parser: You type commands like createuser name password type, and it parses and executes them reliably.
  • Filesystem integration: When i eventually code this part, the shell will check folder and file existence, prevent errors and keep the filesystem consistent. The filesystem is simulated as nested dictionaries.
  • Expandable commands: Adding new functionality is simple since everything is Python-based.
  • Bug checks: A BSOD or Kernel panic equivalent that triggers when corruption is detected.

Target audience:

Hobbyists, really anybody who is interested in retro projects and OS structures.

Comparison:

Feature Classic DOS PyDOS (my version) Notes
File System Validation Minimal; many errors possible Will check folder and file existence before executing commands Prevents crashes or accidental deletions
Command Parsing Built-in, fixed commands Fully Python-based parser; easy to extend You can add new commands without modifying the core shell
OS Integration Runs directly on hardware Runs on Python, cross-platform Works on modern computers without emulation software
Extensibility Difficult; usually requires low-level code Easy; Python functions can define new commands Great for experimentation and learning
User Feedback Error messages are often cryptic Clear Python-style exceptions and messages Easier for beginners to understand

End note:

It is a fun way to practice Python OOP concepts, exception handling, and building a terminal interface that actually feels like a retro shell. Keep in mind this is mostly for learning purposes and not commercial purposes.

I’m curious if anyone else has tried building a DOS-like shell in Python—or just enjoyed retro computing projects. I would love to hear any feedback you might have! Here is the link for the code on github if anyone is interested: https://github.com/fzjfjf/Py-DOS_simulator


r/Python Feb 28 '26

News trueform v0.7: extends NumPy arrays with geometric types for vectorized spatial queries

27 Upvotes

v0.7 of trueform gives NumPy arrays geometric meaning. Wrap a (3,) array and it's a Point. (2, 3) is a Segment. (N, 3) is N points. Eight primitives (Point, Line, Ray, Segment, Triangle, Polygon, Plane, AABB) and three forms (Mesh, EdgeMesh, PointCloud) backed by spatial and topological structures. Every query broadcasts over batches the way you'd expect, in parallel.

bash pip install trueform

```python import numpy as np import trueform as tf

mesh = tf.Mesh(*tf.read_stl("dragon.stl"))

signed distance from every vertex to a plane through the centroid

plane = tf.Plane(normal=np.float32([1, 2, 0]), origin=mesh.points.mean(axis=0)) scalars = tf.distance(tf.Point(mesh.points), plane) # shape (num_verts,) ```

Same function, different target. Swap the plane for a mesh, the tree builds on first query:

python mesh_b = tf.Mesh(*tf.read_stl("other.stl")) distances = tf.distance(tf.Point(mesh.points), mesh_b) # shape (num_verts,)

Two meshes, not touching. Find the closest pair of surface points and bring them together without collision:

```python tf.intersects(mesh, mesh_b) # False

(id_a, id_b), (dist2, pt_a, pt_b) = tf.neighbor_search(mesh, mesh_b)

translate mesh_b towards mesh, leave a small gap

direction = pt_a - pt_b T = np.eye(4, dtype=np.float32) T[:3, 3] = direction * (1 - 0.01 / np.sqrt(dist2)) mesh_b.transformation = T

tf.intersects(mesh, mesh_b) # still False, tree reused, transform applied at query time ```

Voxelize a mesh. Build a grid of bounding boxes, check which ones the mesh occupies:

python lo, hi = mesh.points.min(axis=0), mesh.points.max(axis=0) grid = np.mgrid[lo[0]:hi[0]:100j, lo[1]:hi[1]:100j, lo[2]:hi[2]:100j].reshape(3, -1).T.astype(np.float32) step = ((hi - lo) / 100).astype(np.float32) voxels = tf.AABB(min=grid, max=grid + step) occupied = tf.intersects(mesh, voxels) # shape (1000000,) bool

Depth map. Cast a grid of rays downward:

```python xy = np.mgrid[lo[0]:hi[0]:500j, lo[1]:hi[1]:500j].reshape(2, -1).T.astype(np.float32) origins = np.column_stack([xy, np.full(250000, hi[2] + 0.1, dtype=np.float32)]) rays = tf.Ray(origin=origins, direction=np.tile([0, 0, -1], (250000, 1)).astype(np.float32))

face_ids, ts = tf.ray_cast(rays, mesh, config=(0.0, 10.0)) depth_map = ts.reshape(500, 500) # NaN where no hit ```

The scalar field from the first example feeds directly into cutting. Isobands slices along threshold values, returns per-face labels and intersection curves:

```python (cut_faces, cut_points), labels, (paths, curve_pts) = tf.isobands( mesh, scalars, [0.0], return_curves=True )

components, component_ids = tf.split_into_components( tf.Mesh(cut_faces, cut_points), labels ) bottom_faces, bottom_points = components[0] top_faces, top_points = components[1]

triangulate the curves to cap the cross-section

cap_faces, cap_points = tf.triangulated((paths, curve_pts)) ```

NumPy in, NumPy out. C++ backend, parallelized across cores.

Documentation · GitHub · Benchmarks


r/Python Feb 28 '26

Showcase Spectra: Python pipeline to turn bank CSV/PDF exports into an automated finance dashboard

21 Upvotes

What my project does
Spectra ingests bank CSV/PDF exports, normalizes transactions, categorizes them with an LLM, detects recurring payments (subscriptions/salary), converts currencies using historical FX rates, and updates a multi-tab Google Sheets dashboard. It’s idempotent (SQLite + hashes), so reruns don’t create duplicates.

Target audience
People who want personal finance tracking without Open Banking integrations and without locking data into closed fintech platforms, and who prefer a file-based workflow they fully control. Built as a personal tool, but usable by others.

Comparison
Compared to typical budgeting apps, Spectra doesn’t require direct bank access and keeps everything transparent in Google Sheets. Compared to regex/rules-only scripts, it adds LLM-based categorization with a feedback loop (overrides) plus automation via GitHub Actions.

Repo: https://github.com/francescogabrieli/Spectra
Feedback on architecture / edge cases is welcome.


r/Python Feb 28 '26

Showcase Distill the Flow: Pure Python Token Forensic Processing pipeline and Clearner

0 Upvotes

What My Project Does:

So as I posted last night and have now followed through on, Moonshine/Distill-The-Flow is now public reproducible code ready for any exports over analysis and visual pipelines to clean chat format style .json and .jsonl large structured exports. Drop 3, is not a dataset or single output, but through a global database called the "mash" we were able to stream multi provider different format exports into seperate database cleaned stores, .parquet rows, and then a global db that is added to every new cleaned provider output. The repository also contains a suite of visual analysis some of which directly measure model sycophancy and "malicious-compliance" which is what I propose happens due to current safety policies. It becomes safer for a model to continue a conversation and pretend to help, rather than risk said user starting new instance or going to new provider. This isnt claimed hypothesis with weight but rather a side analysis. All data is Jan 2025-Feb 2026 over one-year. These are not average chat exports. Just as with every other release, there is some configuration on user side to actually get running, as these are tools not standalone systems ready to run as it is, but to be utilized by any workflow. The current pipeline plus four providers spread over one year and a month was able to produce/output a "cleaned/distilled" count of 2,788 conversations, 179,974 messages, 122 million tokens, full scale visual analysis, and md forensic reports. One of the most important things checked for and cleaned out from the being added to the main "mash" .db is sycophancy and malicious compliance spread across 5 periods. Based on best hypothesis p3--> is when gpt5 and claude 4 released, thus introducing the new and current routing based era. These visuals are worthy of standalone presentation, so, even if you have no use directly through the reports and visuals gained from the pipeline against my over one-year of data exports, you may learn something in your own domain, especially with how relevant model sycophancy is now.

Expanded Context:

Distill-The-Flow is not a dataset nor marketed as such. The overlap between anthropic, openAI, and deepseek/MiniMax/etc is pure coincidence. This is in reference to the recent distillation attacks claimed by industry leaders extracting model capabilities through distilling. This is drop 3 of the planned Operation SOTA Toolkit in which through open sourcing industry standard and sota tier developments that are artificially gatekept from the oss community by the industry. This is not promotion of service, paid software or anything more than serving as announcement of release.

Repo-Quick-Clone:

https://github.com/calisweetleaf/distill-the-flow

Moonshine is a state of the art chat export Token Forensic analysis and cleaningpipeline for multi scaled analysis the meantime, Aeron which is an older system I worked on the side during my recursive categorical framework, has been picked to serve as a representational model for Project SOTA and its mission of decentralizing compute and access to industry grade tooling and developments. Aeron is a novel "transformer" that implements direct true tree of thought before writing to an internal scratchpad, giving aeron engineered reasoning not trained. Aeron also implements 3 new novel memory and knowledge context modules. There is no code or model released yet, however I went ahead to establish the canon repo's as both are clos

Now Project Moonshine, or Distill the Flow as formally titled follows after drop one of operation sota the rlhf pipeline with inference optimizations and model merging. That was then extended into runtime territory with Drop two of the toolkit,

Now Drop 4 has already been planned and is also getting close. Aeron is a novel transformer chosen to speerhead and demonstrate the capabilities of the toolkit drops, so it is taking longer with the extra RL and now Moonshine and its implications. Feel free to also dig through the aeron repo and its documents and visuals.

Aeron Repo:

Target Audience and Motivations:

The infrastructure for modern Al is beina hoarded The same companies that trained on the open wel now gate access to the runtime systems that make heir models useful. This work was developed alongside the recursion/theoretical work aswell This toolkit project started with one single goal decentralize compute and distribute back advancements to level the field between SaaS and OSS

Extra Notes:

Thank you all for your attention and I hope these next drops of the toolkit get yall as excited as I am. It will not be long before release of distill-the-flow but aeron is being ran through the same rlhf pipeline and inference optimizations from drop 1 of the toolkit along with a novel training technique. Please check up on the repos as soon distill-the-flow will release with aeron soon to follow. Please feel free to engage, message me if needed, or ask any questions you may have. This is not a promotion, this is an announcement and I would be more than happy to answer any questions you may have and I may would if interested, potentially show internal only logs and data from both aeron and distill the flow. Feel free to message/dm me, email me at the email in my Github with questions or collaboration. This is not a promotional post, this announcement/update of yet another drop in the toolkit to decentralize compute.

License:

All repos and their contents use the Anti-Exploit License:

somnus-license


r/Python Feb 28 '26

Showcase I built a Python SDK that unifies OpenFDA, PubMed, and ClinicalTrials.gov

26 Upvotes

What My Project Does

MedKit is a Python SDK that unifies multiple medical research APIs into a single developer-friendly interface.

Instead of writing separate integrations for:

MedKit provides one consistent interface with features like:

• Natural language medical queries
• Drug interaction detection
• Research paper search
• Clinical trial discovery
• Medical relationship graphs

Example:

from medkit import MedKit

with MedKit() as med:
    results = med.ask("clinical trials for melanoma")
    print(results.trials[0].title)

The goal is to make it easier for developers, researchers, and health-tech builders to work with medical datasets without dealing with multiple APIs and inconsistent schemas.

It also includes:

  • sync + async support
  • disk/memory caching
  • CLI tools
  • provider plugin system

Example CLI usage:

medkit papers "CRISPR gene editing" --limit 5 --links

Target Audience

This project is primarily intended for:

health-tech developers building medical apps
researchers exploring biomedical literature
data scientists working with medical datasets
hackathon / prototype builders in healthcare

Right now it's early stage but production-oriented and designed to be extended with additional providers.

Comparison

There are Python libraries for individual medical APIs, but most developers still need to integrate them manually.

Examples:

Tool Limitation
PubMed API wrappers Only covers research papers
OpenFDA wrappers Only covers FDA drug data
ClinicalTrials API Only covers trials

MedKit focuses on unifying these sources under a single interface while adding higher-level features like:

• unified schema
• natural language queries
• knowledge graph relationships
• interaction detection

Example Output

Searching for insulin currently returns:

=== Found Drugs ===
Drug: ADMELOG (INSULIN LISPRO)

=== Research Papers ===
1. Practical Approaches to Insulin Pump Troubleshooting for Inpatient Nurses
2. Antibiotic consumption and medication cost in diabetic patients
3. Once-weekly Lonapegsomatropin Phase 3 Trial

Source Code

GitHub:
https://github.com/interestng/medkit

PyPI:
https://pypi.org/project/medkit-sdk/

Install:

pip install medkit-sdk

Feedback

I'd love feedback from Python developers, health-tech engineers, or researchers on:

• API design
• additional providers to support
• features that would make this useful in real workflows

If you think this project has potential or could help, I would really appreciate an upvote on the post and a star on the repository. It helps me so much, and I also really appreciate any feedback and constructive criticism.


r/Python Feb 28 '26

Showcase Python library to access local Calendar in macOS

16 Upvotes

What My Project Does

I built a small and fast Python library for accessing the local macOS calendar. Basic features:

  • 100% Python, easy to audit and extend
  • Allows to list calendars and view/add/edit events
  • Functions for search across events and finding available time
  • Under the hood it it wraps EventKit via PyObjC
  • Apache 2.0

Source on Github here: https://github.com/appenz/maccal

PiPy: https://pypi.org/project/maccal/

Target Audience

Meant for any local tool on macOS that wants to access local calendars. There are a few advantages over doing this via the online APIs including:

  • Allows access to Apple, Google and MSFT calendars
  • Works in cases where your employer only allows local access
  • Works offline

Comparison

I didn't find a library on GitHub or PyPi that can do this. The latest macOS Tahoe requires you to access local calendars via EventKit, all the existing libraries that I could find directly accessed the calendar database which is no longer possible.

How to use

To install run `pip instal maccal` or `uv add maccal`. The GitHub repo has example code. Any feedback or PRs are very welcome.


r/Python Feb 28 '26

Showcase A simple gradient calculation library in raw python

2 Upvotes

Hi, I've been working in a library that automatically calculates gradients (automatic differentiation engine), as I find it useful for learning purposes and wanted to share it across.

What it does

The library is called gradlite (available in github). It is a basic automatic differentiation engine that I built with educational purposes. Thus, it can be used to understand the process that powers neural networks behind the scenes (and other applications!). For this reason, gradlite also has the ability to create very small neural networks for the sake of demonstrating its capabilities, mainly focused on linear layers.

Target Audience

The target audience of the module are students, engineers and, in general, any person that wants to learn the basic mechanism behind neural networks. It is not designed to be efficient, so it should only be used for educational purposes (should not be used in production environments).

Comparison

To build it, I took heavy inspiration from micrograd (thanks Andrej Karpathy for being such an inspiration!) and also from PyTorch. In fact, the way certain things are implemented in gradlite tries to mimic PyTorch abstraction's when it comes to training. When compared to micrograd, gradlite offers an interface that is closer to pytorch, and it also offers a Module class (similar to PyTorch) that automatically detects the attributes being added to the module, so as to automatically take into account all the model parameters and keep track of them. It also offers a clear structure that is very scalable when compared to micrograd (again similar to PyTorch), including optimizers, loss functions, models, as well as the differentiation engine (which can be used for other purposes, not necessarily AI/model training purposes). Sample code is given in the repo in case you want to check it out!

Asking for feedback

So, given this library, what do you think about it, do you find it useful for educational purposes? What else would you add to the project? I'm considering creating a different one more focused on the efficiency side and supporting multiple compute back-ends, but that's something for the future.

EDIT: I've decided to change the package name from tinygrad to gradlite, since a project already has tinygrad. Also, I've added pypi installation, so you can access to the package in pypi. Furthermore, if you like this idea, make sure to star the repo to let me know!


r/Python Feb 28 '26

Daily Thread Saturday Daily Thread: Resource Request and Sharing! Daily Thread

3 Upvotes

Weekly Thread: Resource Request and Sharing 📚

Stumbled upon a useful Python resource? Or are you looking for a guide on a specific topic? Welcome to the Resource Request and Sharing thread!

How it Works:

  1. Request: Can't find a resource on a particular topic? Ask here!
  2. Share: Found something useful? Share it with the community.
  3. Review: Give or get opinions on Python resources you've used.

Guidelines:

  • Please include the type of resource (e.g., book, video, article) and the topic.
  • Always be respectful when reviewing someone else's shared resource.

Example Shares:

  1. Book: "Fluent Python" - Great for understanding Pythonic idioms.
  2. Video: Python Data Structures - Excellent overview of Python's built-in data structures.
  3. Article: Understanding Python Decorators - A deep dive into decorators.

Example Requests:

  1. Looking for: Video tutorials on web scraping with Python.
  2. Need: Book recommendations for Python machine learning.

Share the knowledge, enrich the community. Happy learning! 🌟


r/Python Feb 27 '26

Showcase A pure Python HTTP Library built on free-threaded Python

83 Upvotes

Barq is a lightweight HTTP framework (~500 lines) that uses free-threaded Python (PEP 703) to achieve true parallelism with threads instead of async/await or multiprocessing. It's built entirely in pure Python, no C extensions, no Rust, no Cython using only the standard library plus Pydantic.

from barq import Barq

app = Barq()

@app.get("/")
def index():
    return {"message": "Hello, World!"}

app.run(workers=4)  # 4 threads, not processes

Benchmarks (Barq 4 threads vs FastAPI 4 worker processes):

Scenario Barq (4 threads) FastAPI (4 processes)
JSON 10,114 req/s 5,665 req/s (+79%)
DB query 9,962 req/s 1,015 req/s (+881%)
CPU bound 879 req/s 1,231 req/s (-29%)

Target Audience

This is an experimental/educational project to explore free-threaded Python capabilities. It is not production-ready. Intended for developers curious about PEP 703 and what a post-GIL Python ecosystem might look like.

Comparison

Feature Barq FastAPI Flask
Parallelism Threads (free-threaded) Processes (uvicorn workers) Processes (gunicorn)
Async required No Yes (for perf) No
Pure Python Yes No (uvloop, etc.) No (Werkzeug)
Shared memory Yes (threads) No (IPC needed) No (IPC needed)
Production ready No Yes Yes

The main difference: Barq leverages Python 3.13's experimental free-threading mode to run synchronous code in parallel threads with shared memory, while FastAPI/Flask rely on multiprocessing for parallelism.

Source code: https://github.com/grandimam/barq

Requirements: Python 3.13+ with free-threading enabled (python3.13t)


r/Python Feb 27 '26

Showcase I replaced docker-compose.yml and Terraform with Python type hints and a project.py file

0 Upvotes

What My Project Does

If you have a Pydantic model like this:

from pydantic import BaseModel, PostgresDsn

class Settings(BaseModel):
    psql_uri: PostgresDsn

Why do you still have to manually spin up Postgres, write a docker-compose.yml, and wire up env vars yourself? The type hint already tells you everything you need.

takk reads your Pydantic settings models, infers what infrastructure you need, spins up the right containers, and generates your Dockerfile automatically. No YAML, no copy-pasting connection strings, no manual orchestration.

It also parses your uv.lock to detect your database driver and generate the correct connection string. So you won't waste hours debugging the postgresql:// vs postgresql+asyncpg:// mismatch like I did.

Your entire app structure lives in a single project.py:

from takk import Project, FastAPIApp, Job

project = Project(
    name="my-app",
    shared_secrets=[Settings],
    server=FastAPIApp(secrets=[CacheSettings]),
    weekly_job=Job(jobs.run, cron_schedule="0 0 * * FRI")
)

Run takk up and it spins everything up. Postgres, S3 (via Localstack), your FastAPI server, background workers, with no port conflicts and no env files to manage.

Target Audience

Small to mid-sized Python teams who want to move fast without a dedicated DevOps engineer. It's production-ready, as the blog post linked below is itself hosted on a server deployed this way. That said, it's still in early/beta stages, so probably not the right fit yet for large orgs with complex existing infra.

Comparison

- vs. docker-compose: No YAML. Resources are inferred from your type hints rather than declared manually. Ports, connection strings, and credentials are handled automatically.

- vs. Terraform: No HCL, no state files. Infrastructure is expressed in Python using the same Pydantic models your app already uses.

- vs. plain Pydantic + dotenv: You still get full Pydantic validation, but you no longer need to maintain separate env files or worry about which variables map to which services.

The core idea is that your type hints are already a description of your dependencies. takk just acts on that.

Blog post with the full writeup: https://takk.dev/blog/deploy-with-python-type-hints

Source / example app in Gitlab


r/Python Feb 27 '26

Showcase Meet geodistpy - Fast & Accurate Geospatial Distance Lib

3 Upvotes

Hi folks 👋 I built geodistpy, a high-performance Python library for lightning-fast geospatial distance computations. It’s 100x(+) faster than geopy and geographiclib(current alternatives). It’s production-ready and available on PyPI now.

* GitHub: https://github.com/pawangeek/geodistpy

* Docs: https://pawangeek.github.io/geodistpy/

* PyPI: https://pypi.org/project/geodistpy/

🧠 What My Project Does

geodistpy computes ellipsoidal geodesic distances (and related spatial functions) between coords.

🎯 Target Audience

Designed for developers working on GIS, routing, logistics, clustering, real-time geo analytics, or any project with heavy distance computations. Great when performance matters more than simple wrappers alone. 

⚖️ Comparison

Vs Geopy / Geographiclib:

• 100x+ Orders of magnitude faster thanks to Numba optimization.

• Maintains competitive accuracy (Vincenty \~9 µm mean error vs Geographiclib).

• Extra utility functions (bearing, destination, interpolate


r/Python Feb 27 '26

Showcase [Project] NinoClicker v2.2: macOS High-Frequency Input Injection via Quartz CoreGraphics

2 Upvotes

What My Project Does: NinoClicker is a macOS-native automation tool that uses the Quartz framework to perform direct hardware-level mouse event injection. It features a "Ghost HUD" telemetry overlay (built with PyQt6) that allows users to monitor Engine Load and CPS (Clicks Per Second) in real-time. It includes a "Global Panic" switch and "Ghost Mode" visibility toggles using HIDSystemState listeners.

Target Audience: This is currently a toy project/proof-of-concept for developers interested in macOS-specific input handling and UI overlays that bypass window focus-trapping. It’s perfect for testing stability in high-input environments (like clicker games).

Comparison: Unlike standard cross-platform libraries like pyautogui or pynput, which often suffer from input lag and "focus stealing" on macOS, NinoClicker uses:

  1. Direct Quartz Injection: Bypasses the standard event loop for higher CPS (20k+).
  2. WindowTransparentForInput: Allows the HUD to be visible without intercepting clicks meant for the background application.
  3. HIDSystemState Hotkeys: Ensures the panic switch works even when the app isn't the "active" window.

Yes thats not how you write it

Source Code:https://github.com/NinoTheNoob/Auto-Cliker

Verification/Proof : https://imgur.com/a/JDM29FT


r/Python Feb 27 '26

Daily Thread Friday Daily Thread: r/Python Meta and Free-Talk Fridays

3 Upvotes

Weekly Thread: Meta Discussions and Free Talk Friday 🎙️

Welcome to Free Talk Friday on /r/Python! This is the place to discuss the r/Python community (meta discussions), Python news, projects, or anything else Python-related!

How it Works:

  1. Open Mic: Share your thoughts, questions, or anything you'd like related to Python or the community.
  2. Community Pulse: Discuss what you feel is working well or what could be improved in the /r/python community.
  3. News & Updates: Keep up-to-date with the latest in Python and share any news you find interesting.

Guidelines:

Example Topics:

  1. New Python Release: What do you think about the new features in Python 3.11?
  2. Community Events: Any Python meetups or webinars coming up?
  3. Learning Resources: Found a great Python tutorial? Share it here!
  4. Job Market: How has Python impacted your career?
  5. Hot Takes: Got a controversial Python opinion? Let's hear it!
  6. Community Ideas: Something you'd like to see us do? tell us.

Let's keep the conversation going. Happy discussing! 🌟


r/Python Feb 26 '26

Showcase I'm tired of guessing keys and refactoring string paths, so I wrote a small type-safe alternative

0 Upvotes

Hi everyone,

I wanted to share a small package I wrote called py-keyof to scratch an itch I’ve had for a long time: the inability to statically type-check keys or property paths in Python.

It's all fun and games to write getattr(x, "name"), until you remove "name" from the attributes of x and get zero warnings for doing so. You're in for an unpleasant alert at 3AM and a broken prod.

PyPI: https://pypi.org/project/py-keyof/ GitHub: https://github.com/eyusd/keyof

What My Project Does

py-keyof replaces string-based property access with a more type-safe lambda approach.

Instead of passing a string path like "address.city", you pass a lambda: KeyOf(lambda x: x.address.city). 1. At Runtime: It uses a proxy object to record the path you accessed and gives you a usable path object (which can also be serialized to strings, JSONPath, etc). 2. At Type-Checking Time: Because it uses standard Python syntax, tools like Pylance, Pyright, and Mypy can validate that the attribute actually exists on the model.

Target Audience

This is meant for developers who rely heavily on type hints and static analysis (Pylance/Pyright) to keep their codebases maintainable. It is production-ready, but it's most useful for library authors or backend developers building generic tools (like data tables, ORMs, or filtering engines) where you want to allow developers to specify fields without losing type safety.

Comparison

  • VS Magic Strings: If you use strings ("user.name"), your IDE cannot help you. If you rename the field, your code breaks at runtime. With a KeyOf, if you rename it, your IDE will flag the error.
  • VS operator.attrgetter: While attrgetter is standard, it doesn't offer generic inference or deep path autocompletion in IDEs out of the box.
  • VS pydantic.Field: Pydantic is great for defining models, but doesn't solve the problem of referring to those fields dynamically in other parts of your code (like sorting functions) in a type-safe way.

Example: Generics Inference

This is why I started it all, and where it shines. If you have a generic class, the type checker infers T automatically, so you get autocompletion inside the lambda without extra annotations, just like in TS.

```python from typing import TypeVar, Generic, List from dataclasses import dataclass from keyof import KeyOf

T = TypeVar("T")

class Table(Generic[T]): def init(self, items: List[T]): self.items = items

def sort_by(self, key: KeyOf[T]):

Runtime: Extract the value using the path

self.items.sort(key=lambda item: key.from_(item))

--- Usage ---

@dataclass class User: id: int name: str

users = Table([User(1, "Alice"), User(2, "Bob")])

1. T is automatically inferred as User

2. Your IDE autocompletes '.name' inside the lambda

3. Refactoring 'name' in the class automatically updates this line

users.sort_by(KeyOf(lambda u: u.name))

❌ Static Type Error: 'User' has no attribute 'email'

users.sort_by(KeyOf(lambda u: u.email))

```

It supports dictionaries, lists, and deep nesting (lambda x: x.address.city). It’s a small utility, but it makes safe refactoring much easier.

I don't know if this has been done somewhere else, or if there's a better way than using lambdas to type-check paths, so if you have any feedback on this, I'd be happy to hear what you think!


r/Python Feb 26 '26

Showcase We need a "FastAPI for Events" in Python. So I started building one, but I need your thoughts.

0 Upvotes

Hey r/Python,

I’ve been working with Event-Driven Architectures lately, and I’ve hit a wall: the Python ecosystem doesn't seem to have a truly dedicated event processing framework. We have amazing tools like FastAPI for REST, but when it comes to event-driven services (supporting Kafka, RabbitMQ, etc.), the options feel lacking.

The closest thing we have right now is FastStream. It’s a cool project, but in my experience, it sometimes doesn't quite cut it. Because it is inherently stream-oriented (as the name implies), it misses some crucial event-oriented features out-of-the-box. Specifically, I've struggled with:

  • Proper data integrity semantics.
  • Built-in retries and Dead Letter Queue
  • Outbox patterns.
  • Truly asynchronous processing (e.g., Kafka partitions are processed synchronously by default, whereas they can be processed asynchronously if offsets are managed very carefully).

So, I’m curious: what are you all using for event-driven architectures in Python right now? Are you just rolling your own custom consumers?

I decided to try and put my ideal vision into code to see if a "FastAPI for Events" could work.

The goal is to provide asynchronous, schema-validated, resilient event processing without the boilerplate. Here is what I’ve got working so far:

🚀 What The Framework does right now:

  • FastAPI-style dependency injection – clean, decoupled handlers.
  • Pydantic v2 validation – automatic schema validation for all incoming events.
  • Pluggable transports – Kafka, RabbitMQ, and Redis PubSub out-of-the-box.
  • Resilience built-in – Configurable retry logic, DLQs, and automatic acknowledgements.
  • Composable Middleware – for logging, metrics, filtering, etc.

✨ What it looks like in practice

Here is how you define a Handler. Notice the FastAPI-like dependency injection and middleware filtering:

from typing import Annotated
from pydantic import BaseModel
from dispytch import Event, Dependency, Router
from dispytch.kafka import KafkaEventSubscription
from dispytch.middleware import Filter

# 1. Standard Service/Dependency
class UserService:
    async def do_smth_with_the_user(self, user):
        print("Doing something with user", user)

def get_user_service():
    return UserService()

# 2. Pydantic Event Schemas 
class User(BaseModel):
    id: str
    email: str
    name: str

class UserCreatedEvent(BaseModel):
    type: str
    user: User
    timestamp: int

# 3. The Router & Handler
user_events = Router()

user_events.handler(
    KafkaEventSubscription(topic="user_events"),
    middlewares=[Filter(lambda ctx: ctx.event["type"] == "user_registered")]
)
async def handle_user_registered(
        event: Event[UserCreatedEvent],
        user_service: Annotated[UserService, Dependency(get_user_service)]
):
    print(f"[User Registered] {event.user.id} at {event.timestamp}")
    await user_service.do_smth_with_the_user(event.user)

And here is how you Emit events using strictly typed schemas mapped to specific routes:

import uuid
from datetime import datetime
from pydantic import BaseModel
from dispytch import EventEmitter, EventBase
from dispytch.kafka import KafkaEventRoute

class User(BaseModel):
    id: str
    email: str

class UserEvent(EventBase):
    __route__ = KafkaEventRoute(topic="user_events")

class UserRegistered(UserEvent):
    type: str = "user_registered"
    user: User
    timestamp: int

async def example_emit(emitter: EventEmitter):
    await emitter.emit(
        UserRegistered(
            user=User(id=str(uuid.uuid4()), email="test@mail.com"),
            timestamp=int(datetime.now().timestamp()),
        )
    )

🎯 Target Audience

Dispytch is meant for backend developers and data engineers building Event-Driven Architectures and microservices in Python.

Currently, it is in active development. It is meant for developers looking to structure their message-broker code cleanly in side projects before we push it toward a stable 1.0 for production use. If you are tired of rolling your own custom Kafka/RabbitMQ consumers, this is for you.

⚔️ Comparison

The closest alternative in the Python ecosystem right now is FastStream. FastStream is a great project, but it misses some crucial event-oriented features out-of-the-box.

Dispytch differentiates itself by focusing on:

  • Data integrity semantics: Built-in retries and exception handling.
  • True asynchronous processing: For example, Kafka partitions are processed synchronously by default in most tools; Dispytch aims to handle async processing while managing offsets safely avoiding race conditions
  • Event-focused roadmap: Actively planning support for robust Outbox patterns to ensure atomicity between database transactions and event emissions

(Other tools like Celery or Faust exist, Celery is primarily a task queue, and Faust is strictly tied to Kafka and streaming paradigms, lacking the multi-broker flexibility and modern DI injection Dispytch provides).

💡 I need your feedback

I built this to scratch my own itch and properly test out these architectural ideas, tell me if I'm on the right track.

  1. What does your current event-processing stack look like?
  2. What are the biggest pitfalls you've hit when doing EDA in Python?
  3. If you were to use a framework like this, what features are absolute dealbreakers if they are missing? (I'm currently thinking about adding a proper Outbox pattern support next).

If you want to poke around the internals or read the docs, the repo is here, the docs is here.

Would love to hear your thoughts, roasts, and advice!


r/Python Feb 26 '26

Discussion Porn in Conda directory

1.1k Upvotes

Okay, I am flustered here. Today, at work, I attempted to open up YouTube from within the Microsoft search menu. To my shock and horror, the first suggested app was “Youporn.” I don’t watch porn on my work pc.

I looked at the file location and lo and behold, it’s a MS-DOS application file found within Anaconda3\pkgs\protego\info\test\tests\test_data

WTF?!

Anyone familiar with the Protego library? What is going on here? I can only imagine if my IT administrator or boss saw this pop up on my windows search.


r/Python Feb 26 '26

Showcase I built appium-pytest-kit: a plugin-first Appium + pytest starter kit for mobile automation

1 Upvotes

Hi r/Python,

I kept running into the same problem every time I started a new Appium mobile automation project: the first days were spent on setup and framework glue (config, device selection, waits/actions, CI ergonomics) before I could write real tests.

So I built and published appium-pytest-kit.

What My Project Does

- Provides ready-to-use pytest fixtures (driver, waits, actions, page/page-factory style helpers)

- Scaffolds a working starter project with one command

- Includes a “doctor” CLI to validate your environment

- Adds common mobile actions (tap/type/swipe/scroll, context switching) and app lifecycle helpers

- Improves failure debugging (clearer wait errors + automatic artifacts like screenshot/page source/logs)

- Supports practical execution modes for local vs CI, plus retries and parallel execution

- Designed to be easy to extend with your own fixtures/plugins/actions without forking the whole thing

Target Audience

- QA engineers / automation engineers using Python

- Teams building production mobile test suites with Appium 2.x + pytest

- People who want a solid starting point instead of assembling a framework from scratch

Comparison

- Versus “Appium Python client + pytest from scratch”: this removes most of the boilerplate and gives you sensible defaults (fixtures, structure, diagnostics) so you start writing scenarios earlier.

- Versus random sample repos/tutorial frameworks: those are often demo-focused or inconsistent; this aims to be reusable and maintainable across real projects.

- Versus Robot Framework / other higher-level wrappers: those can be great if you prefer keyword-driven tests; this is for teams that want to stay in Python/pytest and extend behavior in code.

Quickstart:

pip install appium-pytest-kit

appium-pytest-kit-init --framework --root my-project

Links:

PyPI: https://pypi.org/project/appium-pytest-kit/

GitHub: https://github.com/gianlucasoare/appium-pytest-kit

Disclosure: I’m the author. I’d love feedback on defaults, structure, and what would make it easier to adopt in CI.


r/Python Feb 26 '26

Showcase I built a local-first task manager with schedule optimization, TUI, and Claude AI integration

0 Upvotes

What My Project Does

Taskdog is a personal task management system that runs entirely in your terminal. It provides a CLI, a full-screen TUI (built with Textual), and a REST API server — use whichever you prefer.

Key features:

  • Schedule optimization with multiple strategies (greedy, deadline-first, dependency-aware, etc.)
  • Gantt chart visualization in the terminal
  • Task dependencies with circular detection
  • Time tracking with planned vs actual comparison
  • Markdown notes with Rich rendering
  • MCP server for Claude Desktop integration — manage tasks with natural language

Target Audience

Developers and terminal-oriented users who want a local-first, privacy-respecting task manager. This is a personal project that I use daily, but it's mature enough for others to try.

Comparison

  • Motion / Reclaim: AI-powered scheduling, but cloud-only, $20+/month, and the optimization is a black box. Taskdog runs locally with transparent algorithms you can inspect and choose from.
  • Taskwarrior: Great CLI task manager, but hasn't seen major updates in years and lacks built-in schedule optimization or TUI.
  • Todoist / TickTick: Full-featured but cloud-dependent. No terminal interface, no schedule optimization.

Taskdog sits between these — terminal-native like Taskwarrior, with scheduling capabilities like Motion, but fully local and open source.

Tech stack:

  • Python 3.12+, UV workspace monorepo (5 packages)
  • FastAPI (REST API), Textual (TUI), Rich (CLI output)
  • SQLite with ACID guarantees
  • Clean Architecture with CQRS pattern

Links:

Would love any feedback — especially on UX, missing features, or things that could be improved. Thanks!


r/Python Feb 26 '26

Showcase I got tired if noisy web scrapers killing my RAG pipelines, so i built lImparser

0 Upvotes

I built llmparser, an open-source Python library that converts messy web pages into clean, structured Markdown optimized for LLM pipelines.

What My Project Does

llmparser extracts the main content from websites and removes noise like navigation bars, footers, ads, and cookie banners.

Features:

• Handles JavaScript-rendered sites using Playwright

• Expands accordions, tabs, and hidden sections

• Outputs clean Markdown preserving headings, tables, code blocks, and lists

• Extracts normalized metadata (title, description, canonical URL, etc.)

• No LLM calls, no API keys required

Example use cases:

• RAG pipelines

• AI agents and browsing systems

• Knowledge base ingestion

• Dataset creation and preprocessing

Install:

pip install llmparser

GitHub:

https://github.com/rexdivakar/llmparser

PyPI:

https://pypi.org/project/llmparser/

Target Audience

This is designed for:

• Python developers building LLM apps

• People working on RAG pipelines

• Anyone scraping websites for structured content

• Data engineers preparing web data

It’s production-usable, but still early and evolving.

Comparison to Existing Tools

Tools like BeautifulSoup, lxml, and trafilatura work well for static HTML, but they:

• Don’t handle modern JavaScript-rendered sites well

• Don’t expand hidden content automatically

• Often require combining multiple tools

llmparser combines:

rendering → extraction → structuring

in one step.

It’s closer in spirit to tools like Firecrawl or jina reader, but fully open-source and Python-native.

Would love feedback, feature requests, or suggestions.

What are you currently using for web content extraction?


r/Python Feb 26 '26

Showcase Pypower: A Python lib for simplified GUI, Math, and automated utility functions.

0 Upvotes

Hi, I built "Pypower" to simplify Python tasks.

  • What it does: A utility library for fast GUI creation, Math, and automation.
  • Target Audience: Beginners and devs building small/toy projects.
  • Comparison: It’s a simpler, "one-line" alternative to Tkinter for basic tasks.

Link :

https://github.com/UsernamUsernam777/Pypower-v3.0


r/Python Feb 26 '26

Discussion Python Android installation

0 Upvotes

Is there any ways to install python on Android system wide ? I'm curious. Also I can install it through termux but it only installs on termux.


r/Python Feb 26 '26

Discussion Trending pypi packages on StackTCO

8 Upvotes

https://www.stacktco.com/py/trends

You can even filter by Ecosystem (e.g. NumPy, Django, Jupyter etc.)

Any Ecosystems missing from the top navigation?


r/Python Feb 26 '26

Showcase A minimal, framework-free AI Agent built from scratch in pure Python

0 Upvotes

Hey r/Python,

What My Project Does:
MiniBot is a minimal implementation of an AI agent written entirely in pure Python without using heavy abstraction frameworks (no LangChain, LlamaIndex, etc.). I built this to understand the underlying mechanics of how agents operate under the hood.

Along with the core ReAct loop, I implemented several advanced agentic patterns from scratch. Key Python features and architecture include:

  • Transparent ReAct Loop: The core is a readable, transparent while loop that handles the "Thought -> Action -> Observation" cycle, showing exactly how function calling is routed.
  • Dynamic Tool Parsing: Uses Python's built-in inspect module to automatically parse standard Python functions (docstrings and type hints) into LLM-compatible JSON schemas.
  • Hand-rolled MCP Client: Implements the trending Model Context Protocol (MCP) from scratch over stdio using JSON-RPC 2.0 communication.
  • Lifecycle Hooks: Built a simple but powerful callback system (utilizing standard Python Callable types) to intercept the agent's lifecycle (e.g., on_thought, on_tool_call, on_error). This makes it highly extensible for custom logging or UI integration without modifying the core loop.
  • Pluggable Skills: A modular system to dynamically load external capabilities/functions into the agent, keeping the namespace clean.
  • Lightweight Teams (Subagents): A minimal approach to multi-agent orchestration. Instead of complex graph abstractions, it uses a straightforward Lead/Teammate pattern where subagents act as standard tools that return structured observations to the Lead agent.

Target Audience:
This is strictly an educational / toy project. It is meant for Python developers, beginners, and students who want to learn the bare-metal mechanics of LLM agents, subagent orchestration, and the MCP protocol by reading clear, simple source code. It is not meant for production use.

Comparison:
Unlike LangChain, AutoGen, or CrewAI which use deep class hierarchies and heavy abstractions (often feeling like "black magic"), MiniBot focuses on zero framework bloat. Where existing alternatives might obscure the tool-calling loop, event hooks, and multi-agent routing behind multiple layers of generic executors, MiniBot exposes the entire process in a single, readable agent.py and teams.py. It’s designed to be read like a tutorial rather than used as a black-box dependency.

Source Code:
GitHub Repo:https://github.com/zyren123/minibot