<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0"><channel><title><![CDATA[Musa Wakili ML]]></title><description><![CDATA[Essentialist Programmer, Minimalist, Machine Learning Engineer, and Pragmatist]]></description><link>https://musawakiliml.blog</link><image><url>https://cdn.hashnode.com/res/hashnode/image/upload/v1719225437473/ff609204-d517-46d2-ac1c-a43e503df923.png</url><title>Musa Wakili ML</title><link>https://musawakiliml.blog</link></image><generator>RSS for Node</generator><lastBuildDate>Fri, 15 May 2026 09:17:21 GMT</lastBuildDate><atom:link href="https://musawakiliml.blog/rss.xml" rel="self" type="application/rss+xml"/><language><![CDATA[en]]></language><ttl>60</ttl><item><title><![CDATA[How to Automate Renaming Files in a Folder with Python]]></title><description><![CDATA[Imagine you have a folder full of files with random names, and you need to rename them in a specific format. Manually renaming each file could take forever. Luckily, Python can help automate this!
Everyone wants automation right!!
Now let’s introduce...]]></description><link>https://musawakiliml.blog/how-to-automate-renaming-files-in-a-folder-with-python</link><guid isPermaLink="true">https://musawakiliml.blog/how-to-automate-renaming-files-in-a-folder-with-python</guid><category><![CDATA[Python]]></category><category><![CDATA[python beginner]]></category><category><![CDATA[python projects]]></category><category><![CDATA[Programming Blogs]]></category><category><![CDATA[coding]]></category><category><![CDATA[automation]]></category><dc:creator><![CDATA[Musa Adamu Wakili]]></dc:creator><pubDate>Thu, 30 Jan 2025 03:04:59 GMT</pubDate><enclosure url="https://cdn.hashnode.com/res/hashnode/image/upload/v1738206165672/349428da-663d-41cc-8ff5-9aab5529bdde.png" length="0" type="image/jpeg"/><content:encoded><![CDATA[<p>Imagine you have a folder full of files with random names, and you need to rename them in a specific format. Manually renaming each file could take forever. Luckily, Python can help automate this!</p>
<p>Everyone wants automation right!!</p>
<p>Now let’s introduce the concept…</p>
<p>Renaming files manually can be a tedious task, especially when you’re dealing with hundreds of files. But with Python, you can automate this process efficiently! In this blog post, we’ll look at how to write a Python script that renames files in a folder using the os module.</p>
<p><strong>Solution Overview</strong>:</p>
<p>We’ll use the os module to interact with the file system. This module allows us to list files in a folder, check if they are files (and not directories), and rename them according to a custom naming scheme.</p>
<p><strong>Pre-requisite:</strong></p>
<p>To run the code you need some important tools on your system:</p>
<ul>
<li><p>Python 3. x</p>
</li>
<li><p>pip3 (Python Package Manager)</p>
</li>
<li><p>A Code Editor (VS Code, or any of your code, but I will be using VS Code)</p>
</li>
<li><p>Basic Knowledge of Python</p>
</li>
</ul>
<p>You can verify Python is installed correctly by typing:</p>
<pre><code class="lang-bash">$ python3
</code></pre>
<p><strong>Step-by-Step Guide:</strong></p>
<pre><code class="lang-python"><span class="hljs-keyword">import</span> os

<span class="hljs-function"><span class="hljs-keyword">def</span> <span class="hljs-title">rename_files_in_folder</span>(<span class="hljs-params">folder_path: str, prefix=<span class="hljs-string">"file"</span></span>):</span>
    <span class="hljs-string">"""
    Automating Renaming Files in a Folder

    Args:
        folder_path (str): Path to the folder containing the files to be renamed
        prefix (str, optional): Prefix to the renamed files. Defaults to "file".
    """</span>
    <span class="hljs-keyword">try</span>:
        <span class="hljs-comment"># List all the files in the folder</span>
        files_list = os.listdir(folder_path)

        <span class="hljs-comment"># Filter directories and get only files using List comprehension</span>
        files = [f <span class="hljs-keyword">for</span> f <span class="hljs-keyword">in</span> files_list <span class="hljs-keyword">if</span> os.path.isfile(os.path.join(folder_path, f))]

        <span class="hljs-comment"># Rename the Files</span>
        <span class="hljs-keyword">for</span> index, filename <span class="hljs-keyword">in</span> enumerate(files, start=<span class="hljs-number">1</span>):
            <span class="hljs-comment"># Get file extension</span>
            file_extension = os.path.splitext(filename)[<span class="hljs-number">1</span>]

            <span class="hljs-comment"># Create new file name</span>
            new_name = <span class="hljs-string">f"<span class="hljs-subst">{prefix}</span>_<span class="hljs-subst">{index}</span><span class="hljs-subst">{file_extension}</span>"</span>

            <span class="hljs-comment"># Renaming File</span>
            old_file_path = os.path.join(folder_path, filename)
            new_file_path = os.path.join(folder_path, new_name)

            os.rename(old_file_path, new_file_path)
            print(<span class="hljs-string">f"Renamed: <span class="hljs-subst">{filename}</span> -&gt; <span class="hljs-subst">{new_name}</span>"</span>)

        print(<span class="hljs-string">"Renaming Completed Successfully!"</span>)

    <span class="hljs-keyword">except</span> Exception <span class="hljs-keyword">as</span> e:
        print(<span class="hljs-string">f"Error <span class="hljs-subst">{e}</span>"</span>)

<span class="hljs-comment"># Run the Program</span>
<span class="hljs-keyword">if</span> __name__ == <span class="hljs-string">"__main__"</span>:
    folder_path = input(<span class="hljs-string">"Enter the folder path: "</span>).strip()
    prefix = input(<span class="hljs-string">"Enter the file prefix (default is 'file'): "</span>).strip() <span class="hljs-keyword">or</span> <span class="hljs-string">"file"</span>
    rename_files_in_folder(folder_path=folder_path, prefix=prefix)
