<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>DEV Community: Arun Sai Veerisetty</title>
    <description>The latest articles on DEV Community by Arun Sai Veerisetty (@arunsaiv).</description>
    <link>https://dev.to/arunsaiv</link>
    <image>
      <url>https://media2.dev.to/dynamic/image/width=90,height=90,fit=cover,gravity=auto,format=auto/https:%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F3228214%2F790b023b-8308-4888-8a67-03ab209fcda3.png</url>
      <title>DEV Community: Arun Sai Veerisetty</title>
      <link>https://dev.to/arunsaiv</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/arunsaiv"/>
    <language>en</language>
    <item>
      <title>Goodbye REST? Build a Modern GraphQL Todo API with Python + FastAPI 🍓</title>
      <dc:creator>Arun Sai Veerisetty</dc:creator>
      <pubDate>Tue, 03 Jun 2025 21:24:04 +0000</pubDate>
      <link>https://dev.to/arunsaiv/goodbye-rest-build-a-modern-graphql-todo-api-with-python-fastapi-38g2</link>
      <guid>https://dev.to/arunsaiv/goodbye-rest-build-a-modern-graphql-todo-api-with-python-fastapi-38g2</guid>
      <description>&lt;p&gt;Have you ever felt frustrated managing multiple REST endpoints, chasing over-fetching or under-fetching data? Enter GraphQL — a modern alternative to REST APIs that lets clients request exactly what they need.&lt;/p&gt;

&lt;p&gt;In this tutorial, you’ll build a simple but powerful Todo API using Python, leveraging:&lt;br&gt;
• ⚡ FastAPI — a blazing fast, modern web framework&lt;br&gt;
• 🍓 Strawberry — a Python-native GraphQL library with type hints&lt;br&gt;
• 💾 SQLite + SQLModel — lightweight and easy data persistence&lt;br&gt;
• 🐳 Docker — containerize your app for easy deployment&lt;br&gt;
• 🌐 Render — deploy your app in minutes for free&lt;/p&gt;

&lt;p&gt;By the end, you’ll have a fully working GraphQL API deployed on the cloud — and all the code will be on GitHub for you to explore and extend.&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;💻 Code: &lt;a href="https://github.com/arunsaiv/graphql-todo-api" rel="noopener noreferrer"&gt;https://github.com/arunsaiv/graphql-todo-api&lt;/a&gt;&lt;/p&gt;
&lt;/blockquote&gt;




&lt;p&gt;&lt;strong&gt;Why Choose GraphQL Over REST?&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;REST APIs are great, but as apps grow, you often face challenges:&lt;br&gt;
• Multiple endpoints for related data&lt;br&gt;
• Over-fetching or under-fetching data&lt;br&gt;
• Versioning headaches&lt;/p&gt;

&lt;p&gt;GraphQL solves these by letting clients ask for exactly the data they want in a single request, reducing network overhead and improving developer experience.&lt;/p&gt;




&lt;p&gt;What You’ll Build&lt;/p&gt;

&lt;p&gt;A Todo API that supports:&lt;/p&gt;

&lt;p&gt;• Adding todos&lt;br&gt;
• Marking them completed&lt;br&gt;
• Deleting todos&lt;br&gt;
• Querying all or filtered todos&lt;/p&gt;

&lt;p&gt;All via a clean GraphQL schema, with a built-in playground UI to try queries live.&lt;/p&gt;




&lt;p&gt;Setting Up the Project&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Create a new folder and initialize the project
&lt;/li&gt;
&lt;/ol&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;mkdir graphql-todo-api
cd graphql-todo-api
python -m venv venv
source venv/bin/activate  # On Windows: venv\Scripts\activate
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;ol&gt;
&lt;li&gt;Create a requirements.txt file with these dependencies:
&lt;/li&gt;
&lt;/ol&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;fastapi
strawberry-graphql[fastapi]
uvicorn
sqlmodel
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;ol&gt;
&lt;li&gt;Install the dependencies
&lt;/li&gt;
&lt;/ol&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;pip install -r requirements.txt
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;






&lt;p&gt;&lt;strong&gt;Understanding GraphQL: The Basics&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;GraphQL is a query language for APIs developed by Facebook to make data fetching more efficient and flexible than traditional REST APIs.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;How GraphQL Differs from REST&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;• &lt;strong&gt;Single Endpoint:&lt;/strong&gt; Unlike REST which uses multiple endpoints (e.g., /todos, /users), GraphQL uses a single endpoint (like /graphql) to handle all requests.&lt;br&gt;
• &lt;strong&gt;Client-Driven Queries:&lt;/strong&gt; Clients specify exactly what data they want — no more, no less. This prevents over-fetching or under-fetching.&lt;br&gt;
• &lt;strong&gt;Strongly Typed Schema:&lt;/strong&gt; GraphQL APIs expose a schema that defines the types of data and operations (queries and mutations) available.&lt;br&gt;
• &lt;strong&gt;Real-time Data:&lt;/strong&gt; Supports subscriptions for real-time updates (though not covered here).&lt;/p&gt;

