News for hackers. Stuff that matters.

manimozaffar

RichAPI: Find HTTP Exceptions and turn them into documented responses

Introducing RichAPI!A big thank you to Sebastián Ramírez Montaño for creating FastAPI, which made seamless documentation possible. Inspired by his work and Marcelo Trylesinski similar library(Fast-Responses), I developed RichAPI – a tool that uses AST to analyze your FastAPI code and enhance Swagger with all possible responses, not just 2xx. By parsing your router's code, RichAPI automatically...

( Read More... | no comments | on HN )
I'm excited to introduce Naked SQLAlchemy, a thin wrapper over SQLAlchemy Core that simplifies database interactions in Python. After facing pitfalls with traditional ORMs—like in-memory data not matching the actual database state due to complexities like identity mapping and dirty tracking—I realized these features, meant to ease development, often make things more complicated and harder to learn. Naked SQLAlchemy bridges over these unnecessary layers by promoting explicit SQL usage and direct mapping of query results to Python dataclasses.

Besides significant speed improvements (nearly twice as fast as traditional ORMs), Naked SQLAlchemy is easy to learn because it builds on knowledge you probably already have. It offers automatic dataclass mapping, stateless session management, and treats database views just like tables. By focusing on essential features and bypassing overcomplicated abstractions, it empowers developers to write clear, maintainable code without the usual ORM headaches.

My philosophy is that less is more. By shedding unnecessary layers of traditional ORMs, Naked SQLAlchemy provides a reliable, efficient, and straightforward approach to database access in Python. If you're looking for a tool that sidesteps common ORM pitfalls and leverages your existing SQL expertise, I invite you to explore Naked SQLAlchemy.

Hey! What do you think of this library? I'm open to any suggestion. Running out of idea what to implement.
Re: on Saturday May 11, 2024 @08:27AM (#40327657)
An asyncio-based scheduling framework designed for execution of periodic task with integrated support for dependency injection, enabling efficient and flexiable task management.

Remember, not only for schelduing, but it could be used by any other tools/library in python. Think of it as a neat framework for handling your tasks/functions.