</code></pre>
<p><strong>Code Explanation</strong>:</p>
<ol>
<li><p><strong>Listing Files</strong>: We use os.listdir() to get all files in the specified folder.</p>
</li>
<li><p><strong>Filtering Files</strong>: We filter out directories using os.path.isfile().</p>
</li>
<li><p><strong>Renaming</strong>: For each file, we generate a new name with a number suffix and preserve the original extension.</p>
</li>
<li><p><strong>Error Handling</strong>: We wrap everything in a try-except block to handle any potential issues, like invalid folder paths.</p>
</li>
</ol>
<p><strong>Use Cases</strong>:</p>
<p>• Organizing project files where each document should follow a naming pattern.</p>
<p>• Renaming photo files from a camera in a systematic way.</p>
<p>With just a few lines of Python code, you can automate the renaming of files in any folder. This can save time and eliminate manual errors. Feel free to customize this script to suit your needs!</p>
<p>Try out the script and let me know how it works for you! If you have any suggestions for improvements or new challenges you’d like me to tackle, drop a comment below.</p>
]]></content:encoded></item><item><title><![CDATA[Building a Secure and Robust FastAPI Project for Task Management Part 1]]></title><description><![CDATA[Learn how to develop efficient APIs with FastAPI by building Taskee.
Let’s start with a story 😁, I grew up writing down everything I would do daily, weekly, monthly, and ideas that came by. I even write code on paper. I recently started playing arou...]]></description><link>https://musawakiliml.blog/building-a-robust-task-api-part-1</link><guid isPermaLink="true">https://musawakiliml.blog/building-a-robust-task-api-part-1</guid><category><![CDATA[coding]]></category><category><![CDATA[Python]]></category><category><![CDATA[Web Development]]></category><category><![CDATA[APIs]]></category><category><![CDATA[API basics ]]></category><category><![CDATA[FastAPI]]></category><category><![CDATA[REST API]]></category><category><![CDATA[todoapp]]></category><category><![CDATA[MongoDB]]></category><dc:creator><![CDATA[Musa Adamu Wakili]]></dc:creator><pubDate>Fri, 12 Jan 2024 17:56:58 GMT</pubDate><enclosure url="https://cdn.hashnode.com/res/hashnode/image/upload/v1696784919165/4c5f46fe-642d-4cf7-88fd-95fcfed8d217.png" length="0" type="image/jpeg"/><content:encoded><![CDATA[<h3 id="heading-learn-how-to-develop-efficient-apis-with-fastapi-by-building-taskee">Learn how to develop efficient APIs with FastAPI by building Taskee.</h3>
<p>Let’s start with a story 😁, I grew up writing down everything I would do daily, weekly, monthly, and ideas that came by. I even write code on paper. I recently started playing around with FastAPI a cool Python web framework for building scalable and efficient APIs. I thought what a good idea to build an API for Task management, you can use it to create tasks, track them, and stay organized. That will help with maximum productivity.</p>
<p>In this tutorial, we will walk through the process of building a secure robust APIs for a Task Management project using the FastAPI framework. “<em>Taskee</em>” is a platform where you can create tasks, delete, update, and view tasks, it will help you stay organized. This project will cover developing the APIs for the platform, it will feature Project setup, Data Models/Validation and Error Handling, API Endpoints, Documentation, User Authentication/Authorization, Testing, Docker, and Deployment. We will cover Project setup, Data Models/Validation and Error Handling, API Endpoints, and Documentation in Part 1 and continue with the rest in Part 2.</p>
<h2 id="heading-lets-get-started">Let’s get started!</h2>
<h2 id="heading-1-project-setup">1. Project Setup:</h2>
<ul>
<li><p>Create a new FastAPI project or set up a virtual environment within an existing one.</p>
</li>
<li><p>Install the required dependencies, including FastAPI, a database connector (motor).</p>
</li>
<li><p>Create A FastAPI App and Project Structure.</p>
</li>
</ul>
<h2 id="heading-prerequisites">Prerequisites</h2>
<p>Before starting the project some important tools and packages need to be available on your system:</p>
<ul>
<li><p>Python 3. x</p>
</li>
<li><p>pip3 (Python Package Manager)</p>
</li>
<li><p>A Code Editor (VS Code, or any of your code, but I will be using VS Code)</p>
</li>
<li><p>Basic Knowledge of Python and Web Development Concepts</p>
</li>
</ul>
<p>In this tutorial, we will walk through the process of building a secure robust APIs for a Task Management project using the FastAPI framework. “<em>Taskee</em>” is a platform where you can create tasks, delete, update, and view tasks, it will help you stay organized. This project will cover developing the APIs for the platform, it will feature Project setup, Data Models/Validation and Error Handling, API Endpoints, Documentation, User Authentication/Authorization, Testing, Docker, and Deployment. We will cover Project setup, Data Models/Validation and Error Handling, API Endpoints, and Documentation in part 1 and continue with the rest in part 2. Let’s get started!</p>
<p>Note: If you don’t have any of the above tools, you download them from the links provided below <a target="_blank" href="https://code.visualstudio.com/download">VS Code</a>, <a target="_blank" href="https://www.python.org/downloads/">Python</a>, You can choose your operating system of choice and install.</p>
<p>You can verify Python is installed correctly by typing:</p>
<pre><code class="lang-bash">$ python3
</code></pre>
<h2 id="heading-setting-up-the-development-environment">Setting Up the Development Environment</h2>
<p>The first step after all the installation, is to create a dedicated folder for your project and set up a virtual environment. Well, the virtual environment is a way to keep your projects organized and solve dependency issues, as you develop many projects over time. It is just a way of isolating each project to be in a container with only its packages no overlaps or conflicts. This ensures consistency and efficiency as you only install packages you need.</p>
<p>Let's create our folder and virtual environment, shall we? 😉 If you using Windows open Command Prompt or terminal on Mac/Linux, then type:</p>
<pre><code class="lang-bash">$ mkdir taskee_api
$ <span class="hljs-built_in">cd</span> taskee_api
$ python3 -m venv env
$ <span class="hljs-built_in">source</span> env/bin/activate <span class="hljs-comment"># On Windows, use venv\\Scripts\\activate</span>
</code></pre>
<h2 id="heading-project-structure">Project Structure</h2>
<p>Here we will create our project folders and files like this below:</p>
<pre><code class="lang-bash">├── app
│   ├── __init__.py
│   └── server
│       ├── api
|       |    └── v1
|       |    |   └── endpoints
|       |    |   |    └── tasks.py
│       ├── config
|       |    └── config.py
│       ├── models
|       |    └── tasks.py
│       └── database
|       |    |── crud.py
|       |    └── database_connection.py
|                └── app.py
└── requirements.txt
└── main.py
└── .env
</code></pre>
<blockquote>
<p>Pretty right!!</p>
</blockquote>
<h2 id="heading-installing-fastapi-dependencies">Installing FastAPI Dependencies</h2>
<p>The next step of our development is to install the right dependencies for the project in our created virtual environment. Our project will need some libraries to work for example the web framework for building the APIs in this case FastAPI, a database connector (motor for Mongodb), we will be using MongoDB as our database.</p>
<h3 id="heading-mongodb-database">MongoDB Database</h3>
<p>MongoDB is a NoSQL database based on document structure in the form of dictionary objects, it is suited for non-transactional applications. It allows very fast search and retrieval of data with a complex structure.</p>
<p>We start by installing MongoDB, you can refer to this <a target="_blank" href="https://docs.mongodb.com/manual/installation/">Installation</a> guide. Once you are done you can continue to run the daemon <a target="_blank" href="https://docs.mongodb.com/manual/reference/program/mongod/#bin.mongod">mongod</a> process. After everything you can verify whether MongoDB is running in the background by using the CLI command:</p>
<pre><code class="lang-bash">$ mongo
$ mongo --version
</code></pre>
<p>You are all set with MongoDB installed, now let's get other packages.</p>
<p>We will install the database interfacing library in Python called "motor", along with "fastapi" for building APIs, "uvicorn" as the web server, and "pydantic" as the data validation package for fastapi.</p>
<pre><code class="lang-bash">$ pip install fastapi motor uvicorn pydantic
</code></pre>
<p>To make programming easier, you should create a requirements field to hold all the versions of the packages you are using in the project. This helps development, avoids conflicts, and reduces package dependency. So in your root directory, you can run the following command and you will see a new created:</p>
<pre><code class="lang-bash">$ pip freeze &gt; requirements.txt
</code></pre>
<h2 id="heading-create-first-app">Create First App</h2>
<p>Now Let's start building our “<em>Taskee</em>” API, before doing anything let's write code inside our to define the entry point of our application and set up the app base server.</p>
<p><em>app/server/app.py → Main app server route</em></p>
<pre><code class="lang-python"><span class="hljs-keyword">from</span> fastapi <span class="hljs-keyword">import</span> FastAPI, status
<span class="hljs-keyword">from</span> fastapi.responses <span class="hljs-keyword">import</span> JSONResponse
<span class="hljs-keyword">from</span> fastapi.middleware.cors <span class="hljs-keyword">import</span> CORSMiddleware

app = FastAPI()

app.add_middleware(
    CORSMiddleware,
    allow_origins=[<span class="hljs-string">"*"</span>],
    allow_credentials=<span class="hljs-literal">True</span>,
    allow_methods=[<span class="hljs-string">"*"</span>],
    allow_headers=[<span class="hljs-string">"*"</span>],
)

<span class="hljs-meta">@app.get("/")</span>
<span class="hljs-keyword">async</span> <span class="hljs-function"><span class="hljs-keyword">def</span> <span class="hljs-title">task_app</span>():</span>
   content = {<span class="hljs-string">"Message"</span>: <span class="hljs-string">"Your Task Manager for Daily Productivity...."</span>}
   <span class="hljs-keyword">return</span> JSONResponse(content=content, status_code=status.HTTP_200_OK)
</code></pre>
<p>In the above code, I have imported the main libraries required to run our FastAPI application server. I then declared the app instance using the FastAPI() method. Every application needs to have a filter for traffic and be secured, we have CORSMiddleware for that. You can leave the settings as they are for now.</p>
<p>Now, let's create our first route, we can do that by using the app instance as a decorator and invoking the get method on the (”/”) path. FastAPI is an Asynchronous framework, that allows multiple requests at a time, one request can do an operation while the other is also in operation.</p>
<pre><code class="lang-python"><span class="hljs-keyword">async</span> <span class="hljs-function"><span class="hljs-keyword">def</span> <span class="hljs-title">task_app</span>()</span>
</code></pre>
<p>We want to return some text to the browser when you hit the endpoint, so we create the content dictionary object and return the value using the JSON response method to conform with the JSON format. That’s it our simple route</p>
<p>It is a good practice to have your app entry point configuration in a separate file.</p>
<p><em>app/main.py</em></p>
<pre><code class="lang-python"><span class="hljs-keyword">import</span> uvicorn

<span class="hljs-keyword">if</span> __name__ == <span class="hljs-string">"__main__"</span>:
    uvicorn.run(<span class="hljs-string">"app.server.app:app"</span>, host=<span class="hljs-string">"0.0.0.0"</span>, port=<span class="hljs-number">8000</span>, reload=<span class="hljs-literal">True</span>)
</code></pre>
<p>This configuration starts the server using Uvicorn using the file instance of our app, on port 8000 and <a target="_blank" href="http://localhost">localhost</a>, the reload parameter allows the server to listen to changes in the entire project and restart the server.</p>
<p>We can now run our simple application and type the command from the terminal:</p>
<pre><code class="lang-python">$ python main.py
</code></pre>
<p>You will get a similar output from your terminal:</p>
<pre><code class="lang-python">INFO:     Will watch <span class="hljs-keyword">for</span> changes <span class="hljs-keyword">in</span> these directories: [<span class="hljs-string">'/Users/macbookpro/Documents/GitHub/Task-Manager-using-FastAPI'</span>]
INFO:     Uvicorn running on http://<span class="hljs-number">0.0</span><span class="hljs-number">.0</span><span class="hljs-number">.0</span>:<span class="hljs-number">8000</span> (Press CTRL+C to quit)
INFO:     Started reloader process [<span class="hljs-number">75412</span>] using StatReload
Connection to Mongo DB Server Successfull
INFO:     Started server process [<span class="hljs-number">75414</span>]
INFO:     Waiting <span class="hljs-keyword">for</span> application startup.
INFO:     Application startup complete.
</code></pre>
<p>You can view the application from the browser.</p>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1705074830522/2ccf2591-b523-4786-90f3-409ceb1d10a6.png" alt class="image--center mx-auto" /></p>
<h2 id="heading-2-data-models-and-configuration">2. Data Models and Configuration:</h2>
<ul>
<li><p>Define a data model for the "Task" entity. This model should include fields like task name, description, status (e.g., "completed," "in progress," "pending"), creation timestamp, and any other relevant properties.</p>
</li>
<li><p>Create a configuration file for our environment variables.</p>
</li>
<li><p>Set up a database connection to store and retrieve tasks.</p>
</li>
</ul>
<h2 id="heading-define-task-data-model">Define Task Data Model</h2>
<p>Before we start writing out API routes we need to define our data schema, and configure our database and our config files.</p>
<p>Our data schema/model will created using pydantic to ensure data validation and type annotation.</p>
<p>Navigate and open the file <em>app/server/models/tasks.py</em></p>
<pre><code class="lang-python"><span class="hljs-comment"># Importing libraries</span>
<span class="hljs-keyword">from</span> pydantic <span class="hljs-keyword">import</span> BaseModel, Field
<span class="hljs-keyword">from</span> typing <span class="hljs-keyword">import</span> Optional, Union
<span class="hljs-keyword">from</span> datetime <span class="hljs-keyword">import</span> datetime