&lt;p&gt;Key Concepts&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Term:&lt;/strong&gt; What It Means&lt;br&gt;
&lt;strong&gt;Query:&lt;/strong&gt; A read-only fetch operation&lt;br&gt;
&lt;strong&gt;Mutation:&lt;/strong&gt; A write operation (create, update, delete)&lt;br&gt;
&lt;strong&gt;Schema:&lt;/strong&gt; The structure defining data types &amp;amp; operations&lt;br&gt;
&lt;strong&gt;Resolver:&lt;/strong&gt; Function that fetches or modifies data for a field&lt;/p&gt;




&lt;p&gt;🧱 Tech Stack: What We Used and Why&lt;/p&gt;

&lt;p&gt;Let’s break down each tech choice and why it made sense for this project:&lt;/p&gt;




&lt;p&gt;🐍 Python&lt;/p&gt;

&lt;p&gt;The language of choice for rapid backend development. Python’s clean syntax and huge ecosystem made building and testing fast.&lt;/p&gt;




&lt;p&gt;⚡ FastAPI&lt;/p&gt;

&lt;p&gt;A modern web framework built for speed and type safety. We chose FastAPI because:&lt;br&gt;
• It uses Python type hints for automatic validation and docs&lt;br&gt;
• It plays well with async and GraphQL&lt;br&gt;
• It’s fast enough for production workloads&lt;/p&gt;




&lt;p&gt;🍓 Strawberry GraphQL&lt;/p&gt;

&lt;p&gt;A Pythonic GraphQL library that feels natural for developers. We chose Strawberry because:&lt;br&gt;
• It lets you define GraphQL schemas using plain Python classes&lt;br&gt;
• It supports modern typing and IDE autocompletion&lt;br&gt;
• It integrates smoothly with FastAPI&lt;/p&gt;




&lt;p&gt;💾 SQLite + SQLModel&lt;/p&gt;

&lt;p&gt;SQLite is lightweight and file-based — ideal for demo and local development.&lt;/p&gt;

&lt;p&gt;SQLModel (by the creator of FastAPI) combines Pydantic and SQLAlchemy to:&lt;br&gt;
• Define data models with type hints&lt;br&gt;
• Automatically create and query the SQLite database&lt;br&gt;
• Keep everything concise and maintainable&lt;/p&gt;




&lt;p&gt;🐳 Docker&lt;/p&gt;

&lt;p&gt;Docker helps package the app with all dependencies so it runs identically everywhere.&lt;/p&gt;

&lt;p&gt;We used it to:&lt;br&gt;
• Create a container that holds Python, the app, and its dependencies&lt;br&gt;
• Avoid “it works on my machine” bugs&lt;br&gt;
• Simplify deployment to Render&lt;/p&gt;




&lt;p&gt;🌐 Render&lt;/p&gt;

&lt;p&gt;Render is a developer-friendly cloud platform with a free tier. It:&lt;br&gt;
• Connects to GitHub&lt;br&gt;
• Deploys Docker containers automatically&lt;br&gt;
• Provides a public URL out of the box&lt;/p&gt;




&lt;p&gt;✨ Try It Live&lt;/p&gt;

&lt;p&gt;No setup needed — you can try the GraphQL API right now:&lt;br&gt;
👉 &lt;a href="https://graphql-todo-api.onrender.com/graphql" rel="noopener noreferrer"&gt;https://graphql-todo-api.onrender.com/graphql&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Use the playground to:&lt;br&gt;
• Add a todo&lt;br&gt;
• Mark it completed&lt;br&gt;
• Delete it&lt;br&gt;
• Filter by status&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Note:&lt;/strong&gt; The app would take upto one minute to load if the application is set to idle for more than 15 minutes, since, it is hosted for feee and Render would free up the space for utilisation. &lt;/p&gt;




&lt;p&gt;🧭 What’s Next?&lt;/p&gt;

&lt;p&gt;Some ideas to extend this project:&lt;br&gt;
• Add a React UI with Apollo Client&lt;br&gt;
• Migrate to PostgreSQL for production&lt;br&gt;
• Add JWT authentication&lt;br&gt;
• Use GraphQL subscriptions for real-time updates&lt;/p&gt;




&lt;p&gt;💬 Final Thoughts&lt;/p&gt;

