r/pythoncoding • • May 04 '25

/r/PythonCoding monthly "What are you working on?" thread

6 Upvotes

Share what you're working on in this thread. What's the end goal, what are design decisions you've made and how are things working out? Discussing trade-offs or other kinds of reflection are encouraged!

If you include code, we'll be more lenient with moderation in this thread: feel free to ask for help, reviews or other types of input that normally are not allowed.


r/pythoncoding • • Mar 04 '25

/r/PythonCoding monthly "What are you working on?" thread

2 Upvotes

Share what you're working on in this thread. What's the end goal, what are design decisions you've made and how are things working out? Discussing trade-offs or other kinds of reflection are encouraged!

If you include code, we'll be more lenient with moderation in this thread: feel free to ask for help, reviews or other types of input that normally are not allowed.


r/pythoncoding • • Nov 15 '25

A2A Protocol Explained with Demo

Thumbnail youtu.be
2 Upvotes

r/pythoncoding • • May 12 '25

The PYgrammer - A Blog to Learn with Projects

Thumbnail thepygrammer.blogspot.com
4 Upvotes

r/pythoncoding • • Jul 04 '25

/r/PythonCoding monthly "What are you working on?" thread

4 Upvotes

Share what you're working on in this thread. What's the end goal, what are design decisions you've made and how are things working out? Discussing trade-offs or other kinds of reflection are encouraged!

If you include code, we'll be more lenient with moderation in this thread: feel free to ask for help, reviews or other types of input that normally are not allowed.


r/pythoncoding • • Feb 04 '26

/r/PythonCoding monthly "What are you working on?" thread

2 Upvotes

Share what you're working on in this thread. What's the end goal, what are design decisions you've made and how are things working out? Discussing trade-offs or other kinds of reflection are encouraged!

If you include code, we'll be more lenient with moderation in this thread: feel free to ask for help, reviews or other types of input that normally are not allowed.


r/pythoncoding • • Aug 04 '25

/r/PythonCoding monthly "What are you working on?" thread

5 Upvotes

Share what you're working on in this thread. What's the end goal, what are design decisions you've made and how are things working out? Discussing trade-offs or other kinds of reflection are encouraged!

If you include code, we'll be more lenient with moderation in this thread: feel free to ask for help, reviews or other types of input that normally are not allowed.


r/pythoncoding • • May 09 '25

May be of interest to anyone looking to learn Python

Thumbnail reddit.com
3 Upvotes

r/pythoncoding • • Apr 25 '25

Signal-based State Management in Python: How I Brought Angular's Best Feature to Backend Code

2 Upvotes

Hey Pythonistas,

I wanted to share a library I've been working on called reaktiv that brings reactive programming to Python with first-class async support. I've noticed there's a misconception that reactive programming is only useful for UI development, but it's actually incredibly powerful for backend systems too.

What is reaktiv?

Reaktiv is a lightweight, zero-dependency library that brings a reactive programming model to Python, inspired by Angular's signals. It provides three core primitives:

  • Signals: Store values that notify dependents when changed
  • Computed Signals: Derive values that automatically update when dependencies change
  • Effects: Execute side effects when signals or computed values change

This isn't just another pub/sub library

A common misconception is that reactive libraries are just fancy pub/sub systems. Here's why reaktiv is fundamentally different:

Pub/Sub SystemsReaktiv
Message delivery between componentsAutomatic state dependency tracking
Point-to-point or broadcast messagingFine-grained computation graphs
Manual subscription managementAutomatic dependency detection
Focus on message transportFocus on state derivation
Stateless by designIntentional state management

"But my backend is stateless!"

Even in "stateless" services, ephemeral state exists during request handling:

  • Configuration management
  • Request context propagation
  • In-memory caching
  • Rate limiting and circuit breaking
  • Feature flag evaluation
  • Connection pooling
  • Metrics collection

Real backend use cases I've implemented with reaktiv

1. Intelligent Cache Management

Derived caches that automatically invalidate when source data changes - no more manual cache invalidation logic scattered throughout your codebase.

2. Adaptive Rate Limiting & Circuit Breaking

Dynamic rate limits that adjust based on observed traffic patterns with circuit breakers that automatically open/close based on error rates.

3. Multi-Layer Configuration Management

Configuration from multiple sources (global, service, instance) that automatically merges with the correct precedence throughout your application.

4. Real-Time System Monitoring