<span class="hljs-comment"># Defining the data schema for creating a task</span>
<span class="hljs-class"><span class="hljs-keyword">class</span> <span class="hljs-title">TasksSchema</span>(<span class="hljs-params">BaseModel</span>):</span>
   name: str = Field(...)
   description: str = Field(...)
   task_status: str = Field(...)
   priority: str = Field(...)
   due_date: str = Field(...)
   created_at: Union[datetime, <span class="hljs-literal">None</span>] = <span class="hljs-literal">None</span>
   updated_at: Union[datetime, <span class="hljs-literal">None</span>] = <span class="hljs-literal">None</span>

   <span class="hljs-class"><span class="hljs-keyword">class</span> <span class="hljs-title">Config</span>:</span>
      json_schema_extra = {
         <span class="hljs-string">"example"</span>: [
            {
               <span class="hljs-string">"name"</span>:<span class="hljs-string">"Read a Book"</span>,
               <span class="hljs-string">"description"</span>:<span class="hljs-string">"Read a book on entreprenurship for 2 hours"</span>,
               <span class="hljs-string">"task_status"</span>:<span class="hljs-string">"completed"</span>,
               <span class="hljs-string">"priority"</span>:<span class="hljs-string">"p1"</span>,
               <span class="hljs-string">"due_date"</span>: <span class="hljs-string">"2023-09-10"</span>,
               <span class="hljs-string">"created_at"</span>:<span class="hljs-string">"2023-09-10T23:23:35.403+00:00"</span>,
               <span class="hljs-string">"updated_at"</span>:<span class="hljs-string">"2023-09-10T23:23:35.403+00:00"</span>
            }
         ]
      }

<span class="hljs-comment"># Defining Data Schema for updating the task</span>
<span class="hljs-class"><span class="hljs-keyword">class</span> <span class="hljs-title">UpdateTasksSchema</span>(<span class="hljs-params">BaseModel</span>):</span>
   name: str = Field(...)
   description: str = Field(...)
   task_status: str = Field(...)
   priority: str = Field(...)
   due_date: str = Field(...)
   updated_at: Union[datetime, <span class="hljs-literal">None</span>] = <span class="hljs-literal">None</span>

   <span class="hljs-class"><span class="hljs-keyword">class</span> <span class="hljs-title">Config</span>:</span>
      json_schema_extra = {
         <span class="hljs-string">"example"</span>: [
            {
               <span class="hljs-string">"name"</span>:<span class="hljs-string">"Read a Book"</span>,
               <span class="hljs-string">"description"</span>:<span class="hljs-string">"Read a book on entreprenurship for 2 hours"</span>,
               <span class="hljs-string">"task_status"</span>:<span class="hljs-string">"completed"</span>,
               <span class="hljs-string">"priority"</span>:<span class="hljs-string">"p1"</span>,
               <span class="hljs-string">"due_date"</span>: <span class="hljs-string">"2023-09-10"</span>,
            }
         ]
      }
</code></pre>
<p>The TasksSchema class inherits from the BaseModel class to create data fields based on the type of data you are expecting from the user, Pydantic ensures the validation of the data that it is the right type. This schema represents how our data will be saved in the database, the ellipses (…) in the Field method show it is required. the UpdateTasksSchema is used when updating the data in the database.</p>
<p>For both schemas we have used, a Union field to create a ‘<em>updated_at’</em> and <em>‘created_at</em>’ object using the <em>datetime</em> function to include the current time.</p>
<p>The class Config is a schema structure example for the documentation FastAPI generates and uses for validation. This helps anyone using the APIs to understand how the data is structured.</p>
<h2 id="heading-create-config-file">Create Config File</h2>
<p>To use MongoDB with our application or some other tools that require some key access, we will need to secretly save them on our server and provide access through our config file. Pydantic has a special package to help with that ‘<em>pydantic-settings’ .</em> Run the following command to install it and also create a new file ‘.env’. make sure you are in your main folder.</p>
<pre><code class="lang-bash">$ pip install pydantic-settings
$ touch .env
</code></pre>
<p>When the installation is done the run the second command. Now open the .env and write this:</p>
<pre><code class="lang-bash">MONGODB_URL=<span class="hljs-string">"mongodb://localhost:27017"</span>
</code></pre>
<p>This will allow you to connect the database we will create config for later. The value can be different if you are using Mongodb atlas, but for local it will suffice.</p>
<p>Let's create our config file, since our .env file is a secret file we will use pydantic-settings to access it.</p>
<p><em>app/server/config/config.py</em></p>
<pre><code class="lang-python"><span class="hljs-keyword">from</span> pydantic_settings <span class="hljs-keyword">import</span> BaseSettings

<span class="hljs-class"><span class="hljs-keyword">class</span> <span class="hljs-title">Settings</span>(<span class="hljs-params">BaseSettings</span>):</span>
    MONGODB_URL: str

    <span class="hljs-class"><span class="hljs-keyword">class</span> <span class="hljs-title">Config</span>:</span>
        env_file = <span class="hljs-string">'.env'</span>
</code></pre>
<p>Here, we have created a Settings class that inherits from the BaseSettings class, under it we declared our MongoDB url as <em>str</em> type, and any other env variable from .env. The class Config points to the location of the .env file. Now with this, you can access your key from anywhere in the code without exposing it.</p>
<h2 id="heading-setup-database-connection">Setup Database Connection</h2>
<p>Our database will be used to store tasks users will create, we will use ‘<em>motor’</em> an asynchronous Mongodb driver, a package we already installed. Create a new file in <em>app/server/database/database_connection.py</em></p>
<pre><code class="lang-python">
<span class="hljs-comment"># Import Libraries</span>
<span class="hljs-keyword">import</span> asyncio
<span class="hljs-keyword">from</span> motor.motor_asyncio <span class="hljs-keyword">import</span> AsyncIOMotorClient
<span class="hljs-keyword">from</span> app.server.config.config <span class="hljs-keyword">import</span> Settings

<span class="hljs-comment"># Importing enviroment Variables</span>
settings = Settings()

<span class="hljs-comment"># Database Configuration</span>

client = AsyncIOMotorClient(settings.MONGODB_URL, serverSelectionTimeoutMS=<span class="hljs-number">5000</span>)
client.get_io_loop = asyncio.get_event_loop

<span class="hljs-comment"># Database Connection Test</span>

<span class="hljs-keyword">try</span>:
    db_connection = client.server_info()
    print(<span class="hljs-string">"Connection to Mongo DB Server Successfull"</span>)
<span class="hljs-keyword">except</span> Exception <span class="hljs-keyword">as</span> e:
    print(<span class="hljs-string">"Connection Unsuccessfull"</span>)
    print(str(e))

<span class="hljs-comment"># Create Database</span>
database = client.tasks_api

<span class="hljs-comment"># Database Collections</span>

tasks = database.get_collection(<span class="hljs-string">"tasks_collection"</span>)
</code></pre>
<p>We have imported the env variables from my config file safely, next, we create a database client using the AsyncIOMotorClient method, and we pass the MongoDB URL as the database to create an async connection to.</p>
<p>Inside the try-except block, we test the connection to the database, next we head on to create the database and subsequently the collections. So the logic here is we create one database, and can create multiple collections, if the collection is not available it will be created else it will use the existing one.</p>
<p>Motor is an async driver so we need to use asyncio to continue the event loop for the database running.</p>
<h2 id="heading-crud-operations">CRUD Operations</h2>
<p>To use the collections we have created, there have to be create, read, update, and delete functions available. In this section, we will go through that.</p>
<p>Create/Open the file <em>app/server/database/crud.py</em></p>
<p>We first import our modules, from models and database configs. Each Mongodb object is created with a unique id, in our case ObjectID from Bson is what we will use.</p>
<pre><code class="lang-python"><span class="hljs-keyword">from</span> app.server.database.database_connection <span class="hljs-keyword">import</span> tasks
<span class="hljs-keyword">from</span> app.server.models.tasks <span class="hljs-keyword">import</span> TasksSchema, UpdateTasksSchema
<span class="hljs-keyword">from</span> bson.objectid <span class="hljs-keyword">import</span> ObjectId

<span class="hljs-comment"># Create the necessary endpoints to handle </span>
<span class="hljs-comment"># CRUD operations for tasks (Create, Read, Update, Delete).</span>