&lt;p&gt;This project shows how smooth and elegant building a GraphQL API in Python can be — no REST clutter, no boilerplate, and fully typed.&lt;/p&gt;

&lt;p&gt;If you’re curious about GraphQL or tired of juggling REST endpoints, this stack is worth exploring.&lt;/p&gt;




&lt;h2&gt;
  
  
  🙌 Like What You Read?
&lt;/h2&gt;

&lt;p&gt;If this helped you:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;💬 Leave a comment&lt;/li&gt;
&lt;li&gt;🔁 Share it with your network&lt;/li&gt;
&lt;li&gt;🌟 Star the GitHub repo!&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Let's connect on &lt;a href="https://www.linkedin.com/in/arun-sai-veerisetty-609656a6" rel="noopener noreferrer"&gt;LinkedIn&lt;/a&gt;!&lt;/p&gt;




</description>
    </item>
    <item>
      <title># How to Throttle Like a Pro: 5 Rate Limiting Patterns in Python You Should Know 🚦🐍</title>
      <dc:creator>Arun Sai Veerisetty</dc:creator>
      <pubDate>Mon, 02 Jun 2025 21:42:18 +0000</pubDate>
      <link>https://dev.to/arunsaiv/-how-to-throttle-like-a-pro-5-rate-limiting-patterns-in-python-you-should-know-54ep</link>
      <guid>https://dev.to/arunsaiv/-how-to-throttle-like-a-pro-5-rate-limiting-patterns-in-python-you-should-know-54ep</guid>
      <description>&lt;p&gt;In today’s world of high-scale APIs, bots, and distributed systems, &lt;strong&gt;rate limiting&lt;/strong&gt; is not just a nice-to-have—it’s essential. Whether you're protecting your server from abuse or controlling how often a user can take action, rate limiting is the key to reliability and fairness.&lt;/p&gt;

&lt;p&gt;In this blog, we’ll explore &lt;strong&gt;5 powerful rate limiting patterns&lt;/strong&gt; with &lt;strong&gt;hands-on Python implementations&lt;/strong&gt;. By the end, you’ll not only understand when and why to use each pattern but also walk away with real code to apply in your own projects.&lt;/p&gt;




&lt;h2&gt;
  
  
  🧠 What is Rate Limiting?
&lt;/h2&gt;

&lt;p&gt;Rate limiting is the process of &lt;strong&gt;restricting how many requests or actions&lt;/strong&gt; a system allows over a period of time. For example, “No more than 5 login attempts per minute” or “Only 100 API calls per hour”.&lt;/p&gt;

&lt;p&gt;This is crucial for:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Avoiding abuse or spam.&lt;/li&gt;
&lt;li&gt;Managing traffic spikes.&lt;/li&gt;
&lt;li&gt;Fair resource usage.&lt;/li&gt;
&lt;li&gt;Avoiding overloads and DDoS attacks.&lt;/li&gt;
&lt;/ul&gt;




&lt;h2&gt;
  
  
  🧩 Overview of Patterns
&lt;/h2&gt;

&lt;p&gt;Here’s a quick glance at the patterns we'll cover:&lt;/p&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Pattern&lt;/th&gt;
&lt;th&gt;Allows Bursts?&lt;/th&gt;
&lt;th&gt;Description&lt;/th&gt;
&lt;th&gt;Best For&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;Fixed Window&lt;/td&gt;
&lt;td&gt;❌&lt;/td&gt;
&lt;td&gt;Simple time window&lt;/td&gt;
&lt;td&gt;Basic rate limiting&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Sliding Window&lt;/td&gt;
&lt;td&gt;❌&lt;/td&gt;
&lt;td&gt;Fairer than fixed window&lt;/td&gt;
&lt;td&gt;API fairness&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Leaky Bucket&lt;/td&gt;
&lt;td&gt;✅ (Smooth)&lt;/td&gt;
&lt;td&gt;Queues excess traffic&lt;/td&gt;
&lt;td&gt;Traffic shaping&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Token Bucket&lt;/td&gt;
&lt;td&gt;✅&lt;/td&gt;
&lt;td&gt;Token-based burst tolerance&lt;/td&gt;
&lt;td&gt;Most flexible rate limits&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Distributed (Redis)&lt;/td&gt;
&lt;td&gt;✅&lt;/td&gt;
&lt;td&gt;Multi-server rate limiting&lt;/td&gt;
&lt;td&gt;Scalable systems&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;




&lt;h2&gt;
  
  
  1. 🪟 Fixed Window
&lt;/h2&gt;

