The Python smtplib library is a built-in module that provides a straightforward way to send emails using SMTP: this post provides an hands-on example showing how to add HTML email notification to an existing scirpt, which generate a report from a JINJA2 template. The provided code supports every kind of SMTP connection - SMTP, SMTP with startTLS and SMTPS, and illustrates also the use of argparse to process command line option. The skills illustrated in this post are a must have bit for your DevSecOps pipelines. #pyhton #smtplib https://lnkd.in/eHAjj-s7
How to send HTML emails with Python smtplib
More Relevant Posts
-
I just finished up creating an automated File Verification workflow that is helpful for any company who utilizes GitHub repos for their work. This project showed me how powerful automation can be when you combine the right tools. By linking GitHub Actions, Python, and CloudWatch, I created a system that enforces repository standards without anyone having to manually check each pull request. The Python script handles the validation logic, GitHub Actions runs it automatically at the right times, and CloudWatch captures everything for audit purposes. The biggest lesson I learned was that debugging CI/CD pipelines requires patience — especially when dealing with things like timestamp formatting and shell quote parsing that work fine locally but break in the workflow environment. Each error taught me something about how these systems interact, and troubleshooting the CloudWatch logging step gave me hands-on experience with AWS CLI commands and IAM permissions. What I built here is scalable too. If Level Up Bank wanted to check for additional files or add more validation rules, I could easily expand the Python script’s required files list or add new validation logic. The same workflow structure would handle it without major changes. This pipeline demonstrates a practical approach to maintaining code quality standards across multiple repositories while keeping leadership informed through centralized logging — exactly what modern platform engineering teams need.
To view or add a comment, sign in
-
🚀 Why 𝗙𝗮𝘀𝘁𝗔𝗣𝗜 is the Game-Changer in Python API Development If you're building high-performance, modern APIs in Python, you need to know about 𝗙𝗮𝘀𝘁𝗔𝗣𝗜. It's rapidly becoming the go-to framework for its incredible speed and developer experience. ✨ Key Features & Benefits: ⚡ 𝗕𝗹𝗮𝘇𝗶𝗻𝗴 𝗙𝗮𝘀𝘁 𝗣𝗲𝗿𝗳𝗼𝗿𝗺𝗮𝗻𝗰𝗲: It's one of the fastest Python web frameworks, thanks to being built on 𝗦𝘁𝗮𝗿𝗹𝗲𝘁𝘁𝗲 and leveraging Python's asynchronous features (async/await). It handles high traffic efficiently. 🐍 𝗧𝘆𝗽𝗲 𝗦𝗮𝗳𝗲𝘁𝘆 & 𝗙𝗲𝘄𝗲𝗿 𝗕𝘂𝗴𝘀: FastAPI uses standard Python 𝗧𝘆𝗽𝗲 𝗛𝗶𝗻𝘁𝘀(integrated with 𝗣𝘆𝗱𝗮𝗻𝘁𝗶𝗰). This provides: Automatic data 𝘃𝗮𝗹𝗶𝗱𝗮𝘁𝗶𝗼𝗻 and serialization. 𝗚𝗿𝗲𝗮𝘁 𝗲𝗱𝗶𝘁𝗼𝗿 𝘀𝘂𝗽𝗽𝗼𝗿𝘁 (autocompletion and type checks). A reported 𝟰𝟬% 𝗿𝗲𝗱𝘂𝗰𝘁𝗶𝗼𝗻 in human-induced errors. 📖 𝗔𝘂𝘁𝗼𝗺𝗮𝘁𝗶𝗰 𝗗𝗼𝗰𝘂𝗺𝗲𝗻𝘁𝗮𝘁𝗶𝗼𝗻: It automatically generates interactive API documentation (using 𝗢𝗽𝗲𝗻𝗔𝗣𝗜/𝗦𝘄𝗮𝗴𝗴𝗲𝗿 𝗨𝗜 and 𝗥𝗲𝗗𝗼𝗰), saving significant development time and making your API easy for others to consume and test. 🛠️ 𝗣𝗿𝗼𝗱𝘂𝗰𝘁𝗶𝗼𝗻 𝗥𝗲𝗮𝗱𝘆: It includes built-in support for 𝗗𝗲𝗽𝗲𝗻𝗱𝗲𝗻𝗰𝘆 𝗜𝗻𝗷𝗲𝗰𝘁𝗶𝗼𝗻 and 𝗦𝗲𝗰𝘂𝗿𝗶𝘁𝘆 (like OAuth2 and JWT). 🎯 Ideal Use Cases: FastAPI is an excellent choice for: Building high-speed 𝗥𝗘𝗦𝗧𝗳𝘂𝗹 𝗔𝗣𝗜𝘀. Developing scalable 𝗠𝗶𝗰𝗿𝗼𝘀𝗲𝗿𝘃𝗶𝗰𝗲𝘀. Creating 𝗥𝗲𝗮𝗹-𝗧𝗶𝗺𝗲 𝗔𝗽𝗽𝗹𝗶𝗰𝗮𝘁𝗶𝗼𝗻𝘀 (like chat apps or streaming services). #Python #FastAPI #WebDevelopment #API #Microservices #TechStack #Developers
To view or add a comment, sign in
-
🔝 Top Python Libraries for Test Automation in 2025 Python continues to dominate the testing world — not just because it's easy to learn, but because its ecosystem is packed with powerful, reliable libraries that make automation faster and smarter. Here are the top libraries every tester should know 👇 🧪 1. PyTest – The Gold Standard * Simple, powerful, extensible * Perfect for API, UI (with plugins), and unit testing * Rich fixtures + clean reporting 🧠 2. Robot Framework – Keyword-Driven Power * Human-readable syntax * Ideal for large automation projects * Tons of integrations and plugins 🌐 3. Requests – For All Things API * The easiest way to test REST APIs * Clean syntax & wide adoption 🕸️ 4. Selenium – UI Automation Classic * Fully supports Python * Still the most used tool for web UI automation 🤖 5. Playwright – Modern Browser Automation * Faster, stable, powerful * Supports parallel testing out of the box 📊 6. Pandas – For Data Validation * Perfect for ETL testing, file validations, and data comparisons ⚙️ 7. Behave – For BDD Projects * Natural-language (Gherkin) style * Great for teams practicing BDD 🚀 Why it matters: The right library doesn’t just speed up automation — it increases reliability, coverage, and confidence in releases. 💬 What’s your go-to Python library for test automation?
To view or add a comment, sign in
-
-
"𝗕𝘂𝗱𝗴𝗲𝘁: 250.0 USD - 750.0 USD ↓↓↓ 𝗧𝗶𝘁𝗹𝗲: Python IB Trading Bot Upgrade I already have a Python bot that places trades through the Interactive Brokers API according to a set of hard-coded rules. Before I move it into live deployment I need an experienced developer to audit the code, remove the bugs that occasionally block orders, and then extend its feature set. Current state • Written in Python 3.x, calling the native IB API and a lightweight websocket wrapper. • Executes trades whenever pre-set price and volume conditions are met. • Runs headless on an Ubuntu VPS. What I want next 1. Robust connection management so the bot automatically re-authenticates and resubscribes when the IB gateway drops. 2. A new layer of market-sentiment logic that can interpret social-media or news feeds (you may recommend APIs) and inject those signals into the existing decision tree. 3. A clean, well-commented refactor that leaves me with a functional prototype I can step through in a debugger. Deliverables • Reviewed and cleaned source code with explanatory comments. • Modular sentiment-analysis component (Python class or package) wired into the trading flow. • Connection-handling utilities that log, retry, and alert on failures. • A short README covering setup, environment variables, and a test procedure I can reproduce. You will have SSH access to a staging VPS and paper-trading credentials. Please be comfortable with pandas, asyncio, and the nuances of the IB API rate limits. Unit tests or notebooks that demonstrate the new logic are a plus." #Python #AlgorithmicTrading #InteractiveBrokers #TradingBot #FinTech #SentimentAnalysis #CodeRefactoring #AsyncIO #APIIntegration #UbuntuVPS → https://lnkd.in/d59PYv8V
To view or add a comment, sign in
-
Anyone use OpenAPI? Would development be easier with an up-to-date CLI? Announcing Python openapi-spec-tools to help. You can install using 'pip install openapi-spec-tools', and generate a CLI by running 'cli-gen generate openapi.yaml my.cli.package'. This is the fastest way, but there are many options to generate a more sophisticated, tailored CLI. This is an open-source project available at https://lnkd.in/eQJCbZtq. I welcome feature suggestions and code submissions.
To view or add a comment, sign in
-
I wanted to share this. It's a look at the Agent Development Kit (ADK) Samples repository. This is a great collection of ready-to-use AI agents. It's designed to help developers speed up their work. The repository has samples for both Python and Java. You can find everything from simple conversational bots to more complex multi-agent workflows. If you're working with AI agents, this looks like a very useful resource for getting started and seeing how they are built. You can find the full repository here: https://lnkd.in/gDRux4qe
To view or add a comment, sign in
-
What makes #zipapp interesting is that it lives entirely inside the standard library, which means no external tools or build systems are required. You can take a folder of #Python scripts, structure it with a proper entry point, and turn it into one .pyz file that runs with a single command. For internal utilities, command-line tools, or small automation scripts, this feels almost elegant. It’s lightweight, predictable, and easy to integrate into automated workflows. When Python runs a .pyz file, it treats the archive as if it were a regular package on sys.path. The interpreter looks for __main__.py and executes it as the entry point. This design keeps startup time minimal and makes debugging straightforward since it behaves like normal Python code. You can even compress the archive, although that adds a small overhead on load..... The real trade-off comes with complexity. Zipapp shines for pure Python code, but once your project starts depending on compiled extensions or large external libraries, things get messy.....in the most ballistic trend lol Another practical point is that #zipapps don’t remove the need for Python to be installed on the target machine. They’re not native executables. They’re just portable Python apps. So, in #deployment scenarios where the target environment may not have Python, this approach won’t fully replace tools like PyInstaller or Nuitka. I'd say if your goal is small, portable, and pure-Python #automation or scripting, zipapp is worth mastering. If you need full dependency isolation or compiled libraries, it’s a stepping stone just not the destination you might headed to..... https://lnkd.in/exZW-rnY
To view or add a comment, sign in
-
Wanna learn 𝗗𝗼𝗰𝗸𝗲𝗿? 📦 Let's write your first Dockerfile in 𝟱 𝘀𝘁𝗲𝗽𝘀 👨💻↓ 𝗪𝗵𝗮𝘁 𝗶𝘀 𝗮 𝗗𝗼𝗰𝗸𝗲𝗿𝗳𝗶𝗹𝗲? A Dockerfile is a text file that entirely defines the environment where your Python application runs, for example your ML traning script. From a Dockerfile you can create a Docker image $ 𝐝𝐨𝐜𝐤𝐞𝐫 𝐛𝐮𝐢𝐥𝐝 -𝐭 𝐦𝐲-𝐢𝐦𝐚𝐠𝐞 . And from a Docker image you can spin up a Docker container $ 𝐝𝐨𝐜𝐤𝐞𝐫 𝐫𝐮𝐧 𝐦𝐲-𝐢𝐦𝐚𝐠𝐞 Let me show you how to write a Dockerfile for your ML training scripts. 𝗘𝘅𝗮𝗺𝗽𝗹𝗲 This is your initial folder structure, with an empty Dockerfile 𝐦𝐥-𝐩𝐫𝐨𝐣𝐞𝐜𝐭 ↳ 𝐃𝐨𝐜𝐤𝐞𝐫𝐟𝐢𝐥𝐞 ↳ 𝐫𝐞𝐪𝐮𝐢𝐫𝐞𝐦𝐞𝐧𝐭𝐬.𝐭𝐱𝐭 ↳ 𝐬𝐫𝐜 ↳ 𝐭𝐫𝐚𝐢𝐧.𝐩𝐲 Let's write our Dockerfile, in 5 steps 𝗦𝘁𝗲𝗽 1️⃣ 𝗦𝗲𝗹𝗲𝗰𝘁 𝘆𝗼𝘂𝗿 𝗯𝗮𝘀𝗲 𝗹𝗮𝘆𝗲𝗿 ↳ 𝗙𝗥𝗢𝗠 𝗽𝘆𝘁𝗵𝗼𝗻:𝟯.𝟭𝟬.𝟯-𝘀𝗹𝗶𝗺-𝗯𝘂𝘀𝘁𝗲𝗿 This is the foundation upon which you build subsequent layers. If you use Python I recommend you use an official python image, like python:3.11-slim 𝗦𝘁𝗲𝗽 2️⃣ 𝗦𝗲𝘁 𝗲𝗻𝘃𝗶𝗿𝗼𝗻𝗺𝗲𝗻𝘁 𝘃𝗮𝗿𝗶𝗮𝗯𝗹𝗲 𝗱𝗲𝗳𝗮𝘂𝗹𝘁𝘀 ↳ 𝗘𝗡𝗩 𝗣𝗬𝗧𝗛𝗢𝗡𝗨𝗡𝗕𝗨𝗙𝗙𝗘𝗥𝗘𝗗=𝟭 In this case, setting PYTHONUNBUFFERED ensures all the Python code output shows up in real-time on our Docker console 𝗦𝘁𝗲𝗽 3️⃣ 𝗖𝗼𝗽𝘆 𝘀𝗼𝘂𝗿𝗰𝗲 𝗳𝗶𝗹𝗲𝘀 𝗶𝗻𝘁𝗼 𝘁𝗵𝗲 𝗰𝗼𝗻𝘁𝗮𝗶𝗻𝗲𝗿 ↳ 𝗖𝗢𝗣𝗬 . 𝗮𝗽𝗽/ Copy the requirements.txt file and your source code files from your local disk into the container. 𝗦𝘁𝗲𝗽 4️⃣ 𝗜𝗻𝘀𝘁𝗮𝗹𝗹 𝗣𝘆𝘁𝗵𝗼𝗻 𝗱𝗲𝗽𝗲𝗻𝗱𝗲𝗻𝗰𝗶𝗲𝘀 ↳ 𝗥𝗨𝗡 𝗽𝘆𝘁𝗵𝗼𝗻𝟯 -𝗺 𝗽𝗶𝗽 𝗶𝗻𝘀𝘁𝗮𝗹𝗹 --𝗻𝗼-𝗰𝗮𝗰𝗵𝗲-𝗱𝗶𝗿 -𝗿 𝗿𝗲𝗾𝘂𝗶𝗿𝗲𝗺𝗲𝗻𝘁𝘀.𝘁𝘅𝘁 pip install all the Python dependencies your code needs to run 𝗦𝘁𝗲𝗽 5️⃣ 𝗦𝗲𝘁 𝘁𝗵𝗲 𝗲𝗻𝘁𝗿𝘆𝗽𝗼𝗶𝗻𝘁 ↳ 𝗘𝗡𝗧𝗥𝗬𝗣𝗢𝗜𝗡𝗧 ["𝗽𝘆𝘁𝗵𝗼𝗻𝟯", "𝘀𝗿𝗰/𝗺𝗮𝗶𝗻.𝗽𝘆"] This is the default command to run when you spin up your container. In this case, you kick off your training job. BOOM! You training script is now ready for production 🚀 ---- Hi there! It's Pau Labarta Bajo 👋 Every day I share free, hands-on content, on production-grade ML, to help you build real-world ML products. 𝗙𝗼𝗹𝗹𝗼𝘄 𝗺𝗲 and 𝗰𝗹𝗶𝗰𝗸 𝗼𝗻 𝘁𝗵𝗲 🔔 so you don't miss what's coming next #machinelearning #realtimedata #mlops #realworldml #docker
To view or add a comment, sign in
-
-
Python tarfile Supply Chain Risk (CVE-2025-4517): A vulnerability in the standard library's tarfile module exposes supply chain risks, particularly in automated systems that process untrusted archives.
To view or add a comment, sign in
-
Requests worked fine for years. Then async happened. Now 100 HTTP calls take 0.19 seconds instead of 10. The gap isn't small. I've watched this shift happen in real-time. HTTPX isn't just another Python library. It's solving problems that Requests simply can't. The numbers tell the story: • HTTPX: 100 concurrent requests in 0.19 seconds • Requests: Same task takes over 10 seconds • Even in sync mode, HTTPX runs nearly twice as fast But speed isn't everything. HTTPX brings features that matter: 🚀 Native async/await support 🔗 HTTP/2 capabilities ⚡ Better connection pooling 🎯 Drop-in compatibility with Requests The Django Rest Framework team built this. They know what modern Python applications need. Requests still works great for simple tasks. But if you're building anything that handles multiple HTTP calls, HTTPX makes sense. One library. Both sync and async. Future-proof. The performance difference in concurrent operations isn't marginal. It's an order of magnitude better. What's holding you back from making the switch? #Python #AsyncProgramming #Python #Async #WebDevelopment 𝗦𝗼𝘂𝗿𝗰𝗲: https://lnkd.in/eV2KkxUR
To view or add a comment, sign in
More from this author
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
Marco Antonio Carcano keep up the good stuff, you're always on the brink!