<?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: Joseph bwalya</title>
    <description>The latest articles on DEV Community by Joseph bwalya (@joseph_bwalya).</description>
    <link>https://dev.to/joseph_bwalya</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%2F2896582%2F100dbbe5-820b-4166-a3f1-2791e4a80374.png</url>
      <title>DEV Community: Joseph bwalya</title>
      <link>https://dev.to/joseph_bwalya</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/joseph_bwalya"/>
    <language>en</language>
    <item>
      <title>Send Bulk Emails with Ease Using Python: A Guide to Efficient Email API Integration</title>
      <dc:creator>Joseph bwalya</dc:creator>
      <pubDate>Wed, 16 Jul 2025 14:58:47 +0000</pubDate>
      <link>https://dev.to/joseph_bwalya/send-bulk-emails-with-ease-using-python-a-guide-to-efficient-email-api-integration-4fpe</link>
      <guid>https://dev.to/joseph_bwalya/send-bulk-emails-with-ease-using-python-a-guide-to-efficient-email-api-integration-4fpe</guid>
      <description>&lt;p&gt;In today’s digital world, email communication remains one of the most powerful tools for engaging with users. Whether you're sending newsletters, verification codes, or marketing campaigns, having the ability to &lt;a href="https://rapidapi.com/johnmfula/api/send-bulk-emails/playground/apiendpoint_aa96cb97-4ab9-4392-b50d-c7fc16197767" rel="noopener noreferrer"&gt;send bulk emails &lt;/a&gt;programmatically can save time and increase efficiency.&lt;/p&gt;

&lt;p&gt;In this article, you'll learn how to integrate a Bulk Email Sending API using Python to send transactional or mass emails with ease.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Why Use an Email API for Bulk Sending?&lt;/strong&gt;&lt;br&gt;
Using an Email API allows you to:&lt;/p&gt;

&lt;p&gt;Automate sending large volumes of emails.&lt;/p&gt;

&lt;p&gt;Track delivery and open rates.&lt;/p&gt;

&lt;p&gt;Customize emails dynamically.&lt;/p&gt;

&lt;p&gt;Improve deliverability using SMTP gateways and verified domains.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;API Endpoint Overview&lt;/strong&gt;&lt;br&gt;
We’ll be working with the following API:&lt;/p&gt;

&lt;p&gt;Endpoint:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;https://send-bulk-emails.p.rapidapi.com/api/send/otp/mail
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;This endpoint sends a simple OTP or custom email to the specified recipient.&lt;/p&gt;

&lt;p&gt;Required Headers&lt;br&gt;
You’ll need to include the following headers with your request:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;Content-Type: application/json  
x-rapidapi-host: send-bulk-emails.p.rapidapi.com  
x-rapidapi-key: YOUR_RAPIDAPI_KEY
Replace YOUR_RAPIDAPI_KEY with your actual key from RapidAPI.

**Sample Email JSON Payload**
Here’s the structure of the data you’ll send:

{
  "subject": "Account OTP",
  "from": "gateway.smtp587@gmail.com",
  "to": " gateway.smtp587@gmail.com ",
  "senders_name": "Company Name",
  "body": "Your OTP is 12453"
}
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;You can customize the fields to suit your business logic, e.g., dynamic names or codes.&lt;/p&gt;

&lt;p&gt;Python Code to &lt;a href="https://rapidapi.com/johnmfula/api/send-bulk-emails/playground/apiendpoint_aa96cb97-4ab9-4392-b50d-c7fc16197767" rel="noopener noreferrer"&gt;Send Bulk Emails&lt;/a&gt;&lt;br&gt;
Here is a simple script using Python and the requests library:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;import requests
import json

url = "https://send-bulk-emails.p.rapidapi.com/api/send/otp/mail"

payload = {
    "subject": "Account OTP",
    "from": "gateway.smtp587@gmail.com",
    "to": " gateway.smtp587@gmail.com",
    "senders_name": "Company Name",
    "body": "Your OTP is 12453"
}

headers = {
    "Content-Type": "application/json",
    "x-rapidapi-host": "send-bulk-emails.p.rapidapi.com",
    "x-rapidapi-key": "6fba124bddmsh85209fcbdd66c1bp11d81ajsn03828f70971d"  # Replace with your own key
}

response = requests.post(url, data=json.dumps(payload), headers=headers)

# Output the response
print("Status Code:", response.status_code)
print("Response Body:", response.json())
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Expected Response&lt;br&gt;
A successful response will typically return a confirmation message like:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;{
  "success": true,
  "message": "Email sent successfully."
}
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Security Note&lt;br&gt;
Do not expose your API key in client-side code or public repositories. Store it securely using environment variables or secret management tools.&lt;/p&gt;