&lt;p&gt;&lt;strong&gt;Concept&lt;/strong&gt;: Allow N actions per fixed time window (e.g., per minute).&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Analogy&lt;/strong&gt;: Like a parking garage that resets at midnight — doesn’t matter when you arrived, just how many came during the time.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Pros&lt;/strong&gt;: Simple to implement.&lt;br&gt;&lt;br&gt;
&lt;strong&gt;Cons&lt;/strong&gt;: Susceptible to bursts at window edges.&lt;/p&gt;




&lt;h2&gt;
  
  
  2. 🪟 Sliding Window
&lt;/h2&gt;

&lt;p&gt;&lt;strong&gt;Concept&lt;/strong&gt;: Records timestamps of requests and checks the rolling window.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Analogy&lt;/strong&gt;: Like keeping a log of visitors for the last 60 seconds — fair and accurate.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Pros&lt;/strong&gt;: Fairer than fixed window.&lt;br&gt;&lt;br&gt;
&lt;strong&gt;Cons&lt;/strong&gt;: Slightly more complex.&lt;/p&gt;




&lt;h2&gt;
  
  
  3. 🪣 Leaky Bucket
&lt;/h2&gt;

&lt;p&gt;&lt;strong&gt;Concept&lt;/strong&gt;: Adds requests to a queue, and processes them at a fixed rate.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Analogy&lt;/strong&gt;: Like a faucet dripping water at a steady rate, even if you pour a bucket into it.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Pros&lt;/strong&gt;: Smoothens traffic.&lt;br&gt;&lt;br&gt;
&lt;strong&gt;Cons&lt;/strong&gt;: Can introduce latency.&lt;/p&gt;




&lt;h2&gt;
  
  
  4. 🎟️ Token Bucket
&lt;/h2&gt;

&lt;p&gt;&lt;strong&gt;Concept&lt;/strong&gt;: Tokens are added at a fixed rate; each request consumes a token.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Analogy&lt;/strong&gt;: Like a vending machine that refills slowly — if you have tokens, you can burst; otherwise, wait.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Pros&lt;/strong&gt;: Flexible and burst-tolerant.&lt;br&gt;&lt;br&gt;
&lt;strong&gt;Cons&lt;/strong&gt;: Requires token logic and state.&lt;/p&gt;




&lt;h2&gt;
  
  
  5. 🌐 Distributed Rate Limiting (with Redis)
&lt;/h2&gt;

&lt;p&gt;&lt;strong&gt;Concept&lt;/strong&gt;: Use a shared data store like Redis to manage limits across servers.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Analogy&lt;/strong&gt;: Like a shared notebook in the cloud tracking user activity.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Pros&lt;/strong&gt;: Scalable, central tracking.&lt;br&gt;&lt;br&gt;
&lt;strong&gt;Cons&lt;/strong&gt;: Needs external Redis setup.&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;🛠️ Make sure Redis is running locally or remotely before testing.&lt;/p&gt;
&lt;/blockquote&gt;




&lt;h2&gt;
  
  
  💻 GitHub Project
&lt;/h2&gt;

&lt;p&gt;Explore all these patterns in code here:&lt;br&gt;&lt;br&gt;
👉 &lt;a href="https://github.com/arunsaiv/rate-limiter-patterns" rel="noopener noreferrer"&gt;GitHub Repo&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Each rate limiter is implemented in Python with comments and test files to help you understand and experiment.&lt;/p&gt;




&lt;h2&gt;
  
  
  🔧 How to Run the Code
&lt;/h2&gt;

&lt;ol&gt;
&lt;li&gt;
&lt;strong&gt;Clone the repo&lt;/strong&gt;
&lt;/li&gt;
&lt;/ol&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;git clone https://github.com/arunsaiv/rate-limiter-patterns.git
&lt;span class="nb"&gt;cd &lt;/span&gt;rate-limiter-patterns
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;






&lt;h2&gt;
  
  
  2. install dependencies
&lt;/h2&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;pip &lt;span class="nb"&gt;install&lt;/span&gt; &lt;span class="nt"&gt;-r&lt;/span&gt; requirements.txt
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;






&lt;h2&gt;
  
  
  3. Run any pattern script
&lt;/h2&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;python fixed_window.py
python token_bucket.py
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;






&lt;h2&gt;
  
  
  🙌 Like What You Read?
&lt;/h2&gt;

&lt;p&gt;If this helped you:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;💬 Leave a comment&lt;/li&gt;
&lt;li&gt;🔁 Share it with your network&lt;/li&gt;
&lt;li&gt;🌟 Star the GitHub repo!&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Let's connect on &lt;a href="https://www.linkedin.com/in/arun-sai-veerisetty-609656a6" rel="noopener noreferrer"&gt;LinkedIn&lt;/a&gt;!&lt;/p&gt;