<span class="hljs-comment"># Create task</span>
<span class="hljs-keyword">async</span> <span class="hljs-function"><span class="hljs-keyword">def</span> <span class="hljs-title">create_task_db</span>(<span class="hljs-params">task: TasksSchema</span>):</span>
    task = task.model_dump()
    <span class="hljs-keyword">try</span>:
        new_task = <span class="hljs-keyword">await</span> tasks.insert_one(task)
        get_new_task = <span class="hljs-keyword">await</span> tasks.find_one({<span class="hljs-string">"_id"</span>: new_task.inserted_id})
        <span class="hljs-keyword">return</span> get_new_task
    <span class="hljs-keyword">except</span> Exception <span class="hljs-keyword">as</span> e:
        <span class="hljs-keyword">return</span> {<span class="hljs-string">"Error_message"</span>:str(e)}

<span class="hljs-comment"># Get one task</span>
<span class="hljs-keyword">async</span> <span class="hljs-function"><span class="hljs-keyword">def</span> <span class="hljs-title">get_single_task_db</span>(<span class="hljs-params">id: str</span>):</span>
    <span class="hljs-keyword">try</span>:
        task = <span class="hljs-keyword">await</span> tasks.find_one({<span class="hljs-string">"_id"</span>:ObjectId(id)})
        <span class="hljs-keyword">if</span> task:
            <span class="hljs-keyword">return</span> task
    <span class="hljs-keyword">except</span> Exception <span class="hljs-keyword">as</span> e:
        <span class="hljs-keyword">return</span> {<span class="hljs-string">"Error_message"</span>: str(e)}

<span class="hljs-comment"># Get all tasks</span>
<span class="hljs-keyword">async</span> <span class="hljs-function"><span class="hljs-keyword">def</span> <span class="hljs-title">get_all_tasks_db</span>():</span>
    task_data = []
    <span class="hljs-keyword">try</span>:
        get_all_tasks = tasks.find()
        <span class="hljs-keyword">if</span> get_all_tasks:
            <span class="hljs-keyword">async</span> <span class="hljs-keyword">for</span> task <span class="hljs-keyword">in</span> get_all_tasks:
                task_data.append(task)
            <span class="hljs-keyword">return</span> task_data
    <span class="hljs-keyword">except</span> Exception <span class="hljs-keyword">as</span> e:
        <span class="hljs-keyword">return</span> {<span class="hljs-string">"Error_message"</span>: str(e)}

<span class="hljs-comment"># Update one task</span>
<span class="hljs-keyword">async</span> <span class="hljs-function"><span class="hljs-keyword">def</span> <span class="hljs-title">update_single_task_db</span>(<span class="hljs-params">id: str, task_data: UpdateTasksSchema</span>):</span>
    task = task_data.model_dump()
    <span class="hljs-keyword">try</span>:
        update_task = <span class="hljs-keyword">await</span> tasks.update_one({<span class="hljs-string">"_id"</span>:ObjectId(id)}, {<span class="hljs-string">"$set"</span>:{
            <span class="hljs-string">"name"</span>:task[<span class="hljs-string">"name"</span>],
            <span class="hljs-string">"description"</span>: task[<span class="hljs-string">"description"</span>],
            <span class="hljs-string">"priority"</span>: task[<span class="hljs-string">"priority"</span>],
            <span class="hljs-string">"task_status"</span>: task[<span class="hljs-string">"task_status"</span>],
            <span class="hljs-string">"due_date"</span>: task[<span class="hljs-string">"due_date"</span>],
            <span class="hljs-string">"updated_at"</span>: task[<span class="hljs-string">"updated_at"</span>]
        }})
        <span class="hljs-keyword">if</span> update_task:
            get_task = <span class="hljs-keyword">await</span> tasks.find_one({<span class="hljs-string">"_id"</span>:ObjectId(id)})
            <span class="hljs-keyword">return</span> get_task
    <span class="hljs-keyword">except</span> Exception <span class="hljs-keyword">as</span> e:
        <span class="hljs-keyword">return</span> {<span class="hljs-string">"Error_message"</span>: str(e)}

<span class="hljs-comment"># Delete one task</span>
<span class="hljs-keyword">async</span> <span class="hljs-function"><span class="hljs-keyword">def</span> <span class="hljs-title">delete_single_task_db</span>(<span class="hljs-params">id: str</span>):</span>
    <span class="hljs-keyword">try</span>:
        result = <span class="hljs-keyword">await</span> tasks.delete_one({<span class="hljs-string">"_id"</span>:ObjectId(id)})
        <span class="hljs-keyword">return</span> {<span class="hljs-string">"message"</span>:<span class="hljs-string">"Successfully Deleted task"</span>, <span class="hljs-string">"result"</span>:result}
    <span class="hljs-keyword">except</span> Exception <span class="hljs-keyword">as</span> e:
        <span class="hljs-keyword">return</span> {<span class="hljs-string">"Error_message"</span>: str(e)}

<span class="hljs-comment"># Delete all tasks</span>
<span class="hljs-keyword">async</span> <span class="hljs-function"><span class="hljs-keyword">def</span> <span class="hljs-title">delete_all_tasks_db</span>():</span>
    <span class="hljs-keyword">try</span>:
        result = <span class="hljs-keyword">await</span> tasks.delete_many({})
        <span class="hljs-keyword">return</span> {<span class="hljs-string">"message"</span>:<span class="hljs-string">"All Database Deleted"</span>}
    <span class="hljs-keyword">except</span> Exception <span class="hljs-keyword">as</span> e:
        <span class="hljs-keyword">return</span> {<span class="hljs-string">"Error_message"</span>: str(e)}
</code></pre>
<p>In the code above, we have created the asynchronous operations to create, read, update, and delete task data from the database collection via motor.</p>
<p>I used UpdateTasksSchema and TasksSchema as parameters for the create_task and update_task functions, I am passing directly the data schema from my endpoint so I need to convert it to a dictionary to be saved properly in my database. That is why I call ‘<em>model_dump()’</em> on the data to get the dictionary object.</p>
<p>For each section we have implemented a try-except for proper error handling, this allows us to see exactly what the error is.</p>
<h2 id="heading-3-api-endpoints">3. API Endpoints:</h2>
<ul>
<li><p>Create the necessary endpoints to handle CRUD operations for tasks (Create, Read, Update, Delete).</p>
</li>
<li><p>Implement proper HTTP methods (GET, POST, PUT, DELETE) and status codes to ensure RESTful API design.</p>
</li>
<li><p>Our Endpoints include:</p>
<ul>
<li><p><code>GET /tasks</code>: Retrieve a list of all tasks.</p>
</li>
<li><p><code>GET /tasks/{task_id}</code>: Retrieve a specific task by its ID.</p>
</li>
<li><p><code>POST /tasks</code>: Create a new task.</p>
</li>
<li><p><code>PUT /tasks/{task_id}</code>: Update an existing task.</p>
</li>
<li><p><code>DELETE /tasks/{task_id}</code>: Delete a task.</p>
</li>
<li><p><code>DELETE /tasks</code>: Delete all tasks.</p>
</li>
</ul>
</li>
</ul>
<p>In this section, we will implement our endpoints to carry out the CRUD operations we have implemented above. Let’s code…</p>
<p>Navigate to your <em>app/server/api/v1/endpoints/tasks.py</em> We need to import our modules like models, database, and other packages.</p>
<p><em>app/server/api/v1/endpoints/tasks.py</em></p>
<pre><code class="lang-python"><span class="hljs-keyword">from</span> fastapi <span class="hljs-keyword">import</span> APIRouter, status, HTTPException, Form, Body
<span class="hljs-keyword">from</span> fastapi.responses <span class="hljs-keyword">import</span> JSONResponse
<span class="hljs-keyword">from</span> fastapi.encoders <span class="hljs-keyword">import</span> jsonable_encoder
<span class="hljs-keyword">from</span> datetime <span class="hljs-keyword">import</span> datetime, time, timedelta
<span class="hljs-keyword">from</span> typing <span class="hljs-keyword">import</span> Annotated, Any, List
<span class="hljs-keyword">from</span> bson.objectid <span class="hljs-keyword">import</span> ObjectId

<span class="hljs-keyword">from</span> app.server.database.crud <span class="hljs-keyword">import</span> (
    create_task_db,
    get_single_task_db,
    get_all_tasks_db,
    update_single_task_db,
    delete_single_task_db,
    delete_all_tasks_db
)
<span class="hljs-keyword">from</span> app.server.database.database_connection <span class="hljs-keyword">import</span> tasks
<span class="hljs-keyword">from</span> app.server.models.tasks <span class="hljs-keyword">import</span> (
    TasksSchema,
    UpdateTasksSchema
)

