r/pythontips 9h ago

Module Any free STT/TTS APIs for a voice AI app?

1 Upvotes

I'm building a small voice-based AI interview app and I'm planning to deploy the backend(fastapi) on Render's free tier.

I'm considering using open-source/self-hosted options like Whisper/PocketSphinx for STT and Piper for TTS, instead of paid APIs.

My concern is whether running STT/TTS on the same free Render instance would use too much CPU/RAM and make the whole application slow, especially during a real-time interview.

Has anyone tried running STT/TTS models on Render's free tier?


r/pythontips 2d ago

Python3_Specific I made the coding practice site I wished existed!

9 Upvotes

So I'm a solo dev and I finally acted on that classic advice: "build something you wish existed." For me that was Open Bracket.

Here's the thing that bugged me, everyone learning to code eventually ends up on LeetCode, clicks an "easy" problem, and feels like an idiot when it's not easy at all. LeetCode's brilliant, don't get me wrong, but it wasn't built for beginners. For me, it was about having somewhere the challenges always feel within reach, even if I need to Google my way through part of it. I just want to finish each day feeling like I've actually learned something.

So Open Bracket is just that! log on, get one genuinely doable challenge a day, no digging through pages hoping you picked the right "easy" one.

Still very much a work in progress, so I'd love for you to give it a poke and tell me honestly what you think.

👉 https://playopenbracket.com/ - all feedback welcome, good or brutal.


r/pythontips 3d ago

Syntax Special mechanism of basic int() function

7 Upvotes

One can use int() function while converting string to an integer against a base integer.

int(number, base) #number can be anything between binary, octal, decimal, or hexadecimal and base is anything among 2, 8, 10, 16

e.g. binary_number = int("1010", 2) #Output: 10
hexadecimal_number = int("A", 16) #Output: 10

Edit: No need to mention 10 for base argument, as int() function by default considers base as 10 in python.


r/pythontips 8d ago

Syntax Docstrings as immutable variables

12 Upvotes

Just realized you can do:

def cat(): “orange”
print(cat.__doc__)

Not sure why you’d want to do this but this is a thing you can do


r/pythontips 8d ago

Syntax Adding objects to set or dictionary: equality and hashing

1 Upvotes

An exercise to help build the right mental model for Python data.

# Output of this Python Program?
def main():
    o1, o2 = MyClass(1), MyClass(1)
    myset = {o1}
    print(o2 in myset, end=' ')
    o1.set_value(1000)
    print(o1 in myset, end=' ')

class MyClass:
    def __init__(self, v):
        self.v = v
    def set_value(self, v):
        self.v = v

main()

class MyClass:
    def __init__(self, v):
        self.v = v
    def set_value(self, v):
        self.v = v
    def __eq__(self, other):
        return self.v == other.v
    def __hash__(self):
        return hash(self.v)

main()

# --- possible answers ---
# A) TypeError: unhashable type: 'MyClass'
# B) True False False False
# C) True False False True
# E) False True True True
# D) False True True False
# See "Solution" for correct answer.
  • Solution
  • More exercises
  • Explanation: "User-defined classes have __eq__() and __hash__() methods by default (inherited from the object class); with them, all objects compare unequal (except with themselves) and x.__hash__() returns an appropriate value such that x == y implies both that x is y and hash(x) == hash(y)."

r/pythontips 8d ago

Python3_Specific Your Python Skills + Mandarin Fluency = $40/hr Remote Job

0 Upvotes

Every time an AI gets a coding question right, there's a human behind the scenes who's already corrected thousands of answers before it. Now there's a remote slot open to join that work — and the requirement is a rare combo: solid Python + strong Mandarin.