&lt;p&gt;Conclusion&lt;br&gt;
Integrating an &lt;a href="https://rapidapi.com/johnmfula/api/send-bulk-emails/playground/apiendpoint_aa96cb97-4ab9-4392-b50d-c7fc16197767" rel="noopener noreferrer"&gt;email API&lt;/a&gt; into your application is a game-changer for business communication. Whether you're verifying users, sending alerts, or promoting services, this setup in Python gives you the foundation to build scalable email capabilities.&lt;/p&gt;

</description>
    </item>
    <item>
      <title>Loan Calculation Using Python: A Step-by-Step Guide</title>
      <dc:creator>Joseph bwalya</dc:creator>
      <pubDate>Mon, 24 Feb 2025 13:37:56 +0000</pubDate>
      <link>https://dev.to/joseph_bwalya/loan-calculation-using-python-a-step-by-step-guide-3ef5</link>
      <guid>https://dev.to/joseph_bwalya/loan-calculation-using-python-a-step-by-step-guide-3ef5</guid>
      <description>&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fbfmgm04tv9mgn3f94dl3.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fbfmgm04tv9mgn3f94dl3.png" alt="Image description" width="800" height="450"&gt;&lt;/a&gt;In today's world, loans are an integral part of personal and business finance. Whether you're buying a home, financing a car, or starting a business, understanding how loans work is crucial. One of the most important aspects of a loan is the amortization schedule, which breaks down each payment into principal and interest components. In this blog post, we'll explore how to &lt;a href="https://rapidapi.com/johnmfula/api/loan-amortization-calculator1/playground/apiendpoint_19ab5380-a6c7-41ea-9c42-f4058c90dbed" rel="noopener noreferrer"&gt;calculate loan amortization&lt;/a&gt; using Python and an API. We'll also create a dynamic table to display the results.&lt;/p&gt;

&lt;p&gt;Understanding Loan Amortization&lt;br&gt;
Before diving into the code, let's briefly discuss what loan amortization is. Amortization is the process of spreading out a loan into a series of fixed payments over time. Each payment consists of two parts:&lt;/p&gt;

&lt;p&gt;Principal: The amount of the loan that is being paid off.&lt;/p&gt;

&lt;p&gt;Interest: The cost of borrowing the money.&lt;/p&gt;

&lt;p&gt;The amortization schedule is a table that shows the breakdown of each payment, including the remaining balance after each payment.&lt;/p&gt;

&lt;p&gt;Setting Up the Environment&lt;br&gt;
To get started, you'll need Python installed on your machine. You'll also need to install the requests library, which allows you to make HTTP requests in Python. You can install it using pip:&lt;br&gt;
&lt;/p&gt;

&lt;p&gt;&lt;code&gt;pip install requests&lt;/code&gt;&lt;br&gt;
&lt;/p&gt;

&lt;p&gt;Making the API Request&lt;br&gt;
We'll be using the &lt;a href="https://rapidapi.com/johnmfula/api/loan-amortization-calculator1/playground/apiendpoint_19ab5380-a6c7-41ea-9c42-f4058c90dbed" rel="noopener noreferrer"&gt;Loan Amortization Calculator API from RapidAPI&lt;/a&gt; to calculate the loan schedule. The API requires the following parameters:&lt;/p&gt;

&lt;p&gt;loan_amount: The total amount of the loan.&lt;/p&gt;

&lt;p&gt;annual_interest_rate: The annual interest rate (in percentage).&lt;/p&gt;

&lt;p&gt;num_payments: The number of payments.&lt;/p&gt;

&lt;p&gt;extra_payment: Any extra payment made (default is 0).&lt;/p&gt;

&lt;p&gt;frequency: The frequency of payments (e.g., monthly, quarterly).&lt;/p&gt;

&lt;p&gt;Here's how you can make a POST request to the API 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 requests

url = "https://loan-amortization-calculator1.p.rapidapi.com/api/calculate/amortization"

payload = {
    "loan_amount": 10000,
    "annual_interest_rate": 7,
    "num_payments": 3,
    "extra_payment": 0,
    "frequency": "monthly"
}

headers = {
    'Content-Type': 'application/json',
    'x-rapidapi-host': 'loan-amortization-calculator1.p.rapidapi.com',
    'x-rapidapi-key': 'cee0d12e3dmshd8cc8a3c884fcbdp1c2d92jsnd916f6092b82'
}

response = requests.post(url, json=payload, headers=headers)

if response.status_code == 200:
    data = response.json()
    print(data)