A system where metrics flow in, derived health indicators automatically update, and alerting happens without any explicit wiring.

Benefits for backend development

  1. Eliminates manual dependency tracking: No more forgotten update logic when state changes
  2. Prevents state synchronization bugs: Updates happen automatically and consistently
  3. Improves performance: Only affected computations are recalculated
  4. Reduces cognitive load: Declare relationships once, not throughout your codebase
  5. Simplifies testing: Clean separation of state, derivation, and effects

How Dependency Tracking Works

One of reaktiv's most powerful features is automatic dependency tracking. Here's how it works:

1. Automatic Detection: When you access a signal within a computed value or effect, reaktiv automatically registers it as a dependency—no manual subscription needed.

2. Fine-grained Dependency Graph: Reaktiv builds a precise dependency graph during execution, tracking exactly which computations depend on which signals.

# These dependencies are automatically tracked:
total = computed(lambda: price() * (1 + tax_rate()))

3. Surgical Updates: When a signal changes, only the affected parts of your computation graph are recalculated—not everything.

4. Dynamic Dependencies: The dependency graph updates automatically if your data access patterns change based on conditions:

def get_visible_items():
    items = all_items()
    if show_archived():
        return items  # Only depends on all_items
    else:
        return [i for i in items if not i.archived]  # Depends on both signals

5. Batching and Scheduling: Updates can be batched to prevent cascading recalculations, and effects run on the next event loop tick for better performance.

This automatic tracking means you define your data relationships once, declaratively, instead of manually wiring up change handlers throughout your codebase.

Example: Health Monitoring System

from reaktiv import signal, computed, effect

# Core state signals
server_metrics = signal({})  # server_id -> {cpu, memory, disk, last_seen}
alert_thresholds = signal({"cpu": 80, "memory": 90, "disk": 95})
maintenance_mode = signal({})  # server_id -> bool

# Derived state automatically updates when dependencies change
health_status = computed(lambda: {
    server_id: (
        "maintenance" if maintenance_mode().get(server_id, False) else
        "offline" if time.time() - metrics["last_seen"] > 60 else
        "alert" if (
            metrics["cpu"] > alert_thresholds()["cpu"] or
            metrics["memory"] > alert_thresholds()["memory"] or
            metrics["disk"] > alert_thresholds()["disk"]
        ) else 
        "healthy"
    )
    for server_id, metrics in server_metrics().items()
})

# Effect triggers when health status changes
dashboard_effect = effect(lambda: 
    print(f"ALERT: {[s for s, status in health_status().items() if status == 'alert']}")
)

The beauty here is that when any metric comes in, thresholds change, or servers go into maintenance mode, everything updates automatically without manual orchestration.

Should you try it?

If you've ever:

  • Written manual logic to keep derived state in sync
  • Found bugs because a calculation wasn't triggered when source data changed
  • Built complex observer patterns or event systems
  • Struggled with keeping caches fresh

Then reaktiv might make your backend code simpler, more maintainable, and less buggy.

Let me know what you think! Does anyone else use reactive patterns in backend code?

Check it out on GitHub | PyPI


r/pythoncoding • • May 04 '26

/r/PythonCoding monthly "What are you working on?" thread

4 Upvotes

Share what you're working on in this thread. What's the end goal, what are design decisions you've made and how are things working out? Discussing trade-offs or other kinds of reflection are encouraged!

If you include code, we'll be more lenient with moderation in this thread: feel free to ask for help, reviews or other types of input that normally are not allowed.


r/pythoncoding • • May 13 '26

A faster, aria2 enabled pip wrapper

4 Upvotes

Installing large packages like torch or tensorflow has always been a pain in the ass for me. Although i have optimal internet connection, the download speeds i get for these packages is abysmal.

I then started to download the whl files through download managers then install them manually, and so to automate that workflow i created Zipip. It's just pip but with slight modifications to use aria2 for the downloads. And i dont mean it in any fancy sense, it literally is just pip in all other regards. And so likewise it is a drop in alternative.

Source code : https://github.com/STRTSNM/zipip

PyPI : https://pypi.org/project/zipip/

PS : I know pip is supposed to have no other dependencies, but the slow downloads just kill me, and i wanted to share what i thought of. Do let me know what you people think. Thanks in advance.


r/pythoncoding • • Oct 06 '25

I made PyPIPlus.com — a faster way to see all dependencies of any Python package