</description>
    </item>
    <item>
      <title>Don’t Just Queue It — Master It! A Python Developer’s Guide to Queues</title>
      <dc:creator>Arun Sai Veerisetty</dc:creator>
      <pubDate>Mon, 02 Jun 2025 00:26:03 +0000</pubDate>
      <link>https://dev.to/arunsaiv/dont-just-queue-it-master-it-a-python-developers-guide-to-queues-24od</link>
      <guid>https://dev.to/arunsaiv/dont-just-queue-it-master-it-a-python-developers-guide-to-queues-24od</guid>
      <description>&lt;p&gt;🚀 Introduction&lt;/p&gt;

&lt;p&gt;Queues are everywhere — from the print job waiting on your computer to the request processing system of a large-scale web server. But understanding queues isn’t just about putting items in and taking them out — it’s about knowing what kind of queue to use and when.&lt;/p&gt;

&lt;p&gt;In this post, we’ll explore:&lt;/p&gt;

&lt;p&gt;✅ Different types of queues&lt;br&gt;
✅ How they’re implemented in Python&lt;br&gt;
✅ Real-world scenarios where each type shines&lt;br&gt;
✅ A practical GitHub repo with all code samples&lt;/p&gt;

&lt;p&gt;Whether you’re prepping for interviews, building scalable backends, or just exploring Python data structures, this guide is for you.&lt;/p&gt;




&lt;p&gt;📦 What is a Queue?&lt;/p&gt;

&lt;p&gt;A queue is a First-In-First-Out (FIFO) data structure — like a line at the bank. The first person to arrive is the first to be served.&lt;/p&gt;

&lt;p&gt;But modern systems use variations of queues to solve different problems. That’s what we’ll dive into next.&lt;/p&gt;




&lt;p&gt;🧱 Queue Types &amp;amp; Use Cases&lt;/p&gt;




&lt;ol&gt;
&lt;li&gt;🎯 Simple Queue&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;• Behavior: FIFO&lt;br&gt;
• Use Cases: Print queues, customer service systems, basic task scheduling&lt;br&gt;
• Python: collections.deque or queue.Queue&lt;/p&gt;




&lt;ol&gt;
&lt;li&gt;🔁 Circular Queue&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;• Behavior: FIFO with a circular buffer (head connects to tail)&lt;br&gt;
• Use Cases: Memory-efficient ring buffers, round-robin scheduling&lt;br&gt;
• Python: Custom implementation (linked list or array-based)&lt;/p&gt;




&lt;ol&gt;
&lt;li&gt;⏫ Priority Queue&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;• Behavior: Elements are served based on priority&lt;br&gt;
• Use Cases: Job scheduling, Dijkstra’s algorithm, OS-level tasks&lt;br&gt;
• Python: queue.PriorityQueue, heapq&lt;/p&gt;




&lt;ol&gt;
&lt;li&gt;🔄 Deque (Double-Ended Queue)&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;• Behavior: Can insert/remove from both ends&lt;br&gt;
• Use Cases: Undo/redo operations, sliding window problems, caching&lt;br&gt;
• Python: collections.deque&lt;/p&gt;




&lt;ol&gt;
&lt;li&gt;🤝 Concurrent Queue&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;• Behavior: Thread-safe queue for multi-threaded systems&lt;br&gt;
• Use Cases: Background processing, task pools, producer-consumer models&lt;br&gt;
• Python: queue.Queue (thread-safe)&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;🧵 Curious about thread-safe? It means multiple threads can access the queue without data corruption or race conditions.&lt;/p&gt;
&lt;/blockquote&gt;




&lt;ol&gt;
&lt;li&gt;📩 Message Queue (Job Queue)&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;• Behavior: Asynchronous communication between producers &amp;amp; consumers&lt;br&gt;
• Use Cases: Distributed systems, background job processing, microservices&lt;br&gt;
• Popular Tools: RabbitMQ, Kafka, Redis Streams, Celery&lt;/p&gt;




&lt;p&gt;🛠 Practical Examples &amp;amp; Code&lt;/p&gt;

&lt;p&gt;Each queue is implemented in clean Python code in this GitHub repository:&lt;br&gt;
👉 &lt;a href="https://github.com/arunsaiv/queue-patterns" rel="noopener noreferrer"&gt;queue-patterns GitHub Repo&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;All implementations include:&lt;br&gt;
• 🔍 Clear comments&lt;br&gt;
• 🧪 Test cases&lt;br&gt;
• ✅ Real-world applicability&lt;/p&gt;




&lt;p&gt;📍 Why This Matters&lt;/p&gt;

&lt;p&gt;Too often, people use one kind of queue for everything. Understanding which queue fits which problem leads to:&lt;br&gt;
• More scalable systems&lt;br&gt;
• Easier debugging&lt;br&gt;
• Faster performance&lt;/p&gt;

