<?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: spkibe</title>
    <description>The latest articles on DEV Community by spkibe (@spkibe).</description>
    <link>https://dev.to/spkibe</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%2F879788%2F039fe684-80c7-46d3-9eff-23c1e2152906.png</url>
      <title>DEV Community: spkibe</title>
      <link>https://dev.to/spkibe</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/spkibe"/>
    <language>en</language>
    <item>
      <title>Star Schema: The Data Warehouse Hack So Simple, Experts Hate It</title>
      <dc:creator>spkibe</dc:creator>
      <pubDate>Sun, 16 Mar 2025 20:45:58 +0000</pubDate>
      <link>https://dev.to/spkibe/star-schema-the-data-warehouse-hack-so-simple-experts-hate-it-4eef</link>
      <guid>https://dev.to/spkibe/star-schema-the-data-warehouse-hack-so-simple-experts-hate-it-4eef</guid>
      <description>&lt;p&gt;Let’s cut through the jargon: a star schema is the easiest, most badass way to build a data warehouse. Picture a fact table—say, sales—sitting in the center like a king, surrounded by dimension tables—products, time, customers—like loyal knights. That’s it. No convoluted hierarchies, no endless joins, just a radial, denormalized beauty built for speed and simplicity. Your notes call it out: “A dimensional model in a star configuration… de-normalized for better performance and easier understanding.” It’s the data equivalent of a cheat code.&lt;/p&gt;

&lt;p&gt;Why’s it genius? Because it’s optimized for OLAP queries—those big, juicy SELECT statements that slice and dice your data into insights. Fewer joins mean faster results. Hierarchies like “year → quarter → month” live right in the dimension table, so you’re not chasing parent tables across a database swamp. I’ve seen star schemas turn a 10-minute report into a 10-second one—try that with a normalized mess. Plus, it’s extensible: slap on a new dimension or tweak a hierarchy, and your old queries still work. It’s like Lego for data nerds.&lt;/p&gt;

&lt;p&gt;But here’s the controversial twist: some “experts” overcomplicate it because they can’t handle its simplicity. They’ll snowflake it up (more on that tomorrow) or drown it in metadata until it’s unrecognizable. I once worked with a team that spent weeks debating surrogate keys for a star schema that was already humming—meanwhile, the business was begging for actionable numbers. The truth? Star schemas shine when you keep them lean. Over-engineer it, and you’re just flexing for the wrong crowd.&lt;/p&gt;

&lt;p&gt;Sure, it’s not perfect. Denormalization means redundancy—updating a customer’s address might hit multiple rows, and that can sting. But in a data warehouse, where reads outnumber writes 100-to-1, who cares? It’s built for analysts, not accountants. So, next time someone smirks at your star schema’s “simplicity,” tell them: “It’s not basic—it’s brilliant.” Then watch their report lag while yours sings.&lt;/p&gt;

</description>
      <category>datawarehouse</category>
      <category>datamodelling</category>
      <category>dataengineering</category>
    </item>
    <item>
      <title>"Data Warehouses: The Silent Powerhouse Your Boss Doesn’t Understand"</title>
      <dc:creator>spkibe</dc:creator>
      <pubDate>Wed, 12 Mar 2025 08:12:10 +0000</pubDate>
      <link>https://dev.to/spkibe/data-warehouses-the-silent-powerhouse-your-boss-doesnt-understand-1b8a</link>
      <guid>https://dev.to/spkibe/data-warehouses-the-silent-powerhouse-your-boss-doesnt-understand-1b8a</guid>
      <description>&lt;p&gt;Picture this: mountains of transactional data piling up in your company’s systems—sales, clicks, shipments, complaints—all screaming for attention. But your fancy OLTP database is choking, optimized for quick inserts, not big-picture insights. Enter the &lt;strong&gt;data warehouse&lt;/strong&gt;: the relational (or multidimensional) beast built for &lt;em&gt;query and analysis&lt;/em&gt;, not petty transaction processing. It’s the unsung hero of business decisions, and most executives don’t even know it exists.&lt;/p&gt;