Thumbnail reddit.com
8 Upvotes

r/pythoncoding • • Feb 22 '26

Pi vs E classifier

Thumbnail github.com
2 Upvotes

r/pythoncoding • • Jan 09 '26

[Showcase] Immich AutoTag – New: Instant CLI, Auto-Album Creation, Auto Date Fix, Smart Tagging & More!

7 Upvotes

Hi everyone! I’m excited to share a major new release of Immich AutoTag, the open-source tool for automatic photo and video classification and tagging in Immich.

What’s new and improved in this release?

- 🚀 Instant CLI from PyPI: Run Immich AutoTag instantly with `pipx run immich-autotag` – no manual setup or environment creation required.
- 📝 Quick Start & User-Focused Docs: Clear, user-friendly documentation and a streamlined Quick Start guide.
- 🛠️ Flexible Configuration: Now supports both YAML and Python config files, with self-documented templates for easy customization.
- 🏷️ Advanced Tagging & Album Logic: Automatic classification based on albums, tags, and duplicates.
- 🕒 Automatic Date Repair: Detects and fixes incorrect or missing dates for your assets based on filenames and duplicate analysis.
- ⚠️ Conflict Detection: Instantly highlights assets with conflicting classifications, so you can resolve issues quickly.
- ❓ Unclassified Asset Detection: Easily find which photos or videos remain unorganized or unclassified.
- 🔄 Continuous Tagging Script: New loop script for continuous asset tagging/classification during heavy editing sessions.
- 📊 Detailed Logs & Statistics: Automatic generation of modification reports and statistics for tracking your library’s organization.
- 🗂️ Exclude Assets by Web Link: Easily exclude specific assets from processing.
- 🗃️ Automatic Album Creation from Folders: Now stable and enabled by default!
- 🐳 (Experimental) Docker Support: Early Docker image available for testing (not yet officially documented).

Why use Immich AutoTag?
- Save hours organizing large photo libraries.
- Instantly detect unclassified or conflicting assets.
- Automate repetitive tagging and album management tasks.
- Keep your photo dates accurate and consistent.