&lt;p&gt;Mastering queues isn’t just for computer science students — it’s for any developer working on backends, automation, data processing, or system design.&lt;/p&gt;




&lt;p&gt;🙌 Found this helpful?&lt;/p&gt;

&lt;p&gt;If you learned something new or found this guide useful, please consider:&lt;br&gt;
• 💬 Leaving a comment — I’d love to hear your thoughts or questions!&lt;br&gt;
• ❤️ Liking the post — it helps more developers discover this content.&lt;br&gt;
• 🔄 Sharing it with others who might benefit.&lt;/p&gt;

&lt;p&gt;Let’s keep learning and building together! 🚀&lt;/p&gt;

&lt;p&gt;Let's connect on &lt;a href="https://www.linkedin.com/in/arun-sai-veerisetty-609656a6" rel="noopener noreferrer"&gt;LinkedIn&lt;/a&gt;!&lt;/p&gt;

</description>
    </item>
    <item>
      <title>🚀 Chat With AI on Your Terminal – No API Key, No Limits, Just Python + Ollama</title>
      <dc:creator>Arun Sai Veerisetty</dc:creator>
      <pubDate>Sat, 31 May 2025 21:12:26 +0000</pubDate>
      <link>https://dev.to/arunsaiv/chat-with-ai-on-your-terminal-no-api-key-no-limits-just-python-ollama-5aia</link>
      <guid>https://dev.to/arunsaiv/chat-with-ai-on-your-terminal-no-api-key-no-limits-just-python-ollama-5aia</guid>
      <description>&lt;blockquote&gt;
&lt;p&gt;Why should I use a terminal-based AI chatbot when ChatGPT is just a browser tab away?&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;That’s a valid question — and this blog will give you a very good answer.&lt;/p&gt;

&lt;p&gt;Imagine this:&lt;br&gt;
• You’re working offline or with limited internet.&lt;br&gt;
• You want to explore open-source models like LLaMA 3 without any API restrictions.&lt;br&gt;
• You want full control over what happens under the hood.&lt;br&gt;
• You want to avoid rate limits and costs associated with commercial APIs.&lt;/p&gt;

&lt;p&gt;If any of that resonates, this project is for you.&lt;/p&gt;



&lt;p&gt;💡 The Problem with Web-Based AI&lt;/p&gt;

&lt;p&gt;As amazing as ChatGPT is, there are still a few limitations:&lt;br&gt;
• ⚠️ API costs add up fast if you’re prototyping regularly&lt;br&gt;
• 🔒 Privacy concerns — your data is processed in the cloud&lt;br&gt;
• 🌐 Requires a constant internet connection&lt;br&gt;
• 📈 Rate limits on free or developer-tier APIs&lt;br&gt;
• 🧪 Difficult to experiment with custom models or prompts&lt;/p&gt;

&lt;p&gt;Sometimes, all you need is a simple, local environment to build and test — without worrying about tokens, keys, or infrastructure.&lt;/p&gt;



&lt;p&gt;🔥 The Solution: A Local ChatGPT-Style CLI Tool&lt;/p&gt;

&lt;p&gt;This project lets you build and run your own ChatGPT-style chatbot in the terminal using:&lt;br&gt;
• 🐍 Python&lt;br&gt;
• 🤖 Ollama – an open-source local runtime for LLMs&lt;br&gt;
• ✅ Free &amp;amp; offline usage after the initial setup&lt;/p&gt;

&lt;p&gt;You’ll be chatting with a powerful AI model like LLaMA 3 without needing an OpenAI key or an internet connection.&lt;/p&gt;



&lt;p&gt;🧠 What Is Ollama?&lt;/p&gt;

&lt;p&gt;Ollama makes running large language models (LLMs) on your own device incredibly easy. It supports:&lt;br&gt;
• ⚡ Running LLaMA 3, Mistral, Gemma, and more&lt;br&gt;
• 🌐 Serving models via a local HTTP API&lt;br&gt;
• 🖥️ Compatible with macOS, Windows, and Linux&lt;/p&gt;

&lt;p&gt;With just one command, you can run models that used to require massive infrastructure.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;ollama run llama3
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;That’s it — it downloads and starts serving the model locally via &lt;a href="http://localhost:11434" rel="noopener noreferrer"&gt;http://localhost:11434&lt;/a&gt;.&lt;/p&gt;




&lt;p&gt;🛠️ What We Built&lt;/p&gt;