router = APIRouter()
</code></pre>
<p>In the above you will notice I have a new ‘<em>router’</em> instance not ‘<em>app’,</em> the reason behind that is we can create a single app instance and route different endpoints to it. This way we can create many routes, and just configure the path and the APIRouter class.</p>
<p>You can keep adding the code to the file..</p>
<p><code>POST /tasks</code>: Create a new task.</p>
<pre><code class="lang-python"><span class="hljs-comment"># Create task route</span>
<span class="hljs-meta">@router.post("/", response_model=TasksSchema, response_description="Creating A Task")</span>
<span class="hljs-keyword">async</span> <span class="hljs-function"><span class="hljs-keyword">def</span> <span class="hljs-title">create_task</span>(<span class="hljs-params">name: Annotated[str, Form(<span class="hljs-params"></span>)],
                      description: Annotated[str, Form(<span class="hljs-params"></span>)],
                      task_status: Annotated[str, Form(<span class="hljs-params"></span>)],
                      priority: Annotated[str, Form(<span class="hljs-params"></span>)],
                      due_date: Annotated[str, Form(<span class="hljs-params"></span>)]</span>) -&gt; Any:</span>
    <span class="hljs-keyword">try</span>:
        created_at = datetime.utcnow()
        <span class="hljs-comment"># Create task function</span>
        task = TasksSchema(
            name=name,
            description=description,
            task_status=task_status,
            priority=priority,
            due_date=due_date,
            created_at=created_at,
            updated_at=<span class="hljs-literal">None</span>
        )
        new_task = <span class="hljs-keyword">await</span> create_task_db(task)

        response = {
            <span class="hljs-string">"id"</span>: str(new_task[<span class="hljs-string">"_id"</span>]),
            <span class="hljs-string">"message"</span>: <span class="hljs-string">"Task Created Successfully"</span>
        }
        response = jsonable_encoder(response)

        <span class="hljs-keyword">return</span> JSONResponse(content=response, status_code=status.HTTP_201_CREATED)
    <span class="hljs-keyword">except</span> Exception <span class="hljs-keyword">as</span> e:
        <span class="hljs-keyword">raise</span> HTTPException(status_code=status.HTTP_500_INTERNAL_SERVER_ERROR, detail=str(e))
</code></pre>
<p>We have created the Post Request endpoint to create a task on the platform. We have used if you noticed <code>@router.post</code> since we created our router instance to handle everything. The response model allows us to specify the schema we will use and how the data should be presented, it ensures data validation through Pydantic. This only accepts Post requests.</p>
<p>The function has a form field for accepting data as form data from the users. We used Annotated for data validation and type safety so that we are sure that what the user provided is valid.</p>
<p>The Try clause gets the current time to create a schema object and creates the task using the create_task_db functions. The created task is transformed into the response to be sent to when successful, the response has to be JSON serializable, so we use <em>jsonable_encoder</em> <code>GET /tasks</code>: Retrieve a list of all tasks.</p>
<pre><code class="lang-python"><span class="hljs-comment"># Get all Tasks</span>
<span class="hljs-meta">@router.get("/", response_model=List[TasksSchema], response_description="Get all Tasks")</span>
<span class="hljs-keyword">async</span> <span class="hljs-function"><span class="hljs-keyword">def</span> <span class="hljs-title">get_all_tasks</span>():</span>
    all_tasks_list = []
    <span class="hljs-keyword">try</span>:
        get_all_tasks = <span class="hljs-keyword">await</span> get_all_tasks_db()
        <span class="hljs-keyword">if</span> get_all_tasks:
            <span class="hljs-keyword">for</span> task <span class="hljs-keyword">in</span> get_all_tasks:
                task_data = TasksSchema(
                    name=task[<span class="hljs-string">"name"</span>],
                    description=task[<span class="hljs-string">"description"</span>],
                    task_status=task[<span class="hljs-string">"task_status"</span>],
                    priority=task[<span class="hljs-string">"priority"</span>],
                    due_date=task[<span class="hljs-string">"due_date"</span>],
                    created_at=task[<span class="hljs-string">"created_at"</span>],
                    updated_at=task[<span class="hljs-string">"updated_at"</span>]
                )
                all_tasks_list.append(task_data)
            response = jsonable_encoder(all_tasks_list)
            <span class="hljs-comment"># print(response)</span>
        <span class="hljs-keyword">return</span> JSONResponse(content=response, status_code=status.HTTP_200_OK)
    <span class="hljs-keyword">except</span> Exception <span class="hljs-keyword">as</span> e:
        <span class="hljs-keyword">raise</span> HTTPException(status_code=status.HTTP_500_INTERNAL_SERVER_ERROR, detail=str(e))
</code></pre>
<p>In the code above we have created the Get request endpoint to retrieve all the tasks created on the platform. We return the result of the values as a list of objects based on the TasksSchema to ensure data validation is applied. With the try-except block, we have checked the database for tasks and returned appropriate messages using JSON response or http exception.</p>
<p><code>GET /tasks/{task_id}</code>: Retrieve a specific task by its ID.</p>
<pre><code class="lang-python"><span class="hljs-comment"># Get Single Task</span>
<span class="hljs-meta">@router.get("/{id}", response_model=TasksSchema, response_description="Get Single Task")</span>
<span class="hljs-keyword">async</span> <span class="hljs-function"><span class="hljs-keyword">def</span> <span class="hljs-title">get_single_task</span>(<span class="hljs-params">id: str</span>):</span>
    <span class="hljs-keyword">try</span>:
        get_task = <span class="hljs-keyword">await</span> get_single_task_db(id)
        <span class="hljs-keyword">if</span> get_task:
            response = TasksSchema(
                name=get_task[<span class="hljs-string">"name"</span>],
                description=get_task[<span class="hljs-string">"description"</span>],
                task_status=get_task[<span class="hljs-string">"task_status"</span>],
                priority=get_task[<span class="hljs-string">"priority"</span>],
                due_date=get_task[<span class="hljs-string">"due_date"</span>],
                created_at=get_task[<span class="hljs-string">"created_at"</span>],
                updated_at=get_task[<span class="hljs-string">"updated_at"</span>]
            )
            response = jsonable_encoder(response)
        <span class="hljs-keyword">return</span> JSONResponse(content=response, status_code=status.HTTP_200_OK)
    <span class="hljs-keyword">except</span> Exception <span class="hljs-keyword">as</span> e:
        <span class="hljs-keyword">raise</span> HTTPException(status_code=status.HTTP_500_INTERNAL_SERVER_ERROR, detail=str(e))
</code></pre>
<p>To get a single task we use the ID as a parameter when calling the endpoint, using the ID we check the database to see if the data is available else return an error message. When the data is available we validate it through TaskSchema when creating a response return it to the user.</p>
<p><code>PUT /tasks/{task_id}</code>: Update an existing task.</p>
<pre><code class="lang-python"><span class="hljs-comment"># Update Single Task</span>
<span class="hljs-meta">@router.put("/{id}", response_model=TasksSchema, response_description="Update Single Task")</span>
<span class="hljs-keyword">async</span> <span class="hljs-function"><span class="hljs-keyword">def</span> <span class="hljs-title">update_single_task</span>(<span class="hljs-params">id: str, task: UpdateTasksSchema = Body(<span class="hljs-params">...</span>)</span>):</span>
    <span class="hljs-keyword">try</span>:
        task = task.model_dump()
        updated_at = datetime.utcnow()
        updated_task = UpdateTasksSchema(
            name=task[<span class="hljs-string">'name'</span>],
            description=task[<span class="hljs-string">'description'</span>],
            task_status=task[<span class="hljs-string">'task_status'</span>],
            priority=task[<span class="hljs-string">'priority'</span>],
            due_date=task[<span class="hljs-string">'due_date'</span>],
            updated_at=str(updated_at)
        )
        update_task = <span class="hljs-keyword">await</span> update_single_task_db(id, updated_task)
        <span class="hljs-keyword">if</span> update_task:
            response = TasksSchema(
                name=update_task[<span class="hljs-string">"name"</span>],
                description=update_task[<span class="hljs-string">"description"</span>],
                task_status=update_task[<span class="hljs-string">"task_status"</span>],
                priority=update_task[<span class="hljs-string">"priority"</span>],
                due_date=update_task[<span class="hljs-string">"due_date"</span>],
                created_at=update_task[<span class="hljs-string">"created_at"</span>],
                updated_at=update_task[<span class="hljs-string">"updated_at"</span>]
            )
            response = jsonable_encoder(response)
        <span class="hljs-keyword">return</span> JSONResponse(content=response, status_code=status.HTTP_200_OK) 
    <span class="hljs-keyword">except</span> Exception <span class="hljs-keyword">as</span> e:
        <span class="hljs-keyword">raise</span> HTTPException(status_code=status.HTTP_500_INTERNAL_SERVER_ERROR, detail=str(e))
</code></pre>
<p>To Update the data already created, we use the Put method. The put method allows us to update the whole data and return the updated data. We use the id as a query parameter, to get the task in view, the data we get is based on our Pydantic schema, we convert it to a dictionary object and ensure data validation. We get the updated_at using a DateTime object. After we successfully update the task we can use our TasksSchema to validate it and encode it for our response object.</p>
<p><code>DELETE /tasks/{task_id}</code>: Delete a task.</p>
<pre><code class="lang-python"><span class="hljs-meta">@router.delete("/{id}", response_description="Delete a Single Task")</span>
<span class="hljs-keyword">async</span> <span class="hljs-function"><span class="hljs-keyword">def</span> <span class="hljs-title">delete_single_task</span>(<span class="hljs-params">id: str</span>):</span>
    <span class="hljs-keyword">try</span>:
        delete_task = <span class="hljs-keyword">await</span> delete_single_task_db(id)

        response = {<span class="hljs-string">"Message"</span>: <span class="hljs-string">f"Task with Id:<span class="hljs-subst">{id}</span> is Successfuly Deleted!!"</span>}

        response = jsonable_encoder(response)

        <span class="hljs-keyword">return</span> JSONResponse(content=response, status_code=status.HTTP_200_OK) 
    <span class="hljs-keyword">except</span> Exception <span class="hljs-keyword">as</span> e:
        <span class="hljs-keyword">raise</span> HTTPException(status_code=status.HTTP_500_INTERNAL_SERVER_ERROR, detail=str(e))
