Close Menu

    Subscribe to Updates

    Get the latest creative news from FooBar about art, design and business.

    What's Hot

    The ‘last-mile’ data problem is stalling enterprise agentic AI — ‘golden pipelines’ aim to fix it

    New agent framework matches human-engineered AI systems — and adds zero inference cost to deploy

    Alibaba’s Qwen 3.5 397B-A17 beats its larger trillion-parameter model — at a fraction of the cost

    Facebook X (Twitter) Instagram
    • Artificial Intelligence
    • Business Technology
    • Cryptocurrency
    • Gadgets
    • Gaming
    • Health
    • Software and Apps
    • Technology
    Facebook X (Twitter) Instagram Pinterest Vimeo
    Tech AI Verse
    • Home
    • Artificial Intelligence

      Read the extended transcript: President Donald Trump interviewed by ‘NBC Nightly News’ anchor Tom Llamas

      February 6, 2026

      Stocks and bitcoin sink as investors dump software company shares

      February 4, 2026

      AI, crypto and Trump super PACs stash millions to spend on the midterms

      February 2, 2026

      To avoid accusations of AI cheating, college students are turning to AI

      January 29, 2026

      ChatGPT can embrace authoritarian ideas after just one prompt, researchers say

      January 24, 2026
    • Business

      The HDD brand that brought you the 1.8-inch, 2.5-inch, and 3.5-inch hard drives is now back with a $19 pocket-sized personal cloud for your smartphones

      February 12, 2026

      New VoidLink malware framework targets Linux cloud servers

      January 14, 2026

      Nvidia Rubin’s rack-scale encryption signals a turning point for enterprise AI security

      January 13, 2026

      How KPMG is redefining the future of SAP consulting on a global scale

      January 10, 2026

      Top 10 cloud computing stories of 2025

      December 22, 2025
    • Crypto

      Is Bitcoin Price Entering a New Bear Market? Here’s Why Metrics Say Yes

      February 19, 2026

      Cardano’s Trading Activity Crashes to a 6-Month Low — Can ADA Still Attempt a Reversal?

      February 19, 2026

      Is Extreme Fear a Buy Signal? New Data Questions the Conventional Wisdom

      February 19, 2026

      Coinbase and Ledn Strengthen Crypto Lending Push Despite Market Slump

      February 19, 2026

      Bitcoin Caught Between Hawkish Fed and Dovish Warsh

      February 19, 2026
    • Technology

      The ‘last-mile’ data problem is stalling enterprise agentic AI — ‘golden pipelines’ aim to fix it

      February 19, 2026

      New agent framework matches human-engineered AI systems — and adds zero inference cost to deploy

      February 19, 2026

      Alibaba’s Qwen 3.5 397B-A17 beats its larger trillion-parameter model — at a fraction of the cost

      February 19, 2026

      When accurate AI is still dangerously incomplete

      February 19, 2026

      Meta reportedly plans to release a smartwatch this year

      February 19, 2026
    • Others
      • Gadgets
      • Gaming
      • Health
      • Software and Apps
    Check BMI
    Tech AI Verse
    You are at:Home»Technology»Bridging Elixir and Python with Oban
    Technology

    Bridging Elixir and Python with Oban

    TechAiVerseBy TechAiVerseFebruary 19, 2026No Comments6 Mins Read2 Views
    Facebook Twitter Pinterest Telegram LinkedIn Tumblr Email Reddit
    Bridging Elixir and Python with Oban
    Share
    Facebook Twitter LinkedIn Pinterest WhatsApp Email

    Bridging Elixir and Python with Oban

    What choices lay before you when your Elixir app needs functionality that only exists, or is more
    mature, in Python? There are machine learning models, PDF rendering libraries, and audio/video
    editing tools without an Elixir equivalent (yet). You could piece together some HTTP calls, or
    bring in a message queue…but there’s a simpler path through Oban.

    Whether you’re enabling disparate teams to collaborate, gradually migrating from one language to
    another, or leveraging packages that are lacking in one ecosystem, having a mechanism to
    transparently exchange durable jobs between Elixir and Python opens up new possibilities.

    On that tip, let’s build a small example to demonstrate how trivial bridging can be. We’ll call it
    “Badge Forge”.

    Forging Badges

    “Badge Forge,” like “Fire Saga” before it, is a pair of nouns that barely describes what
    our demo app does. But, it’s balanced and why hold back on the whimsy?

    More concretely, we’re building a micro app that prints conference badges. The actual PDF
    generation happens through WeasyPrint, a Python library that turns HTML and CSS into
    print-ready documents. It’s mature and easy to use. For the purpose of this demo, we’ll pretend
    that running ChromaticPDF is unpalatable and Typst isn’t available.

    There’s no web framework involved, just command-line output and job processing. Don’t fret, we’ll
    bring in some visualization later.

    Sharing a Common Database

    Some say you’re cra-zay for sharing a database between applications. We say you’re already
    willing to share a message queue, and now the database is your task broker, so why not? It’s
    happening.

    Oban for Python was designed for interop with Elixir from the beginning. Both libraries read
    and write to the same oban_jobs table, with job args stored as JSON, so they’re fully
    language-agnostic. When an Elixir app enqueues a job destined for a Python worker (or vice versa),
    it simply writes a row. The receiving side picks it up based on the queue name, processes it, and
    updates the status. That’s the whole mechanism:

    Each side maintains its own cluster leadership, so an Elixir node and a Python process won’t
    compete for leader responsibilities. They coordinate through the jobs table, but take care of
    business
    independently.

    Both sides can also exchange PubSub notifications through Postgres for real-time coordination.
    The importance of that tidbit will become clear soon enough.

    Printing in Action

    This is more of a demonstration than a tutorial. We don’t expect you to build along, but we hope
    you’ll see how little code it takes to form a bridge.

    With a wee config in place and both apps pointing at the same database, we can start generating
    badges.

    Enqueueing Jobs

    Generation starts on the Elixir side. This function enqueues a batch of (fake) jobs destined for
    the Python worker:

    def enqueue_batch(count \ 100) do
      generate = fn _ ->
        args = %{
          id: Ecto.UUID.generate(),
          name: fake_name(),
          company: fake_company(),
          type: Enum.random(~w(attendee speaker sponsor organizer))
        }
    
        Oban.Job.new(args, worker: "badge_forge.generator.GenerateBadge", queue: :badges)
      end
    
      1..count
      |> Enum.map(generate)
      |> Oban.insert_all()
    end
    

    Notice the worker name is a string, “badge_forge.generator.GenerateBadge”, matching the Python
    worker’s fully qualified name. The job lands in the badges queue, where a Python worker is
    listening.

    The Python Side

    The Python worker receives badge requests and generates PDFs using WeasyPrint:

    from oban import Job, Oban, worker
    from weasyprint import HTML
    
    @worker(max_attempts=5, queue="badges")
    class GenerateBadge:
        async def process(self, job: Job) -> None:
            id = job.args["badge_id"]
            name = job.args["name"]
            html = render_badge_html(name, job.args["company"], job.args["type"])
            path = BADGES_DIR / f"{name}.pdf"
    
            # Generate the pdf content
            HTML(string=html).write_pdf(path)
    
            # Construct a job manually
            job = Job(
                args={"id": id, "name": name, "path": str(path)},
                queue="printing",
                worker="BadgeForge.PrintCenter",
            )
    
            # Use the active Oban instance and enqueue the job
            await Oban.get_instance().enqueue(job)
    

    When a job arrives, it pulls the attendee info from the args, renders an HTML template, and writes
    the PDF to disk. After completion, it enqueues a confirmation job back to Elixir.

    The Elixir Side

    The Elixir side listens for confirmations and prints the result:

    defmodule BadgeForge.PrintCenter do
      use Oban.Worker, queue: :printing
    
      require Logger
    
      @impl Oban.Worker
      def perform(%Job{args: %{"id" => id, "name" => name, "path" => path}}) do
        Logger.info("Printing badge #{id} for #{name}: #{path}...")
    
        do_actual_printing_here(...)
    
        :ok
      end
    end
    

    With that, there’s two-way communication through the jobs table.

    Sample Output

    To print conference badges you need a conference. You should have a conference. We’re printing
    badges for the fictional “Oban Conf” being held this year in Edinburgh. It will be both
    hydrating and engaging. Kicking off a batch of ten jobs from Elixir:

    iex> BadgeForge.enqueue_batch(10)
    :ok
    

    On the Python side, we see automatic logging for each job with output like this (output has been
    prettified):

    [INFO] oban: {
      "id":14,
      "worker":"badge_forge.generator.GenerateBadge",
      "queue":"badges",
      "attempt":1,
      "max_attempts":20,
      "args":{
        "id":"7bfb7c39-c354-4cce-ad5b-f1be2814b17e",
        "name":"Alasdair Fraser",
        "type":"speaker",
        "company":"Wavelength Tech"
      },
      "meta":{},
      "tags":[],
      "event":"oban.job.stop",
      "state":"completed",
      "duration":2.51,
      "queue_time":5.45
    }
    

    The job completed successfully, and back in the Elixir app, we see that the print completed:

    [info] Printing badge 7bfb7c39 for Alasdair Fraser: /some/path...
    

    The output looks something like this:

    Apologies to any “Alasdair Frasers” out there, your name was pulled from the nether and there
    isn’t a real conference. As consolation, if you contact us, you have stickers coming.

    Visualizing the Activity

    Seeing jobs in terminal logs is fine, but watching them flow through a dashboard is far more
    satisfying. We recently shipped a standalone Oban Web Docker image for situations like
    this; where you want monitoring without mounting it in your app. It’s also useful when your
    primary app is actually Python…

    With docker running, point the DATABASE_URL at your Oban-ified database and pull the image:

    docker run -d 
      -e DATABASE_URL="postgres://user:pass@host.docker.internal:5432/badge_forge_dev" 
      -p 4000:4000 
      ghcr.io/oban-bg/oban-dash
    

    That starts Oban Web running in the background to monitor jobs from all connected Oban instances.
    Queue activity and metrics are exchanged via PubSub, so the Web instance can store them for
    visualization. Trigger a few (hundred) jobs, navigate to the dashboard on localhost:4000, and
    look at ’em roll:

    Bridging Both Ways

    Badge Forge is whimsical, some say “useless”, but the pattern is practical! When you need tools
    that are stronger in one ecosystem, you can bridge it. This goes both ways. A Python app can
    reach for Elixir’s strengths just as easily.

    Check out the full demo code for the boilerplate and config we rested over here.


    As usual, if you have any questions or comments, ask in the Elixir Forum. For future announcements and insight into
    what we’re working on next, subscribe to our
    newsletter
    .

    Share. Facebook Twitter Pinterest LinkedIn Reddit WhatsApp Telegram Email
    Previous ArticleOld School Visual Effects: The Cloud Tank (2010)
    Next Article ShannonMax: A Library to Optimize Emacs Keybindings with Information Theory
    TechAiVerse
    • Website

    Jonathan is a tech enthusiast and the mind behind Tech AI Verse. With a passion for artificial intelligence, consumer tech, and emerging innovations, he deliver clear, insightful content to keep readers informed. From cutting-edge gadgets to AI advancements and cryptocurrency trends, Jonathan breaks down complex topics to make technology accessible to all.

    Related Posts

    The ‘last-mile’ data problem is stalling enterprise agentic AI — ‘golden pipelines’ aim to fix it

    February 19, 2026

    New agent framework matches human-engineered AI systems — and adds zero inference cost to deploy

    February 19, 2026

    Alibaba’s Qwen 3.5 397B-A17 beats its larger trillion-parameter model — at a fraction of the cost

    February 19, 2026
    Leave A Reply Cancel Reply

    Top Posts

    Ping, You’ve Got Whale: AI detection system alerts ships of whales in their path

    April 22, 2025684 Views

    Lumo vs. Duck AI: Which AI is Better for Your Privacy?

    July 31, 2025273 Views

    6.7 Cummins Lifter Failure: What Years Are Affected (And Possible Fixes)

    April 14, 2025156 Views

    6 Best MagSafe Phone Grips (2025), Tested and Reviewed

    April 6, 2025118 Views
    Don't Miss
    Technology February 19, 2026

    The ‘last-mile’ data problem is stalling enterprise agentic AI — ‘golden pipelines’ aim to fix it

    The ‘last-mile’ data problem is stalling enterprise agentic AI — ‘golden pipelines’ aim to fix…

    New agent framework matches human-engineered AI systems — and adds zero inference cost to deploy

    Alibaba’s Qwen 3.5 397B-A17 beats its larger trillion-parameter model — at a fraction of the cost

    When accurate AI is still dangerously incomplete

    Stay In Touch
    • Facebook
    • Twitter
    • Pinterest
    • Instagram
    • YouTube
    • Vimeo

    Subscribe to Updates

    Get the latest creative news from SmartMag about art & design.

    About Us
    About Us

    Welcome to Tech AI Verse, your go-to destination for everything technology! We bring you the latest news, trends, and insights from the ever-evolving world of tech. Our coverage spans across global technology industry updates, artificial intelligence advancements, machine learning ethics, and automation innovations. Stay connected with us as we explore the limitless possibilities of technology!

    Facebook X (Twitter) Pinterest YouTube WhatsApp
    Our Picks

    The ‘last-mile’ data problem is stalling enterprise agentic AI — ‘golden pipelines’ aim to fix it

    February 19, 20260 Views

    New agent framework matches human-engineered AI systems — and adds zero inference cost to deploy

    February 19, 20260 Views

    Alibaba’s Qwen 3.5 397B-A17 beats its larger trillion-parameter model — at a fraction of the cost

    February 19, 20260 Views
    Most Popular

    7 Best Kids Bikes (2025): Mountain, Balance, Pedal, Coaster

    March 13, 20250 Views

    VTOMAN FlashSpeed 1500: Plenty Of Power For All Your Gear

    March 13, 20250 Views

    This new Roomba finally solves the big problem I have with robot vacuums

    March 13, 20250 Views
    © 2026 TechAiVerse. Designed by Divya Tech.
    • Home
    • About Us
    • Contact Us
    • Privacy Policy
    • Terms & Conditions

    Type above and press Enter to search. Press Esc to cancel.