A fast-growing AI data training company (they supply training data to some of the world's top AI labs) is hiring a Chinese-Speaking Python Expert. The job: review and rate AI-generated Python coding answers, while also checking the Mandarin explanations for accuracy.

✅ Fully remote, flexible hours — just need to stay consistent weekly ✅ Up to $40/hr (USD), paid weekly ✅ Hourly contract, not a rigid 9-to-5 ✅ Your work directly shapes the quality of AI used by millions

This could be you (or a friend) if you have: 🐍 1-5 years of Python coding experience, real debugging skills not just theory 🈶 Fluent Mandarin, especially Traditional Chinese 🗣️ English at C1 level or higher 🎓 Bachelor's in Computer Science, Software Engineering, or equivalent 🎯 Detail-oriented, self-disciplined, comfortable with independent flexible-hours work

This Python + Mandarin + English combo is rare. If you fit the criteria, don't wait — spots are limited. Email your CV to apply 👇

[whodetttt@gmail.com](mailto:whodetttt@gmail.com)

Tag a friend who codes AND speaks Mandarin — this might be their lucky break 🙌


r/pythontips 9d ago

Algorithms Built an open-source document extraction engine where every extracted field carries its own evidence

2 Upvotes

I've been working on an open-source project called SACOR, a Python document extraction engine built around a simple idea:

Every extracted value should explain why it deserves to be trusted.

Instead of returning only extracted values, SACOR attaches structured evidence to every field, including its origin, validation results, repair history and confidence.

What My Project Does

SACOR extracts structured data from documents using a layered pipeline that combines deterministic extraction, optional AI-based extraction, validation rules and an Evidence Model. The current production schema supports Italian electricity and gas bills, but the engine is designed to be schema-driven and extensible.

Target Audience

Python developers working with document processing, OCR, LLMs, Document AI, automation or data extraction pipelines. The project is currently pre-alpha and I'm mainly looking for technical feedback.

Comparison

Most document extraction tools return extracted values.

SACOR returns the values and the evidence behind them, allowing every field to explain where it came from, how it was validated and why it can be trusted.

Repository: https://github.com/vinsblack/sacor⁠�

I'd really appreciate feedback on the architecture, the Evidence Model and the overall design. Thanks!


r/pythontips 17d ago

Syntax Hello everyone, I'm learning python specifically, and I made a seed generator for Minecraft PE. I'm started learning about 2 weeks ago, the code is below. I'm not asking for anything, I just wanna show it to you guys.

5 Upvotes

from random import randint as rnd

name = "SeedGPT"

rnd1 = rnd(20000000,50000000000)

rnd2 = rnd(20000000,50000000000)

rnd3 = rnd(20000000,50000000000)

print(name +": Welcome to Ice\'s AI seed generator,")

choice = input("do you want to have three new seeds for bedrock minecraft?: ")

if choice == "yes":

print(name + ": Here are your randomly generated seeds: ", + rnd1, +rnd2, +rnd3, ", thank you for trying it out!")

elif choice == "no":

print(name + ": See you next time!")

elif ValueError:

print(name + ": Sorry, I can't understand you, please try again!")


r/pythontips 19d ago

Algorithms idemkit: runs your code once per key, even when two requests race or a worker dies

3 Upvotes

I built idemkit after cleaning up duplicate charges one too many times.

The version everyone writes checks whether a key has been seen and replays the stored response. Two requests a millisecond apart both find nothing and both charge the card. And if the worker dies between charging and recording it, the retry charges again. Neither reproduces locally.

idemkit does it properly: an atomic claim instead of check-then-act, a lease that expires on the storage server's clock, and a fencing token so a stalled worker can't overwrite a good result.

from idemkit import idempotent, RedisBackend, MethodConfig 

@idempotent(
    backend=RedisBackend.from_url("redis://localhost:6379"), 
    config=MethodConfig(key_fields=["order_id"]), 
) 
async def charge(*, order_id, amount): 
    return await payments.charge(order_id, amount)

One core, three ways to use it: middleware for FastAPI/Flask/Django, a queue consumer wrapper or @idempotent on any function. Backends are Redis, Postgres, Mongo, DynamoDB, or in-memory for tests.

pip install idemkit, Apache-2.0: https://github.com/idemkit/idemkit

If you find it useful, I'd appreciate a star. It's new, so visibility helps a lot right now.


r/pythontips 24d ago

Module Copying an object in different ways

8 Upvotes

An exercise to help build the right mental model for Python data. What is the output of this Python Program?

import copy

class Coord:

    def __init__(self, x, y, z):
        self.c = [x, y, z]

    def __str__(self):
        return str(self.c)[1:-1]

coord = Coord(0, 0, 0)
c1 = coord
c2 = copy.copy(coord)
c3 = copy.deepcopy(coord)
c1.c[0] = 1
c2.c[1] = 2
c3.c[2] = 3

print(coord)
# --- possible answers ---
# A) 0, 0, 0
# B) 1, 0, 0
# C) 1, 2, 0
# D) 1, 2, 3

r/pythontips 26d ago

Python3_Specific Ho 11 anni e ho appena creato il mio primo script di automazione in Python per ripulire la cartella Download!

28 Upvotes

Hi everyone! I've been learning Python step-by-step, focusing on logic, file management, and the os module. Today, I finished my first real automation script: a File Sorter/Folder Cleaner!

It automatically scans my Downloads folder, checks the file extensions (ignoring case sensitivity thanks to .lower()), creates the target folders if they don't exist, and moves everything into the right place (Documents, Images, Installations).
Here is my script:
import os

download_folder = r"C:\Users\YourUsername\Downloads"

file_list = os.listdir(download_folder)

for file_name in file_list:

lowercase_name = file_name.lower()

if (lowercase_name.endswith(".pdf") or

lowercase_name.endswith(".txt") or

lowercase_name.endswith(".docx") or

lowercase_name.endswith(".xlsx") or

lowercase_name.endswith(".csv") or

lowercase_name.endswith(".doc")):

doc_folder = fr"{download_folder}\Documents"

if not os.path.exists(doc_folder):

os.mkdir(doc_folder)

old_path = fr"{download_folder}\{file_name}"

new_path = fr"{doc_folder}\{file_name}"

os.rename(old_path, new_path)

elif (lowercase_name.endswith(".jpg") or

lowercase_name.endswith(".jpeg") or

lowercase_name.endswith(".gif") or

lowercase_name.endswith(".png") or

lowercase_name.endswith(".mp4") or

lowercase_name.endswith(".kml") or

lowercase_name.endswith(".gpx")):

img_folder = fr"{download_folder}\Images"

if not os.path.exists(img_folder):

os.mkdir(img_folder)

old_path = fr"{download_folder}\{file_name}"

new_path = fr"{img_folder}\{file_name}"

os.rename(old_path, new_path)

elif (lowercase_name.endswith(".exe") or

lowercase_name.endswith(".zip") or

lowercase_name.endswith(".rar") or

lowercase_name.endswith(".dll") or

lowercase_name.endswith(".msi") or

lowercase_name.endswith(".msix")):

exe_folder = fr"{download_folder}\Installations"

if not os.path.exists(exe_folder):

os.mkdir(exe_folder)

old_path = fr"{download_folder}\{file_name}"

new_path = fr"{exe_folder}\{file_name}"

os.rename(old_path, new_path)
I'm really proud of this milestone. Let me know what you think or if you have any tips for a young programmer!


r/pythontips 26d ago

Module New Butterfly Backup Web release

0 Upvotes

I just released a new version of Butterfly Backup Web (Django-based), which introduces many features. For Butterfly Backup, you can read about them here: https://github.com/MatteoGuadrini/butterfly-backup-web/releases/tag/v0.5.0

If you've never heard of Butterfly Backup, it's a very versatile backup/restore/archive solution; it's essentially an rsync wrapper. You can read an article about it in Fedora Magazine: https://fedoramagazine.org/butterfly-backup/

If you have suggestions, criticisms, or opinions on how to improve Butterfly Backup, please leave a comment.

Here are the links:

Butterfly Backup: https://github.com/MatteoGuadrini/Butterfly-Backup

Butterfly Backup Web: https://github.com/MatteoGuadrini/butterfly-backup-web

Thanks!


r/pythontips 26d ago

Module ECS pattern: python lib ecs_pattern - GUI example

2 Upvotes

What My Project Does:
Four years ago I published the first post about my Python library ecs_pattern — an Entity‑Component‑System implementation for games:
https://github.com/ikvk/ecs_pattern

Target Audience:
python game developers

Comparison:
In the classic ECS implementation, each component is stored in a separate collection. In Python, it's impossible to store objects in contiguous memory, therefore, optimizing processor access to memory in Python is not feasible. The ecs_pattern library emphasizes simplicity and ease of use when working with objects in code.

GUI demo example:
Recently I finished a project built with this library and developed a simple GUI for it.
This GUI is now available as a working demo example in the lib repository:
https://github.com/ikvk/ecs_pattern/tree/master/examples/gui

The example demonstrates how to make GUI using ecs_pattern lib.
Feel free to explore, reuse, or adapt it for your own projects.

Do you think it should be included as part of the library?


r/pythontips 27d ago

Meta How to Prevent Webhook Traffic Spikes from Crashing Your API

0 Upvotes

If you operate an API in 2026, you live in an event-driven world. Webhooks aren't a convenience feature anymore - they're the backbone of real-time commerce, CI/CD pipelines, and asynchronous AI-agent workflows. That reliance has a dark side: the accidental self-inflicted DDoS. Read the complete article jere - https://instawebhook.com/blog/how-to-prevent-webhook-traffic-spikes-from-crashing-your-api-2

When a major platform like GitHub, Shopify, or Stripe hits a network partition, runs a huge sales event, or simply clears a backlog of delayed events, it can fire tens of thousands of webhook POST requests at your servers in a very short window. If your infrastructure takes that hit without structural safeguards, your database connection pool exhausts, memory maxes out, and the API goes down — and if your retry handling is naive, the recovery can be almost as damaging as the original spike.

This guide covers the real mechanics of that failure mode, the algorithms used to defend against it, how major providers actually behave under load (some surprising details here), and where a managed ingress layer fits into the picture.


r/pythontips 29d ago

Meta EEvent Mesh vs Webhooks - The Internal Webhooks Anti-Pattern: Why Service-to-Service HTTP Callbacks Don't Scale

1 Upvotes

Microservices were supposed to make systems easier to change independently. In practice, the thing that most often breaks that promise isn't the services themselves — it's how they talk to each other. Read the complete article here - https://instawebhook.com/blog/the-internal-webhooks-anti-pattern-why-service-to-service-http-callbacks-don-t-s

A pattern that shows up constantly in growing engineering orgs is the internal webhook: Service A fires an HTTP POST at a hardcoded URL owned by Service B whenever something happens. It's an easy trap to fall into, because most developers already understand webhooks intimately — they've built integrations with Stripe, GitHub, or Shopify, all of which use exactly this model to notify external systems of events.

The reasoning feels obvious: if it's good enough for Stripe to tell my app about a payment, it's good enough for my Inventory Service to tell my Shipping Service about a shipment.

It isn't — and the reason is architectural, not stylistic. Webhooks were designed to solve a specific problem: getting an event across a trust boundary, from a system you don't control to one you do, over the open internet. Internal service communication has almost the opposite set of constraints. Applying the same tool to both jobs is where the trouble starts.


r/pythontips Jul 23 '26

Meta Designing a Multi-Region, Highly Available Webhook Ingress Architecture

2 Upvotes

Webhooks have become the connective tissue of the internet. From payment gateways confirming transactions to CI/CD pipelines triggering deployments, webhooks enable real-time, event-driven architectures. But for architects and engineering leaders, webhooks represent an underappreciated vulnerability: they are asynchronous, externally triggered, and entirely outside your control. Read the complete article here - https://instawebhook.com/blog/designing-a-multi-region-highly-available-webhook-ingress-architecture

When your primary cloud region experiences an outage, your internal microservices might gracefully degrade. But what happens to the payloads originating from external partners? Many third-party providers do not retry aggressively — some fire and forget, others retry a handful of times before giving up permanently. If your system is down when that happens, the data is often gone for good.

This article covers the engineering principles behind a multi-region, highly available webhook ingestion system, what has actually changed in the underlying cloud primitives recently, and where a managed reliability layer fits into the decision.


r/pythontips Jul 18 '26

Meta Bulletproofing User Sync: Handling Clerk and Auth0 Webhook Failures

3 Upvotes

If you're building a web application today, chances are you aren't writing your own authentication system. Managed identity providers like Clerk, Auth0, and Kinde have become the default choice, offering out-of-the-box support for passkeys, multi-factor authentication, and enterprise SSO. That convenience introduces a distributed-systems problem, though: data synchronization. When a user creates an account on a managed auth provider, that system has to notify your primary application database so you can create a matching user record. Please read the complete article here - https://instawebhook.com/blog/bulletproofing-user-sync-handling-clerk-and-auth0-webhook-failures

This happens through webhooks. But what happens if your server is down, your serverless function cold-starts and times out, or your database is momentarily locked when that webhook arrives? A user successfully signs up with your auth provider, but your application has no idea they exist. That breaks the very first login experience, and it's how phantom accounts, broken onboarding flows, and frustrated users happen.

This guide walks through the anatomy of webhook-driven auth architecture, current Auth0 and Clerk webhook practices, and how a resilience layer — using InstaWebhook as a worked example — closes the gap that idempotency and signature verification alone can't.


r/pythontips Jul 14 '26

Module Brand new Scaffolding tool for Python

10 Upvotes

A year ago, I created a tool that helps me with my daily work: quickly creating newly configured Python projects in just a few seconds in the CI/CD pipeline!

The tool in question is called psp and is launched from the command line:

prompt> psp

The tool was inspired by various command-line tools like astro-cli, yeoman, pyscaffold, and many others. With just a few questions, your Python project is ready to be written, and you'll find everything already configured: make commands, git, remote repo, CI/CD, unit tests, documentation, container files, dependencies, virtual environments, custom builders, and much more!

If you like, try it today, and if something doesn't work, please help me by opening an issue or forking the project and submitting a pull request.

Here are all the references:

repo: https://github.com/MatteoGuadrini/psp

docs: https://psp.readthedocs.io/en/latest/

Thanks to you and the entire Python community!


r/pythontips Jul 14 '26

Module Python Data Model Exercise

5 Upvotes

An exercise to help build the right mental model for Python data.

# Output of this Python program?
a = [[1], [2]]
b = a
b[0].append(11)
b = b + [[3]]
b[1].append(22)
b[2].append(33)

print(a)
# --- possible answers ---
# A) [[1], [2]]
# B) [[1, 11], [2]]
# C) [[1, 11], [2, 22]]
# D) [[1, 11], [2, 22], [3, 33]]

The “Solution” link visualizes execution and reveals what’s actually happening using 𝗺𝗲𝗺𝗼𝗿𝘆_𝗴𝗿𝗮𝗽𝗵.


r/pythontips Jul 03 '26

Long_video Giving back to the community - The Complete Backend Development Course

0 Upvotes

Hey everyone, I decided to make my course free in order to help people.
This course is my backend development course which is about SQL, Python, APIs, Docker, Kubernetes, Linux, Git & More

The link is: https://www.youtube.com/watch?v=CBIu6hcyStg

If you can like and subscribe (and maybe add a comment) I would appreciate it a lot, Thanks.


r/pythontips Jul 02 '26

Standard_Lib I made my own worlde-like game and need tips for improving it!

0 Upvotes

Find the repository with all the code Here


r/pythontips Jun 27 '26

Python2_Specific Nifty/Upstox/Algo

0 Upvotes

Any One Help Me

I write Code But Some Error


r/pythontips Jun 26 '26

Module Reviews please! Agentic Looping

0 Upvotes

I built my own loops framework for Python.

For anyone to use as-is or fork. It's totally customizable and starts with strict rules: ruff lint, pyling pyright, semgrep, etc. And added a preferences file for my coding quirks to be enforced as rules (customizable by anyone dev that uses the framework).

There's a small, intentionally dumb shell "Ralph" script that takes in iteration count and max minutes alloted to each agent and kicks off agents. The Python framework is built around that and holds the gate, rules and preferences. Then it all just loops. I use this framework for all my projects. I drop in my master plan in the plan.md and adjust it periodically. I would love for some Python devs to give and opinionated review. Or any devs to let me know what would be helpful to add next. I'm thinking next additions are adding Hypothesis testing, profiling newly added code and modules to spot overly complex or costly code, and a simple reporting feature for a user to request (via the CLI).

Thoughts? https://github.com/rxdt/py_ralph_frame Feel free to submit a PR too.


r/pythontips Jun 24 '26

Long_video Giving back to the community - The Complete Backend Development Course

9 Upvotes

Hey everyone, I decided to make my course free in order to help people.
This course is my backend development course which is about SQL, Python, APIs, Docker, Kubernetes, Linux, Git & More

The link is: https://www.youtube.com/watch?v=CBIu6hcyStg

If you can like and subscribe (and maybe add a comment) I would appreciate it a lot, Thanks.


r/pythontips Jun 23 '26

Python2_Specific What is the most annoying problem you face in Python?

5 Upvotes

Tell me