</code></pre>
<p>You can delete a task by just using the Delete method and id as the query parameter.</p>
<p><code>DELETE /tasks</code>: Delete all tasks.</p>
<pre><code class="lang-python"><span class="hljs-meta">@router.delete("/", response_description="Delete all Tasks")</span>
<span class="hljs-keyword">async</span> <span class="hljs-function"><span class="hljs-keyword">def</span> <span class="hljs-title">delete_all_tasks</span>():</span>
    <span class="hljs-keyword">try</span>:
        delete = <span class="hljs-keyword">await</span> delete_all_tasks_db()

        response = {<span class="hljs-string">"Message"</span>: <span class="hljs-string">f"All Tasks Successfuly Deleted!!"</span>}

        response = jsonable_encoder(response)

        <span class="hljs-keyword">return</span> JSONResponse(content=response, status_code=status.HTTP_200_OK) 
    <span class="hljs-keyword">except</span> Exception <span class="hljs-keyword">as</span> e:
        <span class="hljs-keyword">raise</span> HTTPException(status_code=status.HTTP_500_INTERNAL_SERVER_ERROR, detail=str(e))
</code></pre>
<p>To delete all you just need the Delete method, while we already have the functions for clearing the whole collection.</p>
<h2 id="heading-4-documentation">4. Documentation:</h2>
<ul>
<li><p>Generate API documentation using FastAPI's built-in support for OpenAPI and Swagger.</p>
</li>
<li><p>Ensure that the API documentation is clear and provides information on how to use each endpoint.</p>
</li>
</ul>
<p>Finally, we can run our application test and utilize the online Swagger documentation. The models and configurations we wrote will be very helpful because they will serve as a guide for sending requests using either the terminal or front-end, as it provide the necessary structure.</p>
<p>Before then let's make some updates to our app/server/app.py file</p>
<pre><code class="lang-python"><span class="hljs-keyword">from</span> fastapi <span class="hljs-keyword">import</span> FastAPI, status
<span class="hljs-keyword">from</span> fastapi.responses <span class="hljs-keyword">import</span> JSONResponse
<span class="hljs-keyword">from</span> fastapi.middleware.cors <span class="hljs-keyword">import</span> CORSMiddleware

<span class="hljs-comment"># Task API</span>
<span class="hljs-keyword">from</span> app.server.api.v1.endpoints.tasks <span class="hljs-keyword">import</span> router <span class="hljs-keyword">as</span> TasksRouter

app = FastAPI()

app.add_middleware(
    CORSMiddleware,
    allow_origins=[<span class="hljs-string">"*"</span>],
    allow_credentials=<span class="hljs-literal">True</span>,
    allow_methods=[<span class="hljs-string">"*"</span>],
    allow_headers=[<span class="hljs-string">"*"</span>],
)

<span class="hljs-comment"># Task Application routes</span>
app.include_router(TasksRouter, tags=[<span class="hljs-string">"Tasks Management"</span>], prefix=<span class="hljs-string">"/tasks"</span>)

<span class="hljs-meta">@app.get("/")</span>
<span class="hljs-keyword">async</span> <span class="hljs-function"><span class="hljs-keyword">def</span> <span class="hljs-title">task_app</span>():</span>
   content = {<span class="hljs-string">"Message"</span>: <span class="hljs-string">"Your Task Manager for Daily Productivity...."</span>}
   <span class="hljs-keyword">return</span> JSONResponse(content=content, status_code=status.HTTP_200_OK)
</code></pre>
<p>We have added the task router to the application, this allows the APIs to be accessible.</p>
<p>Now you can type the command:</p>
<pre><code class="lang-python">$ python main.py
</code></pre>
<p>Visit <code>localhost:8000/docs</code> You will get an interface like this one with all the endpoints visible and ready to be tested.</p>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1705080837385/5252d754-865c-4d9f-bbe6-b2cdecd43dc0.png" alt class="image--center mx-auto" /></p>
<p><code>Post: Create a task</code></p>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1705081538451/45dacfea-14bc-41b2-bfb9-91e31f2b757f.png" alt class="image--center mx-auto" /></p>
<p>This is how the post request looks like you can click on Try Out to create a new task.</p>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1705081554504/793c205c-773c-4cc8-92b4-816e1abfd64b.png" alt class="image--center mx-auto" /></p>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1705081565625/84138a5f-387e-4332-a59b-08be4a1fdd53.png" alt class="image--center mx-auto" /></p>
<p>You have successfully created a new task. Now let's check the database to get all data and a single one.</p>
<p><code>Get: Retrieve Tasks/Task</code></p>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1705081598724/38065f55-4a94-4b63-ae00-d504ac09f9f7.png" alt class="image--center mx-auto" /></p>
<p><strong>Get All Tasks</strong></p>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1705081648875/8e6e55c0-8581-4ff2-9a40-e583f6bd3331.png" alt class="image--center mx-auto" /></p>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1705081667436/c2a911dd-1bd6-4801-84cb-75c44520420a.png" alt class="image--center mx-auto" /></p>
<p>The above images show you how to get a single task using the ID.</p>
<p><code>Put: Update A Single Task</code></p>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1705081724999/9fe51cf4-005d-43c0-9f5b-353d20f5d6f6.png" alt class="image--center mx-auto" /></p>
<p>You provide the ID and input the update you want. You can write the values using a JSON format.</p>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1705081742128/55626397-0009-4d9d-9996-9a2dcbae6e66.png" alt class="image--center mx-auto" /></p>
<p>Successfully updated the task, now you can the updated_at field has a value.</p>
<p><code>Delete single and Delete All</code></p>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1705081760039/8098cb43-507a-43de-952f-c344ccff68a0.png" alt class="image--center mx-auto" /></p>
<p>You provide an ID of the task you want to delete.</p>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1705081774737/0f4fb9a6-a227-4fe3-8761-f887452d9095.png" alt class="image--center mx-auto" /></p>
<p>Delete everything in the collection.</p>
<p>Wow You successfully created and tested your robust Taskee API, you can go and celebrate.</p>
<h2 id="heading-conclusion">Conclusion</h2>
<p>In conclusion, you have now completed the development of a robust and efficient API for task management. The API allows users to create, read, update, and delete tasks, providing a seamless experience for managing tasks. With proper documentation and error handling in place, the API is ready for deployment and use in real-world scenarios. Great job!</p>
<p><strong>In the next part, we will look at things like:</strong></p>
<ul>
<li><p><strong>User and Profile Management</strong></p>
</li>
<li><p><strong>Authorization and Authentication</strong></p>
</li>
<li><p><strong>Pagination and Filtering</strong></p>
</li>
<li><p><strong>Testing and Pagination</strong></p>
</li>
</ul>
<p>You can find the complete code of the tutorial on <a target="_blank" href="https://github.com/musawakiliML/Task-Manager-using-FastAPI">Github</a></p>
]]></content:encoded></item><item><title><![CDATA[Start Coding By Solving Problems]]></title><description><![CDATA[Learning to code is frustrating, but not impossible. With the right mindset and consistency, you can strengthen your coding muscles. In this tutorial series instead of teaching you Python concepts(which are available over the internet), I will focus ...]]></description><link>https://musawakiliml.blog/coding-by-solving-problems</link><guid isPermaLink="true">https://musawakiliml.blog/coding-by-solving-problems</guid><category><![CDATA[coding challenge]]></category><category><![CDATA[coding]]></category><category><![CDATA[#codingNewbies]]></category><category><![CDATA[python beginner]]></category><category><![CDATA[Python]]></category><dc:creator><![CDATA[Musa Adamu Wakili]]></dc:creator><pubDate>Thu, 11 Jan 2024 13:58:39 GMT</pubDate><enclosure url="https://cdn.hashnode.com/res/hashnode/image/upload/v1704968009244/48f6778b-1d64-4f41-8bb2-f9d50d7646fa.png" length="0" type="image/jpeg"/><content:encoded><![CDATA[<p>Learning to code is frustrating, but not impossible. With the right mindset and consistency, you can strengthen your coding muscles. In this tutorial series instead of teaching you Python concepts(which are available over the internet), I will focus on building programs with outline concepts. When building a program you will use different concepts like strings, variables, lists, operators, etc... So in our tutorial, I will first list the concepts we will use, and build the programs with them. But the over series will cover the core concepts of programming like loops, functions, conditions, etc...</p>
<p>This tutorial will start with the basics of Python, which I assume you know or can learn. The problems we will solve are from numerous coding challenge sites like <a target="_blank" href="https://dmoj.ca/">Dmoj</a>, <a target="_blank" href="https://acm.timus.ru/">Timus</a>, and <a target="_blank" href="http://usaco.org/">USACO</a>. This is because the programming judges host different sets of problems on both sites, using them will allow us to cover all the topics we need. I have added the link for each question to read more on the problem description.</p>
<div data-node-type="callout">
<div data-node-type="callout-emoji">💡</div>
<div data-node-type="callout-text"><strong><em>A Note: You will need to create an account before you can submit your code for validity on the systems.</em></strong></div>
</div>