&lt;p&gt;Then What is a Data WareHouse?&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;It’s a subject-oriented, integrated, time-variant, and non-volatile collection of historical data to support management decision-making.” Translation? It’s a time machine for your business, hoarding years of data from every source imaginable—ERP, CRM, that sketchy Excel sheet your intern made—and turning it into something useful. Non-volatile means once it’s in, it stays in. Time-variant means it evolves with your business. Subject-oriented? It’s laser-focused on what matters: sales trends, customer behavior, profit margins.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;But here’s the controversial bit: data warehouses are overkill for 90% of startups and small fries. You don’t need a Ferrari to drive to the corner store. I’ve seen companies sink millions into a warehouse only to query it once a quarter for a PowerPoint slide. Meanwhile, big players—like retail giants or banks—live or die by them, slicing and dicing historical data to predict the next big move.&lt;/p&gt;

&lt;p&gt;The real kicker? It separates analysis from transactions, so your operational systems don’t crash when the CEO demands a 5-year sales report. It’s not sexy, but it’s the backbone of every KPI dashboard you’ve ever bragged about. So next time someone asks, “Why do we even have this?”—tell them it’s the difference between guessing and knowing.&lt;/p&gt;

</description>
      <category>datawarehouse</category>
      <category>datamodelling</category>
      <category>dataengineering</category>
      <category>programming</category>
    </item>
    <item>
      <title>Uses of Snowflake Schema</title>
      <dc:creator>spkibe</dc:creator>
      <pubDate>Wed, 15 Jan 2025 09:09:37 +0000</pubDate>
      <link>https://dev.to/spkibe/uses-of-snowflake-schema-1e14</link>
      <guid>https://dev.to/spkibe/uses-of-snowflake-schema-1e14</guid>
      <description>&lt;p&gt;The snowflake schema is a type of database schema that organizes data into a centralized fact table surrounded by normalized dimensions. Unlike a star schema, where dimensions are typically denormalized into flat tables, the snowflake schema splits dimensions into related sub-dimensions, reducing data redundancy and improving storage efficiency.&lt;/p&gt;

&lt;p&gt;Dimensions with hierarchies can be decomposed into a snowflake structure when you want to avoid joins to big dimension tables when you are using an aggregate of the fact table. For example, if you have brand information that you want to separate out from a product dimension table, you can create a brand snowflake that consists of a single row for each brand and that contains significantly fewer rows than the product dimension table. The following figure shows a snowflake structure for the brand and product line elements and the brand_agg aggregate table.&lt;/p&gt;

&lt;p&gt;Snowflake schemas are especially useful in scenarios where certain attributes apply only to subsets of a dimension, leading to sparse data and inefficiencies in traditional denormalized structures.&lt;/p&gt;

&lt;p&gt;Below are three practical use cases where the snowflake schema is applied, along with clear data models to demonstrate how it works.&lt;/p&gt;

&lt;h4&gt;
  
  
  &lt;strong&gt;Use Case 1: Large Customer Dimension&lt;/strong&gt;
&lt;/h4&gt;

&lt;p&gt;&lt;strong&gt;Scenario:&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;In businesses such as online marketing, there are two types of customers:&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Anonymous Visitors:&lt;/strong&gt; Identified only by cookie data, with minimal attributes.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Registered Customers:&lt;/strong&gt; Have detailed information, including demographics, address, and payment history.&lt;/p&gt;

&lt;p&gt;Storing these two types of entities in a single table results in &lt;em&gt;inefficiencies&lt;/em&gt; as most attributes remain &lt;em&gt;null&lt;/em&gt; for anonymous visitors.&lt;/p&gt;

&lt;p&gt;Solution:&lt;/p&gt;

&lt;p&gt;Using a snowflake schema:&lt;/p&gt;

&lt;p&gt;The base Customer Dimension holds common attributes for both visitors and registered customers.&lt;/p&gt;

&lt;p&gt;Separate sub-dimensions store specific attributes for Visitors and Registered Customers.&lt;/p&gt;

&lt;p&gt;Data Model:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;+---------------------+        +--------------------------+
|  Customer (Base)    |        | Customer Details (Snow)  |
+---------------------+        +--------------------------+
| Customer_ID (PK)    |--------| Customer_ID (FK)         |
| Customer_Type       |        | Demographics             |
| Last_Visit_Date     |        | Address                 |
| Signup_Date         |        | Payment_History         |
+---------------------+        +--------------------------+

       |
       |
       V