&lt;p&gt;We’ve built a cross-platform command-line chatbot with:&lt;br&gt;
• 💬 Seamless terminal chat experience&lt;br&gt;
• 🔁 Streaming responses like ChatGPT&lt;br&gt;
• ⌛ A “thinking…” indicator for better UX&lt;br&gt;
• 🧩 A pluggable design that can support any Ollama model&lt;br&gt;
• 🚀 Designed to be beginner-friendly, open-source, and fast to set up&lt;/p&gt;



&lt;p&gt;📦 GitHub Project&lt;/p&gt;

&lt;p&gt;🧠 Repo: &lt;a href="https://github.com/arunsaiv/ollama-cli-assistant" rel="noopener noreferrer"&gt;https://github.com/arunsaiv/ollama-cli-assistant&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;It’s open-source and beginner-friendly. You can clone it, run it, and tweak it.&lt;/p&gt;



&lt;p&gt;🧰 Prerequisites&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Python 3.8+&lt;/li&gt;
&lt;li&gt;Ollama installed – Download Ollama&lt;/li&gt;
&lt;li&gt;A supported LLM installed (e.g. ollama run llama3)&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;That’s all!&lt;/p&gt;



&lt;p&gt;🏃‍♂️ How to Run the Chatbot&lt;/p&gt;

&lt;p&gt;Clone and install:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;git clone https://github.com/arunsaiv/ollama-cli-assistant.git
cd ollama-cli-assistant
pip install -r requirements.txt
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;make sure your model is running:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;ollama run llama3
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The launch the assistant:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;python main.py
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Start chatting!&lt;/p&gt;




&lt;p&gt;🎥 What It Looks Like&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;You: What are embeddings?

💬 AI is thinking...

AI: Embeddings are numerical representations of data — such as words or sentences — that allow machines to understand and process language in a more meaningful way...
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The response is streamed word-by-word, just like ChatGPT.&lt;/p&gt;




&lt;p&gt;🧠 Why This Matters&lt;/p&gt;

&lt;p&gt;This isn’t just a neat little side project — it’s your gateway to:&lt;br&gt;
• 🔍 Learning how LLMs work under the hood&lt;br&gt;
• 🧪 Running experiments without worrying about billing&lt;br&gt;
• 🧱 Building AI tools and agents on top of open-source models&lt;br&gt;
• 💡 Understanding prompt engineering by tweaking things yourself&lt;br&gt;
• 🛠️ Customizing it to support additional commands, context, or tools&lt;/p&gt;




&lt;p&gt;🧭 What You Can Build Next&lt;/p&gt;

&lt;p&gt;This CLI is just the beginning. From here, you can:&lt;br&gt;
• Add conversation memory&lt;br&gt;
• Enable different models via CLI arguments&lt;br&gt;
• Use voice input/output (via speech_recognition or gTTS)&lt;br&gt;
• Build desktop wrappers with tools like Tauri or Electron&lt;br&gt;
• Integrate with your own documents (RAG-style)&lt;/p&gt;




&lt;p&gt;🏁 Wrap-Up&lt;/p&gt;

&lt;p&gt;This project was born out of curiosity — can we build a truly offline, fully functional chatbot using open tools?&lt;/p&gt;

&lt;p&gt;Turns out: Yes, and it’s awesome.&lt;/p&gt;

&lt;p&gt;This CLI might not replace ChatGPT for everyone, but it gives you freedom, control, and insight into how LLMs really work — all while avoiding cloud limits.&lt;/p&gt;




&lt;p&gt;📣 Final Thoughts&lt;/p&gt;

&lt;p&gt;If this project helped you learn something, feel free to:&lt;br&gt;
• ⭐ Star the GitHub repo&lt;br&gt;
• 🗨️ Leave a comment or question below&lt;br&gt;
• 🔁 Share this with someone who loves open-source AI&lt;br&gt;
• 📬 Follow for more hands-on projects!&lt;/p&gt;




</description>
    </item>
    <item>
      <title>🔍 How OCR Engines Like Tesseract Work – From Image to Text</title>
      <dc:creator>Arun Sai Veerisetty</dc:creator>
      <pubDate>Sat, 31 May 2025 00:57:47 +0000</pubDate>
      <link>https://dev.to/arunsaiv/how-ocr-engines-like-tesseract-work-from-image-to-text-55bn</link>
      <guid>https://dev.to/arunsaiv/how-ocr-engines-like-tesseract-work-from-image-to-text-55bn</guid>
      <description>&lt;p&gt;&lt;em&gt;Ever wondered how an app turns a scanned image into editable text? That’s the magic of OCR — Optical Character Recognition — and tools like Tesseract power much of this behind the scenes.&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;In this post, we’ll break down how OCR engines like Tesseract work, from reading pixels to returning readable characters.&lt;/p&gt;