<h1 id="heading-so-lets-get-started">So let's get started!!</h1>
<p>In this problem set, we will be covering and using the concepts below:</p>
<ul>
<li><p>Strings</p>
</li>
<li><p>Integer and Floating Point Numbers</p>
</li>
<li><p>Variables</p>
</li>
<li><p>Reading Inputs and Writing Outputs</p>
</li>
<li><p>Maths Operators and Type Conversion</p>
</li>
</ul>
<p>Try Solving the problem by visiting the problem through the link provided, if you can't go through my solution, read the problem description, do it on paper, take a break, and come back later to try again. But don't ever give up.</p>
<h3 id="heading-problem-one-dmoj-problem-dmopc15c7p2-word-count">Problem One : DMOJ problem dmopc15c7p2, Word Count</h3>
<h3 id="heading-link-view-problemhttpsdmojcaproblemdmopc15c7p2">Link: <a target="_blank" href="https://dmoj.ca/problem/dmopc15c7p2">View Problem</a></h3>
<p>In This challenge, you have to write a program that can check the number of words in a sentence. We used the concepts of variables, input statements, string manipulations, and outputs</p>
<pre><code class="lang-python"><span class="hljs-comment"># Get a sentence from user</span>
sentence = input(<span class="hljs-string">"Enter a sentence:"</span>)

<span class="hljs-comment"># Count the number of words from the input string using the count method</span>
word_count = sentence.count(<span class="hljs-string">" "</span>) + <span class="hljs-number">1</span>

<span class="hljs-comment"># Display the Result to the user.</span>
print(<span class="hljs-string">f"The Sentence: '<span class="hljs-subst">{sentence}</span>' has <span class="hljs-subst">{word_count}</span> words."</span>)

<span class="hljs-comment"># Sample Output: The Sentence: 'this is a test sentence' has 5 words.</span>
</code></pre>
<h3 id="heading-problem-two-dmoj-problem-dmopc14c5p1-cone-volume">Problem Two: DMOJ problem dmopc14c5p1, Cone Volume</h3>
<h3 id="heading-link-view-problemhttpsdmojcaproblemdmopc14c5p1">Link: <a target="_blank" href="https://dmoj.ca/problem/dmopc14c5p1">View Problem</a></h3>
<p>In This Challenge, you have to write a program that calculates the volume of a cone using the formula:(π * r^2 * h)/3. We used the concepts of variables, math operators, and type conversion.</p>
<pre><code class="lang-python"><span class="hljs-comment"># Get math library</span>
<span class="hljs-keyword">import</span> math

<span class="hljs-comment"># Get User Inputs, Radius and height</span>
radius = eval(input(<span class="hljs-string">"Enter radius:"</span>))
height = eval(input(<span class="hljs-string">"Enter height:"</span>))

<span class="hljs-comment"># Calculate the volume of the cone using the formula</span>
volume = math.pi * (radius ** <span class="hljs-number">2</span>) * height / <span class="hljs-number">3</span>

<span class="hljs-comment"># Display Results</span>
print(<span class="hljs-string">f"The volume of a Cone with <span class="hljs-subst">{radius}</span> radius and <span class="hljs-subst">{height}</span> height is <span class="hljs-subst">{volume}</span>"</span>)

<span class="hljs-comment"># Sample Output: The volume of a Cone with 12 radius and 23 height is 3468.318289563131</span>
</code></pre>
<h3 id="heading-problem-three-dmoj-problem-wc17c1j2-hows-the-weather">Problem Three: DMOJ problem wc17c1j2, How’s the Weather?</h3>
<h3 id="heading-link-view-problemhttpsdmojcaproblemwc17c1j2">Link: <a target="_blank" href="https://dmoj.ca/problem/wc17c1j2">View Problem</a></h3>
<p>In This Challenge, you have to write a program that calculates the Celsius based on the Fahrenheit value given. Using the Formula: (5/9)*(Fahrenheit - 32)</p>
<pre><code class="lang-python"><span class="hljs-comment"># Get user input</span>
fahrenheit = eval(input(<span class="hljs-string">"Enter Fahrenheit:"</span>))

<span class="hljs-comment"># Calculate celsius</span>
celsius = <span class="hljs-number">5</span> / <span class="hljs-number">9</span> * (fahrenheit - <span class="hljs-number">32</span>)

<span class="hljs-comment"># Display Results</span>
print(<span class="hljs-string">f"<span class="hljs-subst">{fahrenheit}</span> Fahrenheit is <span class="hljs-subst">{celsius}</span> Celsius."</span>)

<span class="hljs-comment"># Sample Output: 12 Fahrenheit is -11.11 Celsius</span>
</code></pre>
<h3 id="heading-problem-four-dmoj-problem-wc16c1j1-a-spooky-season">Problem Four: DMOJ problem wc16c1j1, A Spooky Season</h3>
<h3 id="heading-link-view-problemhttpsdmojcaproblemwc16c1j1">Link: <a target="_blank" href="https://dmoj.ca/problem/wc16c1j1">View Problem</a></h3>
<p>In This Challenge, you have to write a program that repeats a set of characters in an input based on the user request(input).</p>
<pre><code class="lang-python"><span class="hljs-comment"># Get the number of characters you want</span>
number = int(input(<span class="hljs-string">"Enter a number:"</span>))

<span class="hljs-comment"># Generate the word with the number of characters </span>
word = <span class="hljs-string">f"sp<span class="hljs-subst">{<span class="hljs-string">'o'</span> * number}</span>ky"</span>

<span class="hljs-comment"># Display Result</span>
print(word)

<span class="hljs-comment"># Sample Output: spooooooky</span>
</code></pre>
<h3 id="heading-problem-five-dmoj-problem-wc15c2j1-a-new-hope">Problem Five: DMOJ problem wc15c2j1, A New Hope</h3>
<h3 id="heading-link-view-problemhttpsdmojcaproblemwc15c2j1">Link: <a target="_blank" href="https://dmoj.ca/problem/wc15c2j1">View Problem</a></h3>
<p>In This Challenge, you have to write a program that will print "far" N times.</p>
<pre><code class="lang-python"><span class="hljs-comment"># Get user input</span>
number = int(input(<span class="hljs-string">"Enter a Number:"</span>))

<span class="hljs-comment"># Generate the text with "far" keyword</span>
text = <span class="hljs-string">f"A long time ago in a galaxy <span class="hljs-subst">{<span class="hljs-string">'far, '</span> * (number - <span class="hljs-number">1</span>)}</span>far away..."</span>

<span class="hljs-comment"># Display result</span>
print(text)

<span class="hljs-comment"># Sample Output: A long time ago in a galaxy far, far, far, far, far away...</span>
</code></pre>
<h3 id="heading-problem-six-dmoj-problem-ccc13j1-next-in-line">Problem Six: DMOJ problem ccc13j1, Next in Line</h3>
<h3 id="heading-link-view-problemhttpsdmojcaproblemccc13j1">Link: <a target="_blank" href="https://dmoj.ca/problem/ccc13j1">View Problem</a></h3>
<p>In This Challenge, you have to write a program that get the age of the oldest given the youngest and the middle</p>
<pre><code class="lang-python"><span class="hljs-comment"># Get User Input</span>
youngest_age = int(input(<span class="hljs-string">"Enter the age of the youngest child:"</span>))
middle_age = int(input(<span class="hljs-string">"ENter the age of the middle child:"</span>))

<span class="hljs-comment"># Calculate Oldest Age</span>
oldest_age = <span class="hljs-number">2</span> * middle_age - youngest_age

<span class="hljs-comment"># Display Result</span>
print(<span class="hljs-string">f"The Oldest Child is <span class="hljs-subst">{oldest_age}</span> years old."</span>)

<span class="hljs-comment"># Sample Output: The Oldest Child is 16 years old.</span>
</code></pre>
<h3 id="heading-problem-seven-dmoj-problem-wc18c3j1-an-honest-days-work">Problem Seven: DMOJ problem wc18c3j1, An Honest Day’s Work</h3>
<h3 id="heading-link-view-problemhttpsdmojcaproblemwc18c3j1">Link: <a target="_blank" href="https://dmoj.ca/problem/wc18c3j1">View Problem</a></h3>
<p>In This Challenge, you have to write a program that calculates the total money of creating a bottle cap.</p>
<pre><code class="lang-python"><span class="hljs-comment"># Get User Inputs</span>
paint_litres = int(input(<span class="hljs-string">"Enter the amount of paint(litres):"</span>))
bottle_caps = int(input(<span class="hljs-string">"Enter the amount of litres(per badge):"</span>))
poke_dollars = int(input(<span class="hljs-string">"Enter the cost of each badge:"</span>))

