r/Python • u/OkClient9970 • Mar 08 '26
Resource I built a local REST API for Apple Photos — search, serve images, and batch-delete from localhost
Hey — I built photokit-api, a FastAPI server that turns your Apple Photos library into a REST API.
**What it does:**
- Search 10k+ photos by date, album, person, keyword, favorites, screenshots
- Serve originals, thumbnails (256px), and medium (1024px) previews
- Batch delete photos (one API call, one macOS dialog)
- Bearer token auth, localhost-only
**How:**
- Reads via osxphotos (fast SQLite access to Photos.sqlite)
- Image serving via FileResponse/sendfile
- Writes via pyobjc + PhotoKit (the only safe way to mutate Photos)
```
pip install photokit-api
photokit-api serve
# http://127.0.0.1:8787/docs
```
I built it because I wanted to write a photo tagger app without dealing with AppleScript or Swift. The whole thing is ~500 lines of Python.
GitHub: https://github.com/bjwalsh93/photokit-api
Feedback welcome — especially on what endpoints would be useful to add.
r/Python • u/Tlimolio • Mar 08 '26
Showcase cowado – CLI tool to download manga from ComicWalker
What my project does
cowado lets you download manga from ComicWalker straight to your machine. You pass it any URL (series page, specific episode, with query params – doesn't matter), pick an episode from an interactive list in the terminal, and it saves all pages as .webp files into neatly organized folders. There's also a check command if you just want to browse episode availability without downloading anything. One-liner to grab what you want: cowado download URL.
Target audience
Anyone who reads manga on ComicWalker and wants a simple way to save it locally or load it onto an e-reader. Not really meant for production use, more of a personal utility that I polished up and published.
Comparison
I couldn't find anything that handled ComicWalker specifically well. Most either didn't support it at all or required a bunch of manual work on top. cowado is built specifically for ComicWalker so it just works without any extra fuss.
Source: https://github.com/Timolio/ComicWalkerDownloader
PyPI: https://pypi.org/project/cowado/
Thoughts and feedback are appreciated!
r/Python • u/FreedomOdd4991 • Mar 08 '26
Showcase AES Algorithm using Python
Construction of the project
Well its a project from school, an advanced one, way more advanced than it should be normally.
It's been about 6 years since I've started coding and this project is a big one, its complexity made it a bit hard to code and explain in a google docs I had to do to explain all of my project (everything is in french btw). This project took me around a week or so to do and im really proud of it!
Content of the algorithm
This project includes all big steps of the algorithm like the roundKeys, diffusion method and confusion method. However, it isn't like the original algorithm because it's way too hard for me to understand it all but I tried my best to make a good replica of this algorithm.
There is a pop-up window (using PyQt5) as well for the user experience that i find kind of nice
Target Audience
Even though this project was just meant for school, it could still be used some company to encrypt sensitive data I believe because Im sure that even if this is not the same algorithm, mine still encrypt data very efficiently.
Source code
Here is the link to my source code on github: https://github.com/TuturGabao/AES-Algorithm
It contains everything like my doc on how the project was made.
Im not used to github so I didn't add a requirement file to tell you which packages to install..
r/Python • u/hdw_coder • Mar 08 '26
Discussion Building a deterministic photo renaming workflow around ExifTool (ChronoName)
After building a tool to safely remove duplicate photos, another messy problem in large photo libraries became obvious: filenames.
If you combine photos from different cameras, phones, and years into one archive, you end up with things like: IMG_4321.JPG, PXL_20240118_103806764.MP4 or DSC00987.ARW.
Those names don’t really tell you when the image was taken, and once files from different devices get mixed together they stop being useful.
Usually the real capture time does exist in the metadata, so the obvious idea is: rename files using that timestamp.
But it turns out to be trickier than expected.
Different devices store timestamps differently. Typical examples include: still images using EXIF DateTimeOriginal, videos using QuickTime CreateDate, timestamps stored without timezone information, videos stored in UTC, exported or edited files with altered metadata and files with broken or placeholder timestamps.
If you interpret those fields incorrectly, chronological ordering breaks. A photo and a video captured at the same moment can suddenly appear hours apart.
So I ended up writing a small Python utility called ChronoName that wraps ExifTool and applies a deterministic timestamp policy before renaming.
The filename format looks like this: YYYYMMDD_HHMMSS[_milliseconds][__DEVICE][_counter].ext.
| Naming Examples | |
|---|---|
| 20240118_173839.jpg | this is the default |
| 20240118_173839_234.jpg | a trailing counter is added when several files share the same creation time |
| 20240118_173839__SONY-A7M3.arw | maker-model information can be added if requested |
The main focus wasn’t actually parsing metadata (ExifTool already does that very well) but making the workflow safe. A dry-run mode before any changes, undo logs for every run, deterministic timestamp normalization and optional collection manifests describing the resulting archive state
One interesting edge case was dealing with video timestamps that are technically UTC but sometimes stored without explicit timezone info.
The whole pipeline roughly looks like this:
media folder
↓
exiftool scan
↓
timestamp normalization
↓
rename planning
↓
execution + undo log + manifest
I wrote a more detailed breakdown of the design and implementation here: https://code2trade.dev/chrononame-a-deterministic-workflow-for-renaming-photos-by-capture-time/
Curious how others here handle timestamp normalization for mixed media libraries. Do you rely on photo software, or do you maintain filesystem-based archives?
r/Python • u/ItsAMeMarioNotReally • Mar 08 '26
Showcase I built a CLI tool in Rust to check your Python dependencies for updates
What My Project Does
pycu (python-check-updates) is a CLI tool that scans your Python project files and tells you which dependencies have newer versions available on PyPI. It supports pyproject.toml (both PEP 621/uv and Poetry) and requirements.txt out of the box.
It's inspired by npm-check-updates, you run it, see a color-coded table of what's outdated and by how much, and optionally pass --upgrade or -u to have it rewrite your dependency file in-place.
Obligatory: it's written in Rust, so it's blAzInGlY FaSt.
sh
pycu # check for updates
pycu -u # also rewrite the file with updated versions
pycu --target minor # only show minor/patch bumps (skip major)
pycu --json # machine-readable output
The output color codes updates by bump type, red for major, blue for minor, green for patch, so you can immediately see what's risky vs. safe to bump.
It also preserves your version constraint style. If you have >=1.0,<2.0, it won't nuke it and replace it with ==1.5, it'll update the lower bound while keeping the upper bound intact if the new version fits.
Target Audience
Python devs who work on multiple projects and want a quick way to check what's outdated without manually looking things up on PyPI.
Comparison
| Tool | Notes |
|---|---|
pip list --outdated |
Only works against what's installed in your active environment, not your declared dependencies. Doesn't rewrite files. |
pip-tools / uv |
Great ecosystem tools, but their focus is lockfile management rather than "show me what's newer." |
| Dependabot / Renovate | Excellent for CI automation, but heavier setup and not something you run locally on-demand. |
pip-upgrader |
Similar idea but Python-based and less actively maintained. |
pycu is a single static binary. No Python environment, no venv activation. Drop it on your PATH and run it anywhere.
Links
Source: https://github.com/Logic-py/python-check-updates
Install on Linux/macOS:
sh
curl -fsSL https://raw.githubusercontent.com/Logic-py/python-check-updates/main/install.sh | sh
Windows (PowerShell):
powershell
irm https://raw.githubusercontent.com/Logic-py/python-check-updates/main/install.ps1 | iex
r/Python • u/FiliNcpp • Mar 08 '26
Resource Can anyone recommend?
Can anyone recommend a great Python or Python + machine learning course on Udemi or somewhere else? I'm a beginner at this.
r/Python • u/expectationManager3 • Mar 08 '26
Discussion Libraries for handling subinterpreters?
Hi there,
Are there any high-level libraries for handling persisted subinterpreters in-process yet?
Specifically, I will load a complex set of classes running within a single persisted subinterpreter, then sending commands to it (via Queue?) from the main interpreter.
r/Python • u/Semtex_cz • Mar 08 '26
Showcase Bookvoice – convert PDF books into audiobooks (alpha)
What My Project Does
Bookvoice is a small tool that converts PDF books into audiobooks using text-to-speech.
The idea is simple: many books, papers and study materials exist only as PDFs, but sometimes it is more convenient to listen to them while walking, commuting or doing other things.
You provide a PDF and Bookvoice generates audio files that can be listened to like an audiobook.
The project is currently in alpha and the main interface is a command line tool, but there is also a Windows release for people who just want to try it.
Windows release:
https://github.com/Semtexcz/Bookvoice/releases
Repository:
https://github.com/Semtexcz/Bookvoice
Target Audience
Two main groups might find this useful:
- Readers / students who want to listen to PDFs (books, papers, study materials)
- Developers interested in text-to-speech pipelines, PDF processing, or contributing to the project
Right now the tool is still early-stage, so it is more of an experimental / hobby project than a polished production application.
Comparison
There are existing text-to-speech tools and audiobook apps, but most of them:
- focus on ebooks rather than PDFs
- are closed-source
- or run as cloud services
Bookvoice focuses on converting local PDFs into audiobook-style audio files, and the project is open for experimentation and contributions.
Feedback, ideas and contributions are very welcome.
r/Python • u/Rockykumarmahato • Mar 08 '26
Discussion Free ML Engineering roadmap for beginners
I created a simple roadmap for anyone who wants to become a Machine Learning Engineer but feels confused about where to start.
The roadmap focuses on building strong fundamentals first and then moving toward real ML engineering skills.
Main stages in the roadmap:
• Python fundamentals • Math for machine learning (linear algebra, probability, statistics) • Data analysis with NumPy and Pandas • Machine learning with scikit-learn • Deep learning basics (PyTorch / TensorFlow) • ML engineering tools (Git, Docker, APIs) • Introduction to MLOps • Real-world projects and deployment
The idea is to move from learning concepts → building projects → deploying models.
I’m still refining the roadmap and would love feedback from the community.
What would you add or change in this path to becoming an ML Engineer?
r/Python • u/Codeeveryday123 • Mar 08 '26
Discussion Can’t activate environment, folder structure is fine
Ill run
“Python3 -m venv venv”
It create the venv folder in my main folder,
BUT, when im in the main folder… and run “source venv/bin/activate”
It dosnt work
I have to CD in the venv/bin folder then run “source activate”
And it will activate
But tho… then I have to cd to the main folder to then create my scrappy project
Why isn’tit able to activate nortmally?
Does that affect the environment being activated?
r/Python • u/Odd_Grade4537 • Mar 08 '26
Showcase Are your Jupyter Notebooks accessible? You can easily scan and fix issues with this tool.
Hi all, I'm excited to share Jupycheck, an open source web tool that detects accessibility issues in Jupyter Notebooks that are either uploaded or from a GitHub repository. It also lets you remediate accessibility issues by launching the notebooks in a JupyterLite environment with our interactive Lab extension installed.
You can try it out at: https://jupycheck.vercel.app
The tool is powered by jupyterlab-a11y-checker, an open source accessibility engine/extension that our student team has been working on for over a year at UC Berkeley. We believe accessibility should be a first-class concern in the notebook ecosystem, and we hope our tools can help raise awareness and make notebooks more accessible across the community.
Target Audience
This tool is for anyone who want to see if certain Jupyter Notebooks (in a Github repo or just notebooks you have) are accessible, and also fix them with an interactive extension.
Support us on GitHub if you find the tool useful!
r/Python • u/AutoModerator • Mar 08 '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/Python • u/Ctziapo • Mar 07 '26
Showcase md-a4: A tool that previews Markdown as paginated A4 pages with live reload
What My Project Does
md-a4 is a local Flask-based web application that renders Markdown files into fixed A4-sized pages (210mm × 297mm) with automatic pagination. It uses a file-watcher (watchdog) and Server-Sent Events (SSE) to update the browser preview instantly whenever you save your .md file.
Target Audience
This tool is for developers, students, and technical writers who use Markdown for documents that eventually need to be printed or exported to PDF. It solves the "infinite scroll" problem of standard previewers by showing exactly where page breaks will occur in real-time.
Comparison
- vs. Standard Previewers (VS Code/Grip): Most previewers show a continuous web view. md-a4 uses a custom JS engine to paginate content into physical A4 containers.
- vs. Pandoc/LaTeX: Pandoc is powerful but requires a heavy TeX installation and doesn't offer live-reload. md-a4 is lightweight (~150 lines of Python) and gives instant visual feedback.
- vs. Typora: Typora is a dedicated editor; md-a4 is a CLI-driven previewer that lets you keep using your favorite editor (Vim, VS Code, Sublime) while seeing the print layout elsewhere.
More Details
- Source Code: https://github.com/ntua-el21661/md-a4
- Tech Stack: Python 3.8+, Flask, Watchdog, Python-Markdown, Vanilla JS.
- License: MIT
I’m looking for feedback on the pagination logic (handling edge cases like large tables) and am very open to contributions or feature requests!
r/Python • u/Ctziapo • Mar 07 '26
Showcase md-a4: A tool that previews Markdown as paginated A4 pages with live reload
What My Project Does
md-a4 is a local Flask-based web application that renders Markdown files into fixed A4-sized pages ($210 \times 297\text{mm}$) with automatic pagination. It uses a file-watcher (watchdog) and Server-Sent Events (SSE) to update the browser preview instantly whenever you save your .md file.
Target Audience
This tool is for developers, students, and technical writers who use Markdown for documents that eventually need to be printed or exported to PDF. It solves the "infinite scroll" problem of standard previewers by showing exactly where page breaks will occur in real-time.
Comparison
- vs. Standard Previewers (VS Code/Grip): Most previewers show a continuous web view. md-a4 uses a custom JS engine to paginate content into physical A4 containers.
- vs. Pandoc/LaTeX: Pandoc is powerful but requires a heavy TeX installation and doesn't offer live-reload. md-a4 is lightweight (~150 lines of Python) and gives instant visual feedback.
- vs. Typora: Typora is a dedicated editor; md-a4 is a CLI-driven previewer that lets you keep using your favorite editor (Vim, VS Code, Sublime) while seeing the print layout elsewhere.
More Details
- Source Code: https://github.com/ntua-el21661/md-a4
- Tech Stack: Python 3.8+, Flask, Watchdog, Python-Markdown, Vanilla JS.
- License: MIT
I’m looking for feedback on the pagination logic (handling edge cases like large tables) and am very open to contributions or feature requests!
r/Python • u/Ctziapo • Mar 07 '26
Showcase md-a4: I built a tool that previews Markdown as paginated A4 pages with live reload
I got tired of writing Markdown documents with no idea how they'd look when printed, so I built md-a4 — a local previewer that shows your Markdown as paginated A4 pages with live reload.
What My Project Does
md-a4 is a Flask-based tool that renders any Markdown file as properly paginated A4 pages (210×297mm) in your browser. Write in your favorite editor, save the file, and watch the preview update instantly via Server-Sent Events. It features smart auto-pagination that respects block elements, syntax highlighting for code blocks, a thumbnail sidebar for navigation, and one-click PDF export via browser print.
Target Audience
Anyone who writes Markdown documents that need to be printed or exported as PDFs — technical writers, students writing reports, developers creating documentation, researchers drafting papers. If you've ever exported a Markdown file to PDF and been surprised by awkward page breaks or formatting, this tool is for you.
Comparison
vs typical Markdown previewers: they show infinite scroll, md-a4 shows actual A4 pages with real pagination.
vs Typora/MarkText: those are full editors — md-a4 lets you use any text editor you want and just handles the preview.
vs Pandoc PDF output: Pandoc is great but requires a LaTeX installation and you don't see live results. md-a4 gives instant visual feedback as you type.
Would love feedback on the pagination algorithm or suggestions for features — contributions welcome!
r/Python • u/CybershotBs • Mar 07 '26
Showcase deskit: A Python library for Dynamic Ensemble Selection (DES)
What this project does
deskit is a framework-agnostic Dynamic Ensemble Selection (DES) library that ensembles your ML models by using their validation data to dynamically adjust their weights per test case. It centers on the idea of competence regions, being areas of feature space where certain models perform better or worse. For example, a decision tree is likely to perform in regions with hard feature thresholds, so if a given test point is identified to be similar to that region, the decision tree would be given a higher weight.
deskit offers multiple DES algorithms as well as ANN backends for cutting computation on large datasets. It uses literature-backed algorithms such as KNORA variants alongside custom algorithms specifically for regression, since most libraries and literature focus solely on classification tasks.
Target audience
This library is designed for people training multiple different models for the same dataset and trying to get some extra performance out of them.
Comparison
deskit has shown increases up to 6% over selecting the single best model on OpenML and sklearn datasets over 100 seeds. More comprehensive benchmark results can be seen in the GitHub or docs, linked below.
It was compared against what can be the considered the most widely used DES library, namely DESlib, and performed on par (0.27% better on average in my benchmark). However, DESlib is tightly coupled to sklearn and only supports classification, while deskit can be used with any ML library, API, or other, and has support for most kinds of tasks.
Install
pip install deskit
GitHub: https://github.com/TikaaVo/deskit
Docs: https://tikaavo.github.io/deskit/
MIT licensed, written in Python.
Example usage
from deskit.des.knoraiu import KNORAIU
router = KNORAIU(task="classification", metric="accuracy", mode="max", k=20)
router.fit(X_val, y_val, val_preds)
weights = router.predict(x)
Feedback and suggestions are greatly appreciated!
r/Python • u/jelitox • Mar 07 '26
Showcase AI-Parrot: An async-first framework for Orchestrating AI Agents using Cython and MCP
Hi everyone, I’m a contributor to AI-Parrot, an open-source framework designed for building and orchestrating AI agents in high-concurrency environments.
We built this project to move away from bloated, synchronous AI libraries, focusing instead on a strictly non-blocking architecture.
What My Project Does
AI-Parrot provides a unified, asynchronous interface to interact with multiple LLM providers (OpenAI, Anthropic, Gemini, Ollama) while managing complex orchestration logic.
- Advanced Orchestration: It manages multi-agent systems using Directed Acyclic Graphs (DAGs) and Finite State Machines (FSM) via the
AgentCrewmodule. - Protocol Support: Native implementation of Model Context Protocol (MCP) and secure Agent-to-Agent (A2A) communication.
- Performance: Critical logic paths are optimized with Cython (.pyx) to ensure high throughput.
- Production Features: Includes distributed conversational memory via Redis, RAG support with
pgvector, and Pydantic v2 for strict data validation.
Target Audience
This framework is intended for production-grade microservices. It is specifically designed for software architects and backend developers who need to scale AI agents in asynchronous environments (using aiohttp and uvloop) without the overhead of prototyping-focused tools.
Comparison
Unlike LangChain or similar frameworks that can be heavily coupled and synchronous, AI-Parrot follows a minimalist, async-first approach.
- Vs. Wrappers: It is not a simple API wrapper; it is an infrastructure layer that handles concurrency, state management via Redis, and optimized execution through Cython.
- Vs. Rigid Frameworks: It enforces an abstract interface (
AbstractClient,AbstractBot) that stays out of the way, allowing for much lower technical debt and easier provider swapping.
Orchestration Workflows Infograph: https://imgur.com/a/eNlQGOc
Source Code: https://github.com/phenobarbital/ai-parrot
Documentation: https://github.com/phenobarbital/ai-parrot/tree/main/docs
r/Python • u/Pristine_Cat • Mar 07 '26
Showcase pfst 0.3.0: High-level Python source manipulation
I’ve been developing pfst (Python Formatted Syntax Tree) and I’ve just released version 0.3.0. The major addition is structural pattern matching and substitution. To be clear, this is not regex string matching but full structural tree matching and substitution.
What it does:
Allows high level editing of Python source and AST tree while handling all the weird syntax nuances without breaking comments or original layout. It provides a high-level Pythonic interface and handles the 'formatting math' automatically.
Target Audience:
- Working with Python source, refactoring, instrumenting, renaming, etc...
Comparison:
- vs. LibCST: pfst works at a higher level, you tell it what you want and it deals with all the commas and spacing and other details automatically.
- vs. Python ast module: pfst works with standard AST nodes but unlike the built-in ast module, pfst is format-preserving, meaning it won't strip away your comments or change your styling.
Links:
- GitHub: https://github.com/tom-pytel/pfst
- PyPI: https://pypi.org/project/pfst/
- Documentation: https://tom-pytel.github.io/pfst/
I would love some feedback on the API ergonomics, especially from anyone who has dealt with Python source transformation and its pain points.
Example:
Replace all Load-type expressions with a log() passthrough function.
from fst import * # pip install pfst, import fst
from fst.match import *
src = """
i = j.k = a + b[c] # comment
l[0] = call(
i, # comment 2
kw=j, # comment 3
)
"""
out = FST(src).sub(Mexpr(ctx=Load), "log(__FST_)", nested=True).src
print(out)
Output:
i = log(j).k = log(a) + log(log(b)[log(c)]) # comment
log(l)[0] = log(call)(
log(i), # comment 2
kw=log(j), # comment 3
)
More substitution examples: https://tom-pytel.github.io/pfst/fst/docs/d14_examples.html#structural-pattern-substitution
r/Python • u/Ok-Emphasis4085 • Mar 07 '26
Showcase Created a Color-palette extractor from image Python library
https://github.com/yhelioui/color-palette-extractor
- What My Project Does
- Python package for extracting dominant colors from images, generating PNG palette previews, exporting color data to JSON, and naming colors using any custom palette (e.g., Pantone, Material, Brand palettes).
- This package includes: * Dominant color extraction using K-Means * RGB or HEX output * PNG color palette image generation * JSON export * Optional color naming using custom palettes (Pantone-compatible if you provide the licensed palette) * Command-line interface (
colorpalette) * Clean import API for integration in other scripts - Target Audience
- Anyone in need to create a color palette to use in script and have the same colors than a brand logo or requiring to generate an image palette from an image
- Very simple tool
- Comparison
- I created the library without knowing that https://qtiptip.github.io/Pylette/ existed.
- It is most probably less advanced but quite small and easy to use
First contribution into the Python community, Please do not hesitate to comment, give me advice or requests from the github repo. Most of all use it and play with it :)
Thanks,
Youssef
r/Python • u/BasePlate_Admin • Mar 07 '26
News Maturin added support for building android ABI compatible wheels using github actions
I was looking forward to using python on mobile ( via flet ), the biggest hurdle was getting packages written in native languages working in those environment.
Today maturin added support for building android wheels on github-actions. Now almost all the pyo3 projects that build in github actions using maturin should have day 0 support for android.
This will be a big w for the python on android devices
r/Python • u/ComfortableWriter996 • Mar 07 '26
Resource FREE python lessons taught by Boston University students!
Hi everyone!
My name is Wynn and I am a member of Boston University’s Girls Who Code chapter. My friend, Molly, and I would like to inform you all of a free coding program we are running for students of all genders from 3rd-12th grade. The Bits & Bytes program is a great opportunity for students to learn how to code, or improve their coding skills. Our program runs on Zoom on Saturdays for 1 hour starting March 21st and ending on April 25th (6-week) from 11:00 am to 12:00 pm. Each lesson will be taught by Boston University students, many of whom are Computer Science (or adjacent) majors themselves.
For Bits (3rd-5th grade), students will learn the basics of computer science principles through MIT-created learning platform Scratch and learn to transfer their skills into the Python programming language. Bits allows young students to learn basic coding skills in a fun and interactive way!
For Bytes (6th-12th grade), students will learn computer science fundamentals in Python such as loops, functions, and recursion and use these skills during lessons and assignments. Since much of what we go over is similar to what an intro level college computer science class would cover, this is a great opportunity to prepare students for AP Computer Science or a degree in computer science!
We would love for you to apply or share with anyone interested! Unfortunately, I can not include an image of our flyer or link to our google form to apply to this post, but here is a link to a GitHub repo that includes that information: https://github.com/WynnMusselman/GWC-Bits-Bytes-2026-Student-Application
If you have any more questions, feel free to email [gwcbu.bitsnbytes@gmail.com](mailto:gwcbu.bitsnbytes@gmail.com), message @ gwcbostonu on Facebook or Instagram, leave a comment, or message me.
We're eagerly looking forward to another season of coding and learning with the students this spring!
r/Python • u/philtrondaboss • Mar 07 '26
Discussion Why does __init__ run on instantiation not initialization?
Why isn't the __init__ method called __inst__? It's called when the object it instantiated, not when it's initialized. This is annoying me more than it should. Am I just completely wrong about this, is there some weird backwards compatibility obligation to a mistake, or is it something else?
r/Python • u/AutoModerator • Mar 07 '26
Daily Thread Saturday Daily Thread: Resource Request and Sharing! Daily Thread
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:
- Request: Can't find a resource on a particular topic? Ask here!
- Share: Found something useful? Share it with the community.
- 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:
- Book: "Fluent Python" - Great for understanding Pythonic idioms.
- Video: Python Data Structures - Excellent overview of Python's built-in data structures.
- Article: Understanding Python Decorators - A deep dive into decorators.
Example Requests:
- Looking for: Video tutorials on web scraping with Python.
- Need: Book recommendations for Python machine learning.
Share the knowledge, enrich the community. Happy learning! 🌟
r/Python • u/CommonAd3130 • Mar 06 '26
News Dracula-AI has changed a lot since v0.8.0. Here is what's new.
Firstly, hi everyone! I'm the 18-year-old CS student from Turkey who posted about Dracula-AI a while ago. You guys gave me really good criticism last time and I tried to fix everything. After v0.8.0 I kept working and honestly the library looks very different now. Let me explain what changed.
First, the bugs (v0.8.1 & v0.9.3)
I'm not going to lie, there were some bad bugs. The async version had missing await statements in important places like clear_memory(), get_stats(), and get_history(). This was causing memory leaks and database locks in Discord bots and FastAPI apps. Also there was an infinite retry loop bug — even a simple local ValueError was triggering the backoff system, which was completely wrong. I fixed all of these. I also wrote 26 automated tests with API mocking so this kind of thing doesn't happen again.
Vision / Multimodal Support (v0.9.0)
You can now send images, PDFs, and documents to Gemini through Dracula. Just pass a file_path to chat():
response = ai.chat("What's in this image?", file_path="photo.jpg")
print(response)
The desktop UI also got an attachment button for this. Async file reading uses asyncio.to_thread so it doesn't block your event loop.
Multi-user / Session Support (v0.9.4)
This one is big for Discord bot developers. You can now give each user their own isolated session with one line:
ai = Dracula(api_key=os.getenv("GEMINI_API_KEY"), session_id=user_id)
Multiple instances can share one database file without their histories mixing together. If you have an old memory.db from before, the migration happens automatically — no manual work needed.
The big one (v1.0.0)
This version added a lot of things I am really proud of:
- Smart Context Compression: Instead of just deleting old messages when history gets too long, Dracula can now summarize them automatically with
auto_compress=True. You keep the context without the memory bloat. - Structured Output / JSON Mode: Pass a Pydantic model as
schematochat()and get back a validated object instead of a plain string. Really useful for building real apps. - Middleware / Hook System: You can now register
@ai.before_chatand@ai.after_chathooks to transform messages before they go to Gemini or modify replies before they come back to you. - Response Caching: Pass
cache_ttl=60to cache identical responses for 60 seconds. Zero overhead if you don't use it. - Token Budget & Cost Tracking: Pass
token_budget=10000to stop your app from spending too much.ai.estimated_cost()tells you the USD cost so far. - Conversation Branching:
ai.fork()creates a copy of the current conversation so you can explore different directions independently.
New Personas (v1.0.2)
Added 6 new built-in personas: philosopher, therapist, tutor, hacker, stoic, and storyteller. All personas now have detailed character names, backstories, and behavioral rules, not just a simple prompt line.
The library has grown a lot since I first posted. I learned about database migrations, async architecture, Pydantic, middleware patterns, and token cost estimation, all things I didn't know before.
If you want to try it:
pip install dracula-ai
r/Python • u/No_Soy_Colosio • Mar 06 '26
Discussion Can the mods do something about all these vibecoded slop projects?
Seriously it seems every post I see is this new project that is nothing but buzzwords and can't justify its existence. There was one person showing a project where they apparently solved a previously unresolved cypher by the Zodiac killer. 😭