🚀 Just shipped my second open-source Python library: jsondiffhtml Diff two JSON files and get a modern, self-contained HTML report — themeable, no runtime dependencies, no CDN calls. Why I built it: At work, I kept needing to compare large JSON payloads (API responses, configs, fixtures) and explain the differences to non-engineers. Existing tools either dumped raw text diffs or required spinning up a web service. I wanted a single HTML file I could attach to a Jira ticket or Slack message — open it, see what changed, done. What's in v0.1.0: 🔍 Native diff engine — zero runtime dependencies 📍 JSON path + line-number tracking back to the source files 🎨 Themeable (custom primary color, logo, title) 📦 Self-contained HTML output — no network calls, works offline 🏷️ Per-item ignore + comment annotations, persisted in localStorage 📊 Auto-splits huge diffs across multiple files 🖥️ CLI included: json-diff a.json b.json -o report.html Install: pip install jsondiffhtml Links: 📦 PyPI: https://lnkd.in/dqWcyW3N 💻 GitHub: https://lnkd.in/dWEcbEer Built with Python 3.9+, MIT licensed. Feedback, issues, and PRs are very welcome 🙏 #Python #OpenSource #JSON #DeveloperTools #PyPI
jsondiffhtml: Modern JSON Diff Tool for Python
More Relevant Posts
-
Day 62 of #90DaysOfCode Today I upgraded my Flask blog from a static HTML blog into a dynamic blog powered by an external API. Previously, blog posts were written directly inside HTML templates. In this version, the application fetches blog data from an API and renders it dynamically using Flask and Jinja templates. What changed in the application • Connected the Flask app to an external API • Processed JSON data inside Flask • Passed backend data to templates • Used Jinja loops to dynamically render blog posts • Implemented dynamic routes for individual blog pages Now each blog post loads through a dynamic URL and renders its own page, making the application behave more like a real blog platform. Key concepts explored • API integration • JSON data handling • Dynamic routing in Flask • Jinja templating GitHub Repository https://lnkd.in/gceS7shg #Python #Flask #BackendDevelopment #WebDevelopment #SoftwareEngineering #90DaysOfCode
To view or add a comment, sign in
-
Day 41 of #60DaysOfMiniProjects Today I built an Unsent Message Web App using Python & Flask Not just another project… This one lets you express what you feel — without actually sending it. Some messages are never meant to be sent… but they still deserve to be written. What this system does: • Write messages to anyone anonymously • Stores messages securely in a file • Adds real-time timestamp • Simple and clean web interface • Built using Flask backend Why this project matters: • Helps you express emotions freely • Works like a personal emotional journal • Great for reflection and mental clarity • Shows how coding can solve real-life problems Concepts used: • Flask (Web Framework) • File Handling (Read/Write) • HTML Templates • Forms & POST requests • Date & Time module From CLI to Web App — leveling up step by step. Next improvements: • Add message viewing page • Add password protection • Store data in database (SQLite) • Improve UI design Building consistently. Learning daily. Improving step by step. #Python #Flask #WebDevelopment #MiniProjects #BuildInPublic #CodingJourney #DeveloperLife #LearningInPublic #60DaysOfCode
To view or add a comment, sign in
-
🔧 Django REST Framework Serializers — the unsung heroes of your API If you've worked with DRF, you know serializers are more than just "JSON converters." They're the gatekeepers of your entire data layer. Here's what makes them genuinely powerful: 1) Validation built-in — field-level and object-level validation in one place. No extra form logic, no scattered checks. 2) Nested relationships — serialize related models automatically, or override with custom logic when you need it. 3) Read/write separation — use read_only / write_only fields cleanly, without duplicating code. 4) ModelSerializer — auto-generates fields from your model. Less boilerplate, faster iteration. 5) SerializerMethodField — add any computed property to your API response without touching the model. One underrated pattern: using serializers for input validation outside of views — in Celery tasks, management commands, anywhere you're ingesting untrusted data. Serializers are where your API contract actually lives. Treat them with the same care you'd give your models. What's your go-to serializer trick? Comment below! #Django #DRF #Python #BackendDevelopment #WebDevelopment #SoftwareEngineering
To view or add a comment, sign in
-
-
This one Django mistake made my query 12 seconds slow, and I realize it for hours.... 12 seconds… for a simple page. At first, I thought: “Maybe my system is slow.” But the real problem was my query. Here’s what was wrong 👇 I was doing this: • Fetching all records • Looping in Python to filter data • Multiple DB hits inside a loop Basically… I made Django work harder than needed. Here’s what fixed it: ✅ Used `select_related()` to reduce joins ✅ Used `prefetch_related()` for reverse relations ✅ Moved filtering logic into the database ✅ Avoided unnecessary loops Result? ⚡ Query time dropped from 12 sec → under 1 sec Big lesson: If your Django app feels slow, don’t blame Django… Check how you’re querying the database. Most of the time, the problem is not the framework — it’s the query. Have you ever faced slow queries in Django? What was your fix? #django #backend #python #query #developer
To view or add a comment, sign in
-
-
Supply Chains this, Supply Chains that, we all know the deal lately 🫠 I pulled together a new post on hardening the software supply chain with good practices, sprinkled in with some recent and cited write-ups (including public reporting and analysis around incidents like LiteLLM on PyPI, Shai-Hulud, etc etc) I also lined that up with what I’ve actually done locking down npm / JavaScript, Python, and Go in my own pipelines: hash-aware lockfiles (specifically with Python), attestations, cooldowns on brand-new releases, continuous dependency scanning across the full tree, why SBOMs matter once they’re saved as build artifacts and why one measure isn't a silver bullet, all the good stuff. If you’re tired of “pin the version and hope" (spoiler alert, it's not enough) then it’s a practical read. 😆 Read it here: https://lnkd.in/gXuB57Ah #SoftwareSupplyChain #DevSecOps #AppSec #npm #go #pip #uv #python #SCA
To view or add a comment, sign in
-
💡Django tip Fix Race Conditions in Django: #python #django #sql #api Every high-traffic store, ticketing platform, or booking system has this silent killer: two users hit "Buy" at the same millisecond, both see stock = 1, both complete — now you've sold something you don't have. select_for_update() locks the row at the database level so only one transaction wins. Important notes on the code 1 nowait=True — fails immediately under contention instead of silently queuing, giving the API a fast, explicit error response 2 save(update_fields=['stock']) — writes only the changed column, not the entire row 3 Custom exceptions (OutOfStockError, InsufficientQuantityError) — clean separation between "no stock at all" vs "not enough stock" 4 Logic extracted into a services.py layer — keeps views thin and the purchase logic fully testable in isolation OutOfStockError Triggered when stock == 0 — the product has absolutely nothing left. No amount of reducing quantity will help. InsufficientQuantityError Triggered when stock > 0 but less than what the user requested — there's some stock, just not enough for this order. #tip #tips #tipoftheday
To view or add a comment, sign in
-
-
I noticed that every time I start a new Python project, I repeat the same steps again and again. create virtual environment select python version setup basic project structure configure environment install dependencies It takes time, and each project setup becomes slightly different. If you have used npm, you know how simple it is to start a project. It works smoothly across many JavaScript frameworks with a consistent workflow. But in Python, setting up a new development environment is still not that simple. Each time we configure things manually, and the process is not standardized. So I built 𝗱𝗲𝘃𝗶𝘁-𝗰𝗹𝗶. It is a simple CLI tool that initializes a Python development environment in seconds. Just run: 𝗱𝗲𝘃𝗶𝘁 𝗶𝗻𝗶𝘁 During setup you can choose: 𝗣𝗿𝗼𝗷𝗲𝗰𝘁 𝘁𝘆𝗽𝗲 • Python Package • FastAPI • Django • AWS Scripts 𝗘𝗻𝘃𝗶𝗿𝗼𝗻𝗺𝗲𝗻𝘁 • New venv • Existing Python interpreter • New conda • Existing conda env • Skip 𝗣𝘆𝘁𝗵𝗼𝗻 𝘃𝗲𝗿𝘀𝗶𝗼𝗻 • for example 3.11 Reduce repetitive setup work and keep project structure consistent o7. 𝗣𝘆𝗣𝗜: https://lnkd.in/g2VzfWFy Feedback is welcome. #python #opensource #cli #developer #automation #devtools #productivity
To view or add a comment, sign in
-
-
I built a Code Architecture Generator that automatically visualizes Python code structure. 🏗️ THE PROBLEM: When you join a new project or revisit old code, understanding the structure is painful. You spend hours reading through hundreds of lines just to find functions and classes. THE SOLUTION: A tool that does this automatically. Upload any Python file, and instantly see: - All functions and classes - Methods inside each class - Code metrics dashboard - Visual architecture diagram HOW IT WORKS (Technical Deep Dive): 🔹 AST PARSING Python's Abstract Syntax Tree (AST) converts code into a tree structure. My tool walks through this tree and extracts every function, class, and method without executing the code. 🔹 CODE METRICS DASHBOARD Automatically calculates: - Total lines of code - Number of functions - Number of classes - Number of methods - Longest function (lines) - Maximum parameters per function 🔹 ARCHITECTURE DIAGRAM Converts the extracted structure into a visual flowchart using Mermaid.js. Shows parent-child relationships between classes and methods. 🔹 EXPORT OPTIONS - Download as Mermaid code (for further editing) - Download as HTML (opens in any browser) - Download as text report (for documentation) 🔹 FILE SUPPORT - Single Python files (.py) - ZIP folders with multiple files (analyzes first 10 files) TECH STACK: - Python (core logic) - AST (code parsing) - Streamlit (web interface) - Mermaid.js (diagram generation) WHAT I LEARNED: - How Python internally understands code (AST) - Tree traversal algorithms - Converting code structure to visual graphs - Building full-stack web apps with Streamlit - Professional Git/GitHub practices #Python #Streamlit #SoftwareEngineering #Coding #AST #BackendDeveloper #PythonDeveloper #OpenToWork
To view or add a comment, sign in
-
Django's ORM can't do complex filtering with chained .filter() calls alone. Filter chaining works for AND conditions. For OR conditions, for negations, for dynamic query composition - it silently does the wrong thing or fails entirely. Q() objects are Django's answer - composable query expressions that map directly to SQL boolean algebra. 1. Each Q() object wraps a condition. 2. Conditions combine using Python operators - & → SQL AND, | → SQL OR, ~ → SQL NOT 3. Django takes the composed expression tree and compiles it into a single WHERE clause. The trap - operator precedence. Python evaluates & before | - exactly like multiplication before addition. Takeaway - -> .filter().filter() → always AND → no OR, no NOT without Q() -> Q() & Q() → AND, Q() | Q() → OR, ~Q() → NOT → maps directly to SQL boolean algebra -> & binds tighter than | → always use parentheses in complex expressions -> Q() objects are composable Python - build query logic dynamically without raw SQL What's the most complex dynamic filter you've had to build? Did Q() hold up or did you reach for raw SQL? #Python #Django #BackendDevelopment #SoftwareEngineering
To view or add a comment, sign in
-
-
Day 02 of 30 | Django MVT Pattern 🐍 Before writing any code in Django, you need to understand how it thinks. MVT = Model + View + Template. Every request your user makes follows this exact flow: → Browser sends a request → urls.py routes it to the right View → View asks the Model for data → Model queries the database → View sends data to the Template → Template renders HTML and returns it to the browser I made a video explaining each part. My English is A2. The diagram helps. 👀 #Django #Python #30DaysOfDjango #LearningInPublic #Developer #SaaS
To view or add a comment, sign in
Explore related topics
Explore content categories
- Career
- Productivity
- Finance
- Soft Skills & Emotional Intelligence
- Project Management
- Education
- Technology
- Leadership
- Ecommerce
- User Experience
- Recruitment & HR
- Customer Experience
- Real Estate
- Marketing
- Sales
- Retail & Merchandising
- Science
- Supply Chain Management
- Future Of Work
- Consulting
- Writing
- Economics
- Artificial Intelligence
- Employee Experience
- Workplace Trends
- Fundraising
- Networking
- Corporate Social Responsibility
- Negotiation
- Communication
- Engineering
- Hospitality & Tourism
- Business Strategy
- Change Management
- Organizational Culture
- Design
- Innovation
- Event Planning
- Training & Development