<span class="hljs-comment"># Calculate the total money</span>
total_money = (paint_litres // bottle_caps * poke_dollars) + (paint_litres % bottle_caps)

<span class="hljs-comment"># Display Result</span>
print(<span class="hljs-string">f"The Total Money is $<span class="hljs-subst">{total_money}</span> Dollars"</span>)

<span class="hljs-comment"># Sample Output: The Total Money is $10 Dollars</span>
</code></pre>
<h3 id="heading-problem-x-1-dmoj-problem-sac21ccp1-sac-21-code-challenge-p1-shrinkage">Problem X-1: DMOJ Problem sac21ccp1, SAC '21 Code Challenge P1 - Shrinkage</h3>
<h3 id="heading-link-view-problemhttpsdmojcaproblemsac21ccp1">Link: <a target="_blank" href="https://dmoj.ca/problem/sac21ccp1">View Problem</a></h3>
<p>In This Challenge, you have to write a program that find the area of the rectangle after shrinking it through the telescope!</p>
<pre><code class="lang-python"><span class="hljs-comment"># Get User Input</span>
original_area = eval(input(<span class="hljs-string">"Enter original area:"</span>))

<span class="hljs-comment"># Calculate Area</span>
new_area = original_area // <span class="hljs-number">40</span>

<span class="hljs-comment"># Display Result</span>
print(new_area)

<span class="hljs-comment"># Sample Output: 20</span>
</code></pre>
<h3 id="heading-problem-x-2-dmoj-problem-sac22cc1p1-sac-22-code-challenge-1-p1-that-teacher">Problem X-2: DMOJ Problem sac22cc1p1, SAC '22 Code Challenge 1 P1 - That Teacher</h3>
<h4 id="heading-link-view-problemhttpsdmojcaproblemsac22cc1p1">Link: <a target="_blank" href="https://dmoj.ca/problem/sac22cc1p1">View Problem</a></h4>
<p>In This Challenge, you have to write a program that gets the number of candy bars will be left after they are being shared.</p>
<pre><code class="lang-python"><span class="hljs-comment"># Get user input</span>
number_of_trick_or_treat = eval(input(<span class="hljs-string">"Enter the number of trick_or_treaters:"</span>))
number_of_candy_bars_to_give = eval(input(<span class="hljs-string">"Enter the Number of Candy Bars to give each treaters:"</span>))
number_of_candy_bars = eval(input(<span class="hljs-string">"Enter the number of candy bars:"</span>))

<span class="hljs-comment"># Calculate the number of candies left</span>
number_left = number_of_candy_bars - (number_of_trick_or_treat * number_of_candy_bars_to_give)

<span class="hljs-comment"># Display Result</span>
print(number_left)

<span class="hljs-comment"># Sample Output: 5</span>
</code></pre>
<h3 id="heading-problem-x-3-dmoj-problem-ccc22j1-ccc-22-j1-cupcake-party">Problem X-3: DMOJ Problem ccc22j1, CCC '22 J1 - Cupcake Party</h3>
<h3 id="heading-link-view-problemhttpsdmojcaproblemccc22j1">Link: <a target="_blank" href="https://dmoj.ca/problem/ccc22j1">View Problem</a></h3>
<p>In This Challenge, you have to write a program that returns the number of cupcakes that are left over.</p>
<pre><code class="lang-python"><span class="hljs-comment"># Get User Input</span>
number_of_regular_boxes = eval(input(<span class="hljs-string">"Enter the number of regular boxes:"</span>))
number_of_small_boxes = eval(input(<span class="hljs-string">"Enter the number of small boxes:"</span>))

<span class="hljs-comment"># Calculate the number of left overs</span>
number_of_leftover = (number_of_regular_boxes * <span class="hljs-number">8</span>) + (number_of_small_boxes * <span class="hljs-number">3</span>) - <span class="hljs-number">28</span>

<span class="hljs-comment"># Display Result</span>
print(number_of_leftover)

<span class="hljs-comment"># Sample Output: 3</span>
</code></pre>
<p>With This we have come to the end of this session, of coding... How about take some coffee and recharge for next round.. haha just kidding.</p>
<p>You learn coding by writing coding. There are many differents ways of solving a problem, if your solution does the right thing but not like mine, it doesnt mean either is wrong. Rather its an opportunity for you to compare your code and mine to learn alternative approach.</p>
<p><em>Join me in the next post to learn more...</em></p>
]]></content:encoded></item><item><title><![CDATA[Episode 2- The Journeyman]]></title><description><![CDATA[In this Episode we will address the following questions as you start your journey. 

Why become the journeyman?
What programming language should i learn?
How should learn it?
Whats my provision for this quest?
  ... you are now a journeyman.. we will...]]></description><link>https://musawakiliml.blog/episode-2-the-journeyman</link><guid isPermaLink="true">https://musawakiliml.blog/episode-2-the-journeyman</guid><category><![CDATA[Programming Blogs]]></category><category><![CDATA[programming languages]]></category><category><![CDATA[Programming Tips]]></category><category><![CDATA[Beginner Developers]]></category><dc:creator><![CDATA[Musa Adamu Wakili]]></dc:creator><pubDate>Mon, 24 Jan 2022 04:23:17 GMT</pubDate><enclosure url="https://cdn.hashnode.com/res/hashnode/image/upload/v1642997825681/dojiaCjGR.png" length="0" type="image/jpeg"/><content:encoded><![CDATA[<p>In this Episode we will address the following questions as you start your journey. </p>
<ul>
<li>Why become the journeyman?</li>
<li>What programming language should i learn?</li>
<li>How should learn it?</li>
<li>Whats my provision for this quest?
  ... you are now a journeyman.. we will discuss more on what underlies that more..</li>
</ul>
<p>Why become the journeyman?</p>
<p>The difficulty with teaching programming is that it cannot be taught. The difficulty with learning  programming is that it is so much work. A teacher can help, lecture, criticize, guide, smooth the path. A student can take notes, memorize, read, pass tests, discuss until two in the morning. All this effort will be meaningless if the student does not practice by actually writing programs, because programming, like other skills, can be acquired only by practice. Furthermore, the practice must  be on "real" programs and not on the simplistic material found in most programming language manuals.</p>
<p><strong>Listen to the full Episode Here:</strong></p>
<iframe src="https://anchor.fm/musawakiliml/embed/episodes/S1--Ep-2-The-Journeyman-e1dc80a" height="102px" width="400px"></iframe>


<p><strong>Please subscribe to the podcast, Share or tell a friend about it.</strong></p>
]]></content:encoded></item><item><title><![CDATA[The Passionate and Essentialist Programmer]]></title><description><![CDATA[This is the 1st episode in our series The Passionate and Essentialist Programmer, in which we discuss the importance of having a purpose, becoming independent-minded and embarking on a quest for novelty in your coding career.We focused on the Why? of...]]></description><link>https://musawakiliml.blog/the-passionate-and-essentialist-programmer</link><guid isPermaLink="true">https://musawakiliml.blog/the-passionate-and-essentialist-programmer</guid><category><![CDATA[Productivity]]></category><category><![CDATA[Programming Blogs]]></category><category><![CDATA[General Programming]]></category><category><![CDATA[podcast]]></category><category><![CDATA[Beginner Developers]]></category><dc:creator><![CDATA[Musa Adamu Wakili]]></dc:creator><pubDate>Wed, 12 Jan 2022 03:55:15 GMT</pubDate><enclosure url="https://cdn.hashnode.com/res/hashnode/image/upload/v1641959541676/mZ_e2b2fJ.png" length="0" type="image/jpeg"/><content:encoded><![CDATA[<p>This is the 1st episode in our series <em>The Passionate and Essentialist Programmer</em>, in which we discuss the importance of having a purpose, becoming independent-minded and embarking on a quest for novelty in your coding career.We focused on the Why? of your journey where you'll learn how to start a quest for novelty not conformity, becoming an independent mind, not a conventional one. </p>
<p>I discussed in the podcast the Following Points:</p>
<ul>
<li><p>What's Your Purpose</p>
</li>
<li><p>Think For Yourself- Becoming Independent-Minded</p>
</li>
<li><p>A Quest For Novelty</p>
</li>
<li><p>There Is No Rush To Learning</p>
</li>
</ul>
<h2 id="heading-listen-and-leave-a-comment">Listen and leave a comment.</h2>
<iframe src="https://anchor.fm/musawakiliml/embed/episodes/The-Passionate-and-Essentialist-Programmer-e1cpqp8" height="102px" width="400px"></iframe>


<h3 id="heading-the-book-of-the-week">The book of the week:</h3>
<p><strong>Rework: Change the way you work forever. by Jason Fried and David Heinemeier Hansson</strong></p>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1641958358463/5YanjpmJu.jpeg" alt="images.jpeg" /></p>
<blockquote>
<p>Quote: 
Prof. K. Anders Ericsson said: "In most domains it's remarkable how much time even the most talented individuals need in order to reach the highest levels of performance. The 10,000 hour number just gives you a sense that we're talking years of 10 to 20 hours a week which those who some people would argue are the most innately talented individuals still need to get to the highest level."</p>
</blockquote>
<h3 id="heading-please-subscribe-to-the-podcast-share-or-tell-a-friend-about-it"><em>Please subscribe to the podcast, Share or tell a friend about it.</em></h3>
]]></content:encoded></item><item><title><![CDATA[Podcast EP-1]]></title><description><![CDATA[Musa Wakili ML Podcast
Introducing The Show]]></description><link>https://musawakiliml.blog/podcast-ep-1</link><guid isPermaLink="true">https://musawakiliml.blog/podcast-ep-1</guid><category><![CDATA[podcast]]></category><category><![CDATA[Productivity]]></category><category><![CDATA[Machine Learning]]></category><dc:creator><![CDATA[Musa Adamu Wakili]]></dc:creator><pubDate>Sat, 25 Dec 2021 23:22:00 GMT</pubDate><content:encoded><![CDATA[<h2 id="heading-musa-wakili-ml-podcast">Musa Wakili ML Podcast</h2>
<p><strong>Introducing The Show</strong></p>
<iframe src="https://anchor.fm/musawakiliml/embed" height="102px" width="400px"></iframe>
]]></content:encoded></item></channel></rss>