+---------------------+
| Visitors (Snow)     |
+---------------------+
| Visitor_ID (PK)     |
| Cookie_ID           |
| Visit_Frequency     |
| Browsing_History    |
+---------------------+
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h4&gt;
  
  
  &lt;strong&gt;Use Case 2: Financial Product Dimension&lt;/strong&gt;
&lt;/h4&gt;

&lt;p&gt;&lt;strong&gt;Scenario:&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;In financial services, different product types (e.g., loans and insurance) have distinct attributes. Attempting to store all attributes in one dimension results in sparse data, as many attributes will not apply to all products.&lt;/p&gt;

&lt;p&gt;Solution:&lt;/p&gt;

&lt;p&gt;Using a snowflake schema:&lt;/p&gt;

&lt;p&gt;The base Product Dimension contains attributes common to all products.&lt;/p&gt;

&lt;p&gt;Separate sub-dimensions store specialized attributes for different product types.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Data Model:&lt;/strong&gt;&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;+----------------------+        +------------------------------+
| Product (Base)       |        | Product Details (Snowflake) |
+----------------------+        +------------------------------+
| Product_ID (PK)      |--------| Product_ID (FK)             |
| Product_Type         |        | Specialized_Attribute_1     |
| Core_Attribute       |        | Specialized_Attribute_2     |
+----------------------+        +------------------------------+

       |
       |
       V
+----------------------+
| Loan Products (Snow) |
+----------------------+
| Loan_ID (PK)         |
| Interest_Rate        |
| Loan_Term            |
| Collateral_Type      |
+----------------------+

       |
       |
       V
+-----------------------+
| Insurance Products    |
+-----------------------+
| Insurance_ID (PK)     |
| Coverage_Type         |
| Premium_Amount        |
| Policy_Duration       |
+-----------------------+
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h4&gt;
  
  
  &lt;strong&gt;Use Case 3: Multi-Enterprise Calendar Dimension&lt;/strong&gt;
&lt;/h4&gt;

&lt;p&gt;&lt;strong&gt;Scenario:&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;In international businesses, calendars vary by country. For example:&lt;/p&gt;

&lt;p&gt;The US might have specific fiscal quarters and national holidays.&lt;/p&gt;

&lt;p&gt;The UK might have unique bank holidays.&lt;/p&gt;

&lt;p&gt;India might have a calendar with festival-specific dates.&lt;/p&gt;

&lt;p&gt;Storing all attributes in one table leads to complexity and inefficiency.&lt;/p&gt;

&lt;p&gt;Solution:&lt;/p&gt;

&lt;p&gt;Using a snowflake schema:&lt;/p&gt;

&lt;p&gt;The &lt;strong&gt;base Calendar Dimension&lt;/strong&gt; contains attributes common to all countries.&lt;/p&gt;

&lt;p&gt;Separate sub-dimensions store country-specific calendar attributes.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Data Model:&lt;/strong&gt;&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;+----------------------+        +----------------------------+
| Calendar (Base)      |        | US Calendar (Snowflake)   |
+----------------------+        +----------------------------+
| Calendar_ID (PK)     |--------| Calendar_ID (FK)          |
| Date                |         | National_Holiday          |
| Week_Number          |        | US_Fiscal_Quarter         |
| Fiscal_Year          |        | US_Specific_Attribute     |
+----------------------+        +----------------------------+

       |
       |
       V
+----------------------------+
| UK Calendar (Snowflake)    |
+----------------------------+
| Calendar_ID (FK)           |
| National_Holiday           |
| Bank_Holiday               |
| UK_Fiscal_Quarter          |
+----------------------------+
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h4&gt;
  
  
  &lt;strong&gt;Conclusion&lt;/strong&gt;
&lt;/h4&gt;

&lt;p&gt;The snowflake schema is an efficient and organized approach to handling complex dimensions with sparse data. By breaking down dimensions into smaller, logical sub-dimensions, it:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Reduces storage requirements.&lt;/li&gt;
&lt;li&gt;Improves query performance for specific attribute groups.&lt;/li&gt;
&lt;li&gt;Enhances clarity in schema design.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;The examples above highlight how snowflake schemas can be applied to real-world scenarios, such as customer data, financial products, and multi-country calendars, ensuring data is both accessible and efficiently structured.&lt;/p&gt;