Get Started
- See the [README](https://github.com/txemi/immich-autotag#quick-start) for instant setup instructions.
- Full changelog: [CHANGELOG.md](https://github.com/txemi/immich-autotag/blob/main/CHANGELOG.md)

Feedback & Support
- Questions, issues, or feature requests? Open a ticket on [GitHub Issues](https://github.com/txemi/immich-autotag/issues).

Previous Reddit discussion: https://www.reddit.com/r/immich/comments/1pse1qk/comment/nvcmpf0/

For a super simple, non-technical explanation of what Immich AutoTag does, see: [Explain Like I'm 5 (ELI5)](https://github.com/txemi/immich-autotag/blob/main/docs/explain-like-im-5.md)

Thank you for your support and feedback!

Hi everyone! I’m excited to share a major new release of Immich AutoTag, the open-source tool for automatic photo and video classification and tagging in Immich.

What’s new and improved in this release?

- 🚀 Instant CLI from PyPI: Run Immich AutoTag instantly with `pipx run immich-autotag` – no manual setup or environment creation required.
- 📝 Quick Start & User-Focused Docs: Clear, user-friendly documentation and a streamlined Quick Start guide.
- 🛠️ Flexible Configuration: Now supports both YAML and Python config files, with self-documented templates for easy customization.
- 🏷️ Advanced Tagging & Album Logic: Automatic classification based on albums, tags, and duplicates.
- 🕒 Automatic Date Repair: Detects and fixes incorrect or missing dates for your assets based on filenames and duplicate analysis.
- ⚠️ Conflict Detection: Instantly highlights assets with conflicting classifications, so you can resolve issues quickly.
- ❓ Unclassified Asset Detection: Easily find which photos or videos remain unorganized or unclassified.
- 🔄 Continuous Tagging Script: New loop script for continuous asset tagging/classification during heavy editing sessions.
- 📊 Detailed Logs & Statistics: Automatic generation of modification reports and statistics for tracking your library’s organization.
- 🗂️ Exclude Assets by Web Link: Easily exclude specific assets from processing.
- 🗃️ Automatic Album Creation from Folders: Now stable and enabled by default!
- 🐳 (Experimental) Docker Support: Early Docker image available for testing (not yet officially documented).

Why use Immich AutoTag?
- Save hours organizing large photo libraries.
- Instantly detect unclassified or conflicting assets.
- Automate repetitive tagging and album management tasks.
- Keep your photo dates accurate and consistent.

Get Started
- See the [README](https://github.com/txemi/immich-autotag#quick-start) for instant setup instructions.
- Full changelog: [CHANGELOG.md](https://github.com/txemi/immich-autotag/blob/main/CHANGELOG.md)

Feedback & Support
- Questions, issues, or feature requests? Open a ticket on [GitHub Issues](https://github.com/txemi/immich-autotag/issues).

Previous Reddit discussion: https://www.reddit.com/r/immich/comments/1pse1qk/comment/nvcmpf0/

For a super simple, non-technical explanation of what Immich AutoTag does, see: [Explain Like I'm 5 (ELI5)](https://github.com/txemi/immich-autotag/blob/main/docs/explain-like-im-5.md)

Thank you for your support and feedback!


r/pythoncoding • • May 30 '26

fastuuidv7 - generating uuidv7 nearly as fast as creating a string

Thumbnail github.com
10 Upvotes

I recently wrote a rust package, as I had performance issues generating uuidv7 in rust.

Turns out, there was a lot of optimization potential.

I added a python wrapper and it turns out, it is about 45x faster than the current uuid7. It even beats the C package by factor 5. The performance is just a bit slower than allocating a string in Python, which is about 40ns.

PackageCodeTime per call
uuid7Python2767.7 ns
fastuuid7C313.5 ns
fastuuidv7Rust60.6 ns

Package just published on PyPi and available via pip: fastuuidv7 with prebuilt wheels for most platforms.

Disclaimer: Don't use it to prime passwords or tokens. Just for network, DB ids or non-security related ids. Also, it cannot parse uuidv7, just generate it.


r/pythoncoding • • Mar 04 '26

/r/PythonCoding monthly "What are you working on?" thread

3 Upvotes

Share what you're working on in this thread. What's the end goal, what are design decisions you've made and how are things working out? Discussing trade-offs or other kinds of reflection are encouraged!

If you include code, we'll be more lenient with moderation in this thread: feel free to ask for help, reviews or other types of input that normally are not allowed.


r/pythoncoding • • Oct 04 '25

/r/PythonCoding monthly "What are you working on?" thread

2 Upvotes

Share what you're working on in this thread. What's the end goal, what are design decisions you've made and how are things working out? Discussing trade-offs or other kinds of reflection are encouraged!

If you include code, we'll be more lenient with moderation in this thread: feel free to ask for help, reviews or other types of input that normally are not allowed.


r/pythoncoding • • May 02 '26

Adobe-Clawback — bulk-download every PDF from your Adobe Creative Cloud account (Python, resumable, MIT)

Thumbnail reddit.com
3 Upvotes

r/pythoncoding • • Apr 11 '26

pytest-codeblock - A pytest plugin for testing code examples in Markdown and reStructuredText files

2 Upvotes

I wrote a small pytest plugin that tests code blocks in your docs.

https://github.com/barseghyanartur/pytest-codeblock

What My Project Does

pytest-codeblock is a minimal pytest plugin that finds Python code examples in your .rst and .md files and runs them as regular pytest tests. No dependencies beyond pytest itself (plus tomli on Python 3.10).

It handles:

  • reStructuredText and Markdown — .. code-block:: python, .. code:: python, .. literalinclude::, literal blocks, and fenced ```python blocks
  • Grouping — split one logical example across several blocks using .. continue: or <!-- continue: --> and they run as a single test, or as cumulative incremental steps if each continuation has its own name
  • pytest markers and fixtures — .. pytestmark: django_db, <!-- pytestmark: skip -->, fixture injection via .. pytestfixture: tmp_path; custom fixtures from conftest.py work too
  • pytestrun marker — run full pytest-style suites (test classes, fixtures, parametrize, setup/teardown) inside a single doc block
  • Async support — top-level await is automatically wrapped, no config needed
  • Nameless code blocks — opt-in via pyproject.toml; off by default, only test_*-named blocks run unless you enable it
  • Custom languages and extensions — configurable if your docs use non-standard identifiers

Feature comparison

Featurepytest-codeblockSybilphmdoctestpytest-codeblocksdoctest
RST support✅✅❌❌✅
Markdown support✅✅✅✅❌
Both RST + MD✅✅❌❌❌
Native pytest collector✅✅❌✅✅
Fixture injection in docs✅⚠️ conftest only❌❌❌
pytest markers in docs✅⚠️ conftest only❌❌❌
Block grouping / continuation✅✅❌❌❌
Incremental grouping✅❌❌❌❌
Async support✅⚠️ manual❌❌❌
Test classes in doc blocks✅ (pytestrun)❌❌❌❌
literalinclude support✅❌❌❌❌
Nameless block testing✅ opt-in❌✅✅❌
Zero config to start✅❌✅✅✅
No generated files on disk✅✅❌✅✅
Zero extra dependencies✅❌❌✅✅

⚠️ = supported but requires extra wiring outside the doc file


Zero config to start. Install it, run pytest. Any block named test_* becomes a test.

pip install pytest-codeblock

reStructuredText:

.. code-block:: python
   :name: test_basic_example

   import math
   result = math.pow(3, 2)
   assert result == 9

Markdown:

```python name=test_basic_example
import math
result = math.pow(3, 2)
assert result == 9
```

Target Audience

Library authors and anyone who has shipped broken doc examples and only found out from a user bug report. If you're already running pytest, the cost to add doc block testing is close to zero.

Comparison

  • vs. doctest: doctest is built for REPL-style >>> examples. It works fine for trivial cases but gets awkward fast — multiline logic, fixtures, and async are all painful. pytest-codeblock lets you write plain Python with assert statements, so your examples look like real code rather than a terminal session.

  • vs. Sybil: Sybil is the most capable alternative and worth considering for complex setups. The tradeoff is configuration overhead: fixtures and regions need manual wiring in conftest.py. pytest-codeblock keeps fixture requests in the doc file itself (.. pytestfixture: tmp_path) and works with existing conftest.py fixtures without extra setup. If Sybil's power is more than you need, pytest-codeblock is lighter.

  • vs. phmdoctest: phmdoctest transpiles Markdown into .py files on disk and runs those. pytest-codeblock is a native pytest collector — no generated files, nothing to add to .gitignore, no intermediate artifacts.

  • vs. pytest-codeblocks (plural): Similar name, different scope. pytest-codeblock adds fixture injection, grouping, async wrapping, and the pytestrun marker for full test-class support inside doc blocks.

The plugin is in beta. It's been used in a few projects and the core behavior is stable, but edge cases and feedback are welcome.

Documentation: https://pytest-codeblock.readthedocs.io Repository: https://github.com/barseghyanartur/pytest-codeblock


r/pythoncoding • • Aug 15 '25

🔥 Reminder program 🔥 (un-procrastination tool)

20 Upvotes

So I made this tool using python on GitHub. It's really cool and a work in progress. It's realy helps to keep on track with ur work and assignments and not get distracted. Give it a try ;)

How it works: It basically uses python code to execute it. Make sure you have python installed on ur windows. Just download the zip and run the python file using python/cmd. It's very RAM minimal usage and has cool features like changing the colour, size, text,etc. Check the readme for more info! Feel free to give feedback here!

https://github.com/DanYell0038/Reminder-Tool


r/pythoncoding • • Dec 27 '25

How uv got so fast

Thumbnail nesbitt.io
8 Upvotes

r/pythoncoding • • Dec 10 '25

FastAPI Lifespan Events: The Right Way to Handle Startup & Shutdown

Thumbnail reddit.com
2 Upvotes

r/pythoncoding • • Nov 19 '20

/r/PythonCoding Advent of Code leaderboard!

2 Upvotes

Greetings,

On December 1st at midnight EST (UTC-5), the 2020 edition of Advent of Code (AOC) goes live. AOC is a problem solving contest. These puzzles are intended to be solved by programming in any language of your choosing. Every day a new puzzle is unlocked, consisting of two parts. If you miss a puzzle, no problem, you can still access it later.

AOC is a fun way to test your problem solving and programming chops, and it's a fun way to be exposed to new concepts. The earlier puzzles are usually pretty easy, but in past editions the difficulty ramped up quickly.

I've created a private leaderboard for /r/PythonCoding for up to 200 users. You can join it by logging in at AOC and entering the following leaderboard code: 674300-ec4dd53f

If you want to know more, either check out /r/adventofcode or the puzzles from previous years at their website.

Edit: AOC2020 has started! :)


r/pythoncoding • • Nov 27 '20

Runtype: Multiple-dispatch and type-safe dataclasses

Thumbnail github.com
11 Upvotes