r/Python • u/Entrance_Brave • Feb 26 '26
Discussion Trending pypi packages on StackTCO
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 • u/Entrance_Brave • Feb 26 '26
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 • u/Any_Boysenberry6107 • Feb 26 '26
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 • u/RealNamikazeAsh • Feb 26 '26
What My Project Does
Target Audience (e.g., Is it meant for production, just a toy project, etc.)
Comparison (A brief comparison explaining how it differs from existing alternatives.)
https://github.com/NamikazeAsh/ytmpcli
(I'm aware yt-dlp exists, this tool uses yt-dlp as the backend, it's mainly for personal convenience for faster pasting for music, videos, playlists!)
r/Python • u/Eyusd • Feb 26 '26
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
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).
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.
"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.operator.attrgetter: While attrgetter is standard, it doesn't offer generic inference or deep path autocompletion in IDEs out of the box.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.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.
=
=
# Runtime: Extract the value using the path
# --- Usage ---
:
:
=
# 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
# ❌ 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 • u/Small-Neat8684 • Feb 26 '26
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 • u/BeamMeUpBiscotti • Feb 25 '26
Empty containers like [] and {} are everywhere in Python. It's super common to see functions start by creating an empty container, filling it up, and then returning the result.
Take this, for example:
def my_func(ys: dict[str, int]):
x = {}
for k, v in ys.items():
if some_condition(k):
x.setdefault("group0", []).append((k, v))
else:
x.setdefault("group1", []).append((k, v))
return x
This seemingly innocent coding pattern poses an interesting challenge for Python type checkers. Normally, when a type checker sees x = y without a type hint, it can just look at y to figure out x's type. The problem is, when y is an empty container (like x = {} above), the checker knows it's a dict, but has no clue what's going inside.
The big question is: How is the type checker supposed to analyze the rest of the function without knowing x's type?
Different type checkers implement distinct strategies to answer this question. This blog will examine these different approaches, weighing their pros and cons, and which type checkers implement each approach.
Full blog: https://pyrefly.org/blog/container-inference-comparison/
r/Python • u/-Equivalent-Essay- • Feb 25 '26
https://jakabszilard.work/posts/oauth-in-python
I was creating a CLI app in Python that needed to communicate with an endpoint that needed OAuth 2.0, and I've realized it's not as trivial as I thought, and there are some additional challenges compared to a web app in the browser in terms of security and implementation. After some research I've managed to come up with an implementation, and I've decided to collect my findings in a way that might end up being interesting / useful for others.
r/Python • u/AutoModerator • Feb 26 '26
Welcome to this week's discussion on Python in the professional world! This is your spot to talk about job hunting, career growth, and educational resources in Python. Please note, this thread is not for recruitment.
Let's help each other grow in our careers and education. Happy discussing! 🌟
r/Python • u/debba_ • Feb 25 '26
What my project does
Tabularis is an open-source desktop database manager with built-in support for MySQL, PostgreSQL, MariaDB, and SQLite. The interesting part: external drivers are just standalone executables — including Python scripts — dropped into a local folder.
Tabularis spawns the process on connection open and communicates via newline-delimited JSON-RPC 2.0 over stdin/stdout. The plugin responds, logs go to stderr without polluting the protocol, and one process is reused for the whole session.
A simple Python plugin looks like this:
import sys, json
for line in sys.stdin: req = json.loads(line) if req["method"] == "get_tables": result = {"tables": ["my_table"]} sys.stdout.write(json.dumps({"jsonrpc": "2.0", "id": req["id"], "result": result}) + "\n") sys.stdout.flush()
The manifest the plugin declares drives the UI — no host/port form for file-based DBs, schema selector only when relevant, etc. The RPC surface covers schema discovery, query execution with pagination, CRUD, DDL, and batch methods for ER diagrams.
Target Audience
Python developers and data engineers who work with non-standard data sources — DuckDB, custom file formats, internal APIs — and want a desktop GUI without writing a full application. The current registry already ships a CSV plugin (each .csv in a folder becomes a table) and a DuckDB driver. Both written to be readable examples for building your own.
Has anyone built a similar stdin/stdout RPC bridge for extensibility in Python projects? Curious about tradeoffs vs HTTP or shared libraries.
Github Repo: https://github.com/debba/tabularis
Plugin Guide: https://tabularis.dev/wiki/plugins
CSV Plugin (in Python): https://github.com/debba/tabularis-csv-plugin
r/Python • u/rnv812 • Feb 25 '26
Eventum generates realistic synthetic events - logs, metrics, clickstream, IoT, etc., and streams them in real time or dumps everything at once to various outputs.
It started because I was working with SIEM systems and constantly needed test data. Every time: write a script, hardcode values, throw it away. Got tired of that loop.
The idea of Eventum is pretty simple - write an event template, define a schedule and pick where to send it.
Features:
Tech stack: Python 3.13, asyncio + uvloop, Pydantic v2, FastAPI, Click, Jinja2, structlog. React for the web UI.
Testers, data engineers, backend developers, DevOps, SRE and data specialists, security engineers and anyone building or testing event-driven systems.
I honestly haven’t found anything with this level of flexibility around time control and event correlation. Most generators either spit out random-ish data or let you tweak a few fields - but you can’t really model realistic temporal behavior, chained events or causal relationships in a simple way.
Would love to hear what you think!
Links:
r/Python • u/No-Reality-4877 • Feb 26 '26
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:
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
Taskdog sits between these — terminal-native like Taskwarrior, with scheduling capabilities like Motion, but fully local and open source.
Tech stack:
Links:
Would love any feedback — especially on UX, missing features, or things that could be improved. Thanks!
r/Python • u/MomentBeneficial4334 • Feb 25 '26
What My Project Does:
MolBuilder is a pure-Python package that handles the full chemistry pipeline from molecular structure to production planning. You give it a molecule as a SMILES string and it can:
The core is built on a graph-based molecule representation with adjacency lists. Functional group detection uses subgraph pattern matching on this graph (24 detectors). The retrosynthesis engine applies reaction templates in reverse using beam search, terminating when it hits purchasable starting materials (~200 in the database). The condition prediction layer classifies substrate steric environment and electronic character, then scores and ranks compatible templates.
Python-specific implementation details:
Install and example:
pip install molbuilder
from molbuilder.process.condition_prediction import predict_conditions
result = predict_conditions("CCO", reaction_name="oxidation", scale_kg=10.0)
print(result.best_match.template_name) # TEMPO-mediated oxidation
print(result.best_match.conditions.temperature_C) # 5.0
print(result.best_match.conditions.solvent) # DCM/water (biphasic)
print(result.overall_confidence) # high
1,280+ tests (pytest), Python 3.11+, CI on 3.11/3.12/3.13. Only dependencies are numpy, scipy, and matplotlib.
GitHub: https://github.com/Taylor-C-Powell/Molecule_Builder
Tutorials: https://github.com/Taylor-C-Powell/Molecule_Builder/tree/main/tutorials
Target Audience:
Production use. Aimed at computational chemists, process chemists, and cheminformatics developers who need programmatic access to synthesis planning and process engineering. Also useful for teaching organic chemistry and chemical engineering - the tutorials are designed as walkable Jupyter notebooks. Currently used by the author in a production SaaS API.
Comparison:
vs. RDKit: RDKit is the standard open-source cheminformatics toolkit and focuses on molecular properties (fingerprints, substructure search, descriptors). MolBuilder (pure Python, no C extensions) focuses on the process engineering side - going from "I have a molecule" to "here's how to manufacture it at scale." Not a replacement for RDKit's molecular modeling depth.
vs. Reaxys/SciFinder: Commercial databases with millions of literature reactions. MolBuilder has 91 templates - far smaller coverage, but it's free, open-source (Apache 2.0), and gives you programmatic API access rather than a search interface.
vs. ASKCOS/IBM RXN: ML-based retrosynthesis tools. MolBuilder uses rule-based templates instead of neural networks, which makes it transparent and deterministic but less capable for novel chemistry. The tradeoff is simplicity and no external service dependency.
r/Python • u/Active-Carpenter4129 • Feb 25 '26
What My Project Does
Finds NBA players with similar career profiles using vector search. Type "guards similar to Kobe from the 90s" and get ranked matches with radar chart comparisons.
Instead of LLM embeddings, the vectors are built from the stats themselves - 25 features normalized with RobustScaler, position one-hot encoded, stored in Qdrant for cosine similarity across ~4,800 players.
Stack: FastAPI + Streamlit + Qdrant + scikit-learn, all Python, runs in Docker on a Synology NAS.
Demo: valme.xyz
Source: github.com/ValmeI/nba-player-similarity
Target Audience
Personal project/learning reference for anyone interested in building custom embeddings from structured data, vector search with Qdrant, or full-stack Python with FastAPI + Streamlit.
Comparison
Most NBA comparison tools let you pick two players manually. This searches all players at once using their full stat vector - captures the overall shape of a career rather than filtering on individual stat thresholds.
r/Python • u/e1-m • Feb 26 '26
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:
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:
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()),
)
)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.
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:
(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 built this to scratch my own itch and properly test out these architectural ideas, tell me if I'm on the right track.
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!