</description>
      <category>datamodelling</category>
      <category>datawarehouse</category>
      <category>dataengineering</category>
      <category>sql</category>
    </item>
    <item>
      <title>Web Scraping - Buy rent kenya website</title>
      <dc:creator>spkibe</dc:creator>
      <pubDate>Mon, 26 Feb 2024 02:35:42 +0000</pubDate>
      <link>https://dev.to/spkibe/web-scraping-buy-rent-kenya-website-42bh</link>
      <guid>https://dev.to/spkibe/web-scraping-buy-rent-kenya-website-42bh</guid>
      <description>&lt;p&gt;Web Scraping is getting data from websites that is contained in it's html tags of the website.&lt;br&gt;
Here is the link to the website we'll be scraping (&lt;a href="https://www.buyrentkenya.com/"&gt;https://www.buyrentkenya.com/&lt;/a&gt;) This websites list the the projects and house available for selling or renting in kenya.&lt;br&gt;
I utilized BeautifulSoup, Python library to scrape this site. The first thing to do is to install the necessary libraries. I used other tools like requests and pandas.&lt;br&gt;
To easily easily install these python libraries it's wise to create a python environment that will contain our required libraries.&lt;br&gt;
utilizing the Virtualenv tool, we set up the environment, firstly install the tool:&lt;br&gt;
&lt;code&gt;pip install virtualenv&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;To use venv in your project, in your terminal, create a new project folder, cd to the project folder in your terminal, and run the following command:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;mkdir web_scraping #creating a new folder
cd web_scraping 
python -m venv venv # creating and environment named venv 
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;to activate the environment use&lt;br&gt;
&lt;code&gt;source venv/bin/activate&lt;/code&gt; - for Linux and Mac users&lt;br&gt;
&lt;code&gt;Scripts\activate&lt;/code&gt; - for Windows users.&lt;/p&gt;

&lt;p&gt;After activating the environment you need to install the required libraries:&lt;br&gt;
Below is a snippet of how I did the above processes:&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fwocednik7dl9665pxm2m.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fwocednik7dl9665pxm2m.png" alt="Image description" width="726" height="207"&gt;&lt;/a&gt;&lt;br&gt;
Now the environment is ready, we are set to begin our web Scraping process.&lt;/p&gt;

&lt;p&gt;Getting Started:&lt;br&gt;
Before we dive into the code, let's understand the goal. We want to collect data on houses for rent, including details such as title, location, number of bedrooms and bathrooms, description, and price. We'll be scraping data from multiple pages to create a comprehensive dataset.&lt;/p&gt;

&lt;p&gt;Create a python script, mine I named buy_rent_kenya.py.&lt;br&gt;
The code is well-structured and efficient, following these main steps:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Send a GET request to the initial URL.&lt;/li&gt;
&lt;li&gt;Use BeautifulSoup to parse the HTML content.&lt;/li&gt;
&lt;li&gt;Extract information from each listing on the page.&lt;/li&gt;
&lt;li&gt;Iterate through multiple pages, repeating the process.&lt;/li&gt;
&lt;li&gt;Store the collected data in a Pandas DataFrame.&lt;/li&gt;
&lt;li&gt;Save the DataFrame to a CSV file.&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;import the necessary libraries for our task as below.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;import pandas as pd
from bs4 import BeautifulSoup
import requests
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Next thing is to get your browser agent, just search "&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;what is my browser agent&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;On your browser and you'll definitely get it.&lt;br&gt;
or get it from this link &lt;a href="https://www.whatismybrowser.com/detect/what-is-my-user-agent/"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;The &lt;strong&gt;browser agent&lt;/strong&gt; in web scraping is crucial for mimicking different browsers, avoiding detection by websites, and ensuring compatibility. It helps prevent being flagged as a scraper, allows access to content tailored for specific browsers, and enhances overall scraping efficiency.&lt;br&gt;
&lt;/p&gt;


&lt;/blockquote&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;url = "https://www.buyrentkenya.com/houses-for-rent"
agent = "XXXXXXXXXXXXXXXXXXXXXXXXXXXXXX"
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;These lines set the target URL and the user agent, which simulates a web browser. It helps in avoiding any potential blocking or restrictions imposed by the website.&lt;br&gt;
Note: Replace the agent with yours, obtained from above search.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;# Set headers for the HTTP request
HEADERS = ({'User-Agent':agent,'Accept-Language':'en-US, en;q=0.5'})
# Send a GET request to the URL
response = requests.get(url,headers=HEADERS)

&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Here, headers are defined for the HTTP request, and a GET request is made to the specified URL using 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;# Parse the HTML content with BeautifulSoup
soup = BeautifulSoup(response.content,'html.parser')

&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The HTML content of the page is parsed using BeautifulSoup, making it easier to navigate and extract information.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;# Initialize lists to store data
titles = []
locations = []
no_of_bathrooms = []
no_of_bedrooms = []
descriptions = []
prices = []
links= []
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Empty lists are initialized to store the extracted data.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;# Find all listing cards on the page
houses = soup.find_all("div",class_="listing-card")
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;This line locates all HTML elements with the class "listing-card," which corresponds to individual housing listings on the page.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;# Extract information from each listing
for house in houses:
    # Extract title
    title = house.find("span",class_="relative top-[2px] hidden md:inline").text.strip()
    # Extract location
    location = house.find("p",class_="ml-1 truncate text-sm font-normal capitalize text-grey-650").text.strip()
    # Extract number of bedrooms and bathrooms
    no_of_bedroom = house.find_all("span",class_="whitespace-nowrap font-normal")[0].text.strip()
    no_of_bathroom = house.find_all("span",class_="whitespace-nowrap font-normal")[1].text.strip()
    # Extract description
    description = house.find("a",class_="block truncate text-grey-500 no-underline").text.strip()
    # Extract price
    price = house.find("p",class_="text-xl font-bold leading-7 text-grey-900").text.strip()
    # Extract link
    link = house.find("a",class_="text-black no-underline").get("href")

    # Append extracted data to respective lists
    titles.append(title)
    locations.append(location)
    no_of_bathrooms.append(no_of_bathroom)
    no_of_bedrooms.append(no_of_bedroom)
    descriptions.append(description)
    prices.append(price)
    links.append(link)
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;In this loop, data such as title, location, number of bedrooms and bathrooms, description, price, and link are extracted from each listing and appended to their respective lists.&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;The title is found within a span tag with the class "relative top-[2px] hidden md:inline". &lt;/li&gt;
&lt;li&gt;Both the number of bedrooms and bathrooms are within span tags with the same class "whitespace-nowrap font-normal". Thus we need to utilize the BeautifulSoup find_all()which returns them as a list, thus we use indexing to return each differently. The index [0] corresponds to bedrooms, and [1] corresponds to bathrooms.&lt;/li&gt;
&lt;li&gt;The description is found within an a tag with the class "block truncate text-grey-500 no-underline".&lt;/li&gt;
&lt;li&gt;The price is located within a p tag with the class "text-xl font-bold leading-7 text-grey-900".&lt;/li&gt;
&lt;li&gt;The link is obtained from an a tag with the class "text-black no-underline" using the get("href") method.&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;Note:  Make sure to inspect the HTML structure of the website you are scraping to adapt these identifiers accordingly. If the website structure changes, you may need to update these selectors accordingly.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;# Display the number houses extracted from the first page about the first page
print(f"The First Page No Of Titles is {len(titles)}")
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;This prints out the number of titles on the first page.&lt;/p&gt;

&lt;p&gt;The website has a pagination after the first page, which changes dynamic on the url, incrementing its number in the format below:&lt;/p&gt;

&lt;p&gt;&lt;code&gt;url = f"https://www.buyrentkenya.com/houses-for-rent?page={page}&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;Thus a code to extract more information for the pagenated urls is like as:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;# Iterate through multiple pages
for page in range(2,56):
    url = f"https://www.buyrentkenya.com/houses-for-rent?page={page}"
    # Make a GET request for each page
    response = requests.get(url,headers=HEADERS)
    print(url)
    houses = soup.find_all("div",class_="listing-card")
    for house in houses:
        # Repeat the process of extracting data from each listing
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;These lines iterate through multiple pages, updating the URL for each page, making a GET request, and extracting data from each listing on the page.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;# Display the total number of titles scraped
print(f"The  Total no of Titles we have scraped is {len(titles)}")
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;This prints out the total number of titles scraped from all pages.&lt;/p&gt;