&lt;p&gt;📌 What is OCR?&lt;/p&gt;

&lt;p&gt;OCR (Optical Character Recognition) is the process of converting images of printed or handwritten text into machine-readable digital text.&lt;/p&gt;

&lt;p&gt;It’s widely used in:&lt;br&gt;
• Digitizing documents and books&lt;br&gt;
• Automating data entry from invoices, ID cards, forms&lt;br&gt;
• Extracting text from scanned legal documents&lt;br&gt;&lt;br&gt;
• Building screen-scraping and automation tools&lt;/p&gt;



&lt;p&gt;🧠 How OCR Works – Step-by-Step&lt;/p&gt;

&lt;p&gt;Here’s a simplified pipeline of how OCR engines operate:&lt;/p&gt;



&lt;p&gt;1️⃣ Image Preprocessing&lt;/p&gt;

&lt;p&gt;Before OCR can recognize text, the image needs to be “cleaned up”:&lt;br&gt;
• Grayscale Conversion – remove color distractions&lt;br&gt;
• Noise Removal – remove shadows, blur, or background clutter&lt;br&gt;
• Thresholding – convert the image to black and white to separate text from background&lt;br&gt;
• Deskewing – straighten tilted documents&lt;/p&gt;



&lt;p&gt;2️⃣ Text Detection and Segmentation&lt;/p&gt;

&lt;p&gt;Once the image is clean:&lt;br&gt;
• OCR locates text blocks on the page&lt;br&gt;
• It segments lines, then words, then characters&lt;br&gt;
• This is crucial — bad segmentation leads to bad recognition&lt;/p&gt;



&lt;p&gt;3️⃣ Character Recognition&lt;/p&gt;

&lt;p&gt;This is where the core OCR happens:&lt;br&gt;
• Older engines used template matching&lt;br&gt;
• Modern engines like Tesseract v4+ use LSTM-based deep learning to recognize characters&lt;br&gt;
• It analyzes shapes, curves, and spacing to identify each character&lt;/p&gt;



&lt;p&gt;4️⃣ Post-Processing&lt;/p&gt;

&lt;p&gt;To improve accuracy:&lt;br&gt;
• Spellchecking or dictionary matching&lt;br&gt;
• Language modeling&lt;br&gt;
• Reconstructing line breaks, paragraphs, and tables&lt;/p&gt;



&lt;p&gt;🔧 How Tesseract Works (Under the Hood)&lt;/p&gt;

&lt;p&gt;Tesseract is an open-source OCR engine maintained by Google.&lt;/p&gt;

&lt;p&gt;Key features:&lt;br&gt;
• Supports 100+ languages&lt;br&gt;
• Uses LSTM (Long Short-Term Memory) neural networks for high accuracy&lt;br&gt;
• Works best when paired with preprocessing libraries like OpenCV&lt;/p&gt;

&lt;p&gt;Here’s a basic example using Python:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;import pytesseract
from PIL import Image

text = pytesseract.image_to_string(Image.open("sample.png"))
print(text)
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;This simple script can extract readable text from almost any image.&lt;/p&gt;




&lt;p&gt;⚠️ Common OCR Challenges&lt;/p&gt;

&lt;p&gt;Even modern engines struggle with:&lt;br&gt;
• Low-quality scans or handwritten text&lt;br&gt;
• Tables, forms, or multi-column layouts&lt;br&gt;
• Images with background patterns or logos&lt;br&gt;
• Non-standard fonts or languages&lt;/p&gt;

&lt;p&gt;That’s why OCR accuracy often depends heavily on preprocessing.&lt;/p&gt;




&lt;p&gt;🛠 Real-World Use Case&lt;/p&gt;

&lt;p&gt;In a previous project, I worked on automating the extraction of text from scanned IP (Intellectual Property) legal documents. Many of these had:&lt;br&gt;
• Watermarks&lt;br&gt;
• Inconsistent formatting&lt;br&gt;
• Complex tables&lt;/p&gt;

&lt;p&gt;By combining OpenCV preprocessing + Tesseract OCR, we achieved over 90% accuracy in text extraction — saving hours of manual review.&lt;/p&gt;




&lt;p&gt;✅ Conclusion&lt;/p&gt;

&lt;p&gt;OCR isn’t magic — it’s a combination of image processing, pattern recognition, and machine learning.&lt;/p&gt;

&lt;p&gt;Tesseract makes it possible to implement OCR in just a few lines of code, but understanding how it works helps you fine-tune results and apply it to real-world projects.&lt;/p&gt;

&lt;h1&gt;
  
  
  python #ocr #tesseract #webdev #automation #canada
&lt;/h1&gt;

</description>
    </item>
  </channel>
</rss>