else:
    print(f"Error: {response.status_code}")
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Parsing the API Response&lt;br&gt;
The API response will be in JSON format, which we can easily parse in Python. Here's a sample response:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;{
    "data": {
        "loan_amount": 10000,
        "payments": [
            {
                "closing_balance": 6686.04,
                "interest": 58.33,
                "opening_balance": 10000,
                "payment": 3372.3,
                "period": 1,
                "principal_payment": 3313.96
            },
            {
                "closing_balance": 3352.74,
                "interest": 39.0,
                "opening_balance": 6686.04,
                "payment": 3372.3,
                "period": 2,
                "principal_payment": 3333.3
            },
            {
                "closing_balance": 0.0,
                "interest": 19.56,
                "opening_balance": 3352.74,
                "payment": 3372.3,
                "period": 3,
                "principal_payment": 3352.74
            }
        ],
        "periodic_payment": 3372.3,
        "total_amount": 10116.89,
        "total_interest": 116.89
    },
    "message": "Loan Schedule",
    "status": 200,
    "success": true
}
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Creating a Dynamic Table for Results&lt;br&gt;
To display the &lt;a href="https://rapidapi.com/johnmfula/api/loan-amortization-calculator1/playground/apiendpoint_19ab5380-a6c7-41ea-9c42-f4058c90dbed" rel="noopener noreferrer"&gt;loan schedule &lt;/a&gt;in a user-friendly format, we'll create a dynamic table using Python's tabulate library. First, install the library:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;pip install tabulate
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Now, let's create a function to display the loan schedule:&lt;br&gt;
&lt;/p&gt;

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

def display_loan_schedule(data):
    payments = data['data']['payments']
    table = []

    for payment in payments:
        row = [
            payment['period'],
            payment['opening_balance'],
            payment['payment'],
            payment['principal_payment'],
            payment['interest'],
            payment['closing_balance']
        ]
        table.append(row)

    headers = ["Period", "Opening Balance", "Payment", "Principal", "Interest", "Closing Balance"]
    print(tabulate(table, headers, tablefmt="pretty"))

# Assuming 'data' is the API response
display_loan_schedule(data)
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Putting It All Together&lt;br&gt;
Now that we have all the pieces, let's put them together in a single script:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;import requests
from tabulate import tabulate

def calculate_loan_schedule():
    url = "https://loan-amortization-calculator1.p.rapidapi.com/api/calculate/amortization"

    payload = {
        "loan_amount": 10000,
        "annual_interest_rate": 7,
        "num_payments": 3,
        "extra_payment": 0,
        "frequency": "monthly"
    }

    headers = {
        'Content-Type': 'application/json',
        'x-rapidapi-host': 'loan-amortization-calculator1.p.rapidapi.com',
        'x-rapidapi-key': 'cee0d12e3dmshd8cc8a3c884fcbdp1c2d92jsnd916f6092b82'
    }

    response = requests.post(url, json=payload, headers=headers)

    if response.status_code == 200:
        data = response.json()
        display_loan_schedule(data)
    else:
        print(f"Error: {response.status_code}")

def display_loan_schedule(data):
    payments = data['data']['payments']
    table = []

    for payment in payments:
        row = [
            payment['period'],
            payment['opening_balance'],
            payment['payment'],
            payment['principal_payment'],
            payment['interest'],
            payment['closing_balance']
        ]
        table.append(row)

    headers = ["Period", "Opening Balance", "Payment", "Principal", "Interest", "Closing Balance"]
    print(tabulate(table, headers, tablefmt="pretty"))

if __name__ == "__main__":
    calculate_loan_schedule()
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Running the Script&lt;br&gt;
When you run the script, it will make a POST request to the Loan Amortization Calculator API, retrieve the loan schedule, and display it in a dynamic table. Here's what the output will look like:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;+---------+-----------------+----------+------------+----------+-----------------+
| Period  | Opening Balance | Payment  | Principal  | Interest | Closing Balance |
+---------+-----------------+----------+------------+----------+-----------------+
|    1    |     10000.0     | 3372.3   |  3313.96   |  58.33   |     6686.04     |
|    2    |     6686.04     | 3372.3   |  3333.3    |   39.0   |     3352.74     |
|    3    |     3352.74     | 3372.3   |  3352.74   |  19.56   |       0.0       |
+---------+-----------------+----------+------------+----------+-----------------+
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;In this blog post, we've explored how to calculate loan amortization using Python and an API. We've also created a dynamic table to display the loan schedule in a user-friendly format. This approach can be easily extended to handle more complex loan scenarios, such as variable interest rates or additional payments.&lt;/p&gt;

&lt;p&gt;Understanding loan amortization is essential for making informed financial decisions. By leveraging Python and APIs, you can automate the calculation process and gain deeper insights into your loan repayment strategy.&lt;/p&gt;

&lt;p&gt;Happy coding!&lt;/p&gt;

</description>
      <category>webdev</category>
      <category>python</category>
      <category>loan</category>
      <category>tutorial</category>
    </item>
  </channel>
</rss>