&lt;p&gt;The Last part is to save our extracted data into a csv file:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;# Organize data into a DataFrame
data = {
    "Titles": titles,
    "Locations": locations,
    "No Of Bathrooms": no_of_bathrooms,
    "No Of Bedrooms": no_of_bedrooms,
    "Prices": prices,
    "Description": descriptions
}
df = pd.DataFrame(data)
print(df.shape)
#print(df.head(10))
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The extracted data is organized into a Pandas DataFrame for better structure and analysis.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;# Save DataFrame to a CSV file
df.to_csv("buy_rent_kenya.csv",index=False)

&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Finally, the DataFrame is saved as a CSV file named "buy_rent_kenya.csv". The index=False parameter ensures that the DataFrame index is not included in the CSV file.&lt;/p&gt;

&lt;h2&gt;
  
  
  Conclusion
&lt;/h2&gt;

&lt;p&gt;Web scraping is a powerful tool for extracting valuable information from websites. This Python script provides a glimpse into the process of scraping rental property listings from Buy Rent Kenya. Keep in mind that web scraping should be done responsibly and in compliance with the terms of service of the website being scraped.&lt;/p&gt;

&lt;p&gt;Feel free to explore, modify, and adapt the code for your specific needs. Happy coding and may your data exploration endeavors be fruitful.&lt;br&gt;
Here is the link to the full code on github&lt;/p&gt;

&lt;p&gt;Be in the look out for our next article automating the Scraping process above Using Airflow.&lt;/p&gt;

</description>
    </item>
    <item>
      <title>Introduction to Data Structures and Algorithms.</title>
      <dc:creator>spkibe</dc:creator>
      <pubDate>Mon, 20 Jun 2022 19:05:25 +0000</pubDate>
      <link>https://dev.to/spkibe/introduction-to-data-structures-and-algorithms-4l6h</link>
      <guid>https://dev.to/spkibe/introduction-to-data-structures-and-algorithms-4l6h</guid>
      <description>&lt;p&gt;A carpenter has several tools, yet each one has a specific purpose in completing a task. Similar to a programmer, depending on the task at hand, programmers will require the appropriate tool to handle a certain challenge.&lt;br&gt;
Data structures are programmers' tools, and each one serves a specific purpose. Many companies uses data structures challenges in their interviews to see if a programmer is a strong problem solver.&lt;br&gt;
Data structures are classified into two major sections:&lt;br&gt;
    1. Linear Data structures → stores data in a sequential manner.&lt;br&gt;
    2. Non-linear Data Structure → stores data in a  non- sequential manner.&lt;/p&gt;

&lt;p&gt;Types of Linear data structures:&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;1) Arrays → stores values in arranged continuous memory. Elements stored in the arrays are determined by the programming language.
2) Stack →  It stores its elements according to the LIFO (last in, first out) principle, which means that the last element added is the first one withdrawn.
3) Queues → It stores its elements using the FIFO (first in, first out) principle, which means that the first element inserted will be the first one withdrawn
4) LinkedList → It organizes its data as a connected network of nodes, with each element containing the address of the next node.
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;

&lt;p&gt;Types of  Non-Linear data structures:&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;1) Graphs → it’s made up of nodes or vertices and edges. Edges connects two nodes.
2) Trees → stores data in a hierarchical manner which is tree-like structures arranged in multiple levels. It has the root node(top most part) which is the central node. 
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;

&lt;p&gt;Algorithms&lt;br&gt;
Is a set of instructions or procedure for solving a specific problem, you can think of it as a recipe to solve a problem or as a blueprint for solving a problem to make it easier to grasp.&lt;br&gt;
Types of Algorithms:&lt;br&gt;
    1) Sort algorithms&lt;br&gt;
    2) Search algorithms&lt;br&gt;
    3) Hashing&lt;/p&gt;

&lt;p&gt;Each written algorithm uses some memory to complete. This is where algorithm complexity comes into play; it calculates the amount of time and space required to execute an algorithm.&lt;br&gt;
Space complexity → The overall amount of space taken up by the algorithm in relation to the input size.&lt;br&gt;
Time complexity → is the amount of time algorithms takes to run. It is mostly expressed using the big O notation(asymptotic notation to represent time complexity). For example,a problem of size n:&lt;br&gt;
    1. O(1) is a constant-time function&lt;br&gt;
    2. O(n) is a linear-time function&lt;br&gt;
    3. O(n^2) is a quadratic-time function&lt;/p&gt;

</description>
      <category>beginners</category>
      <category>algorithms</category>
      <category>datastructures</category>
      <category>programming</category>
    </item>
  </channel>
</rss>
