<?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" xmlns:cc="http://cyber.law.harvard.edu/rss/creativeCommonsRssModule.html">
    <channel>
        <title><![CDATA[Stories by Simon Mayer on Medium]]></title>
        <description><![CDATA[Stories by Simon Mayer on Medium]]></description>
        <link>https://medium.com/@simon.mayer90?source=rss-d5fc1fc7b8ec------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/1*aoHW0DuluanjOUmzmWPJqg.png</url>
            <title>Stories by Simon Mayer on Medium</title>
            <link>https://medium.com/@simon.mayer90?source=rss-d5fc1fc7b8ec------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Sat, 05 Dec 2026 00:13:35 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@simon.mayer90/feed" rel="self" type="application/rss+xml"/>
        <webMaster><![CDATA[yourfriends@medium.com]]></webMaster>
        <atom:link href="http://medium.superfeedr.com/" rel="hub"/>
        <item>
            <title><![CDATA[How I set up my first automated Data Pipeline in the Cloud]]></title>
            <link>https://medium.com/@simon.mayer90/how-i-set-up-my-first-automated-data-pipeline-in-the-cloud-d3f497cc644c?source=rss-d5fc1fc7b8ec------2</link>
            <guid isPermaLink="false">https://medium.com/p/d3f497cc644c</guid>
            <category><![CDATA[data-engineering]]></category>
            <category><![CDATA[data-science-training]]></category>
            <category><![CDATA[data-science]]></category>
            <dc:creator><![CDATA[Simon Mayer]]></dc:creator>
            <pubDate>Thu, 11 Aug 2022 15:40:06 GMT</pubDate>
            <atom:updated>2022-08-12T10:24:44.839Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*dkP3R9ydK_iTkOic" /><figcaption>Photo by <a href="https://unsplash.com/@sortino?utm_source=medium&amp;utm_medium=referral">Joshua Sortino</a> on <a href="https://unsplash.com/?utm_source=medium&amp;utm_medium=referral">Unsplash</a></figcaption></figure><p>As a Data Scientist in the making (see <a href="https://www.wbscodingschool.com/data-science-bootcamp/">WBS Coding School</a>), I was setting up my first data pipeline in the last couple of days, moved it to the cloud and automated it fully. Here is how I did it:</p><ul><li><strong>Data Collection:</strong> I collected the data via webscraping, APIs and csv files using Python</li><li><strong>Data Storage:</strong> I created a MySQL database in which I stored the gathered data</li><li><strong>Data to the Cloud:</strong> I moved my data to the cloud using Amazon’s Relational Database Service (RDS)</li><li><strong>Pipeline Automation:</strong> I automated the whole data collection and storage process with AWS (= Amazon Web Services) Lambda</li></ul><p><strong>The Project Background<br>“</strong>Gans” is a startup developing an e-scooter-sharing system. It aspires to operate in the most populous cities all around the world. In each city, it will have hundreds of e-scooters parked in the streets and allow users to rent them by the minute.</p><p>The goal is to collect data from external sources that can potentially help Gans predict e-scooter movement, so that the scooters will be parked where users need them. Since data is needed every day, in real-time, and accessible by everyone in the company, the solution is to assemble and automate a data pipeline in the cloud.</p><p>To achieve that goal, I collected data regarding city population, weather prediction, and flight arrivals.</p><p><strong>Data Collection<br></strong>Collecting the data is the first step in my Data Engineering Pipeline. The good thing is, that the internet is full of data. But it is not always easy to get the data that you need. I basically used three different aproaches to gather my data.</p><ul><li>Search for useful data on websites and gather it through webscraping techniques using <a href="https://www.python.org/">python</a> and <a href="https://www.crummy.com/software/BeautifulSoup/bs4/doc/">BeautifulSoup</a></li><li>Search for APIs from which I can request the data — a good starting point is <a href="https://rapidapi.com/hub">RapidAPI</a>, a hub with a huge collection of APIs</li><li>Search for existing data as e.g. .csv files that can be downloaded and used as additional sources</li></ul><p><strong>Gathering City Data via Webscraping Wikipedia</strong><br>First of all I collected some data about the population of the cities where Gans is active. I gathered the information through webscraping Wikipedia. Here is my code:</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/61528d9fc33b11e261824baaa3d7c178/href">https://medium.com/media/61528d9fc33b11e261824baaa3d7c178/href</a></iframe><p><strong>Gathering weather predictions via API<br></strong>Second, I gathered the weather predictions for the next couple of days using an API from OpenWeatherMap. When you make an API request, you will receive the answer as a JSON file. From that you need to extract the relevant data. Here is how I did it:</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/38a761d32f8408e5f3469f54c6d7446f/href">https://medium.com/media/38a761d32f8408e5f3469f54c6d7446f/href</a></iframe><p><strong>Gathering flight arrivals through RapidAPI<br></strong>Third, I needed to gather all the flight arrivals for Berlin. To achieve that I used <a href="https://rapidapi.com/">RapidAPI</a>, a hub for more than 30.000 APIs. When you sign up on the page, you are able to make 200 API requests per month for free. I used the Aerodatabox API to get the data for the flight arrivals at the Berlin Airport (it has the icao Code “EDDB”):</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/262e8e956b8912c5f22f04bf018ecc99/href">https://medium.com/media/262e8e956b8912c5f22f04bf018ecc99/href</a></iframe><p><strong>Processing Airport Data via csv file<br></strong>Last but not least I needed some data concerning the airports. For this information I just used a static csv file and processed it using the Pandas module. Pretty straightforward stuff:</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/912a7dee2dc6c4860ab271d952530c1b/href">https://medium.com/media/912a7dee2dc6c4860ab271d952530c1b/href</a></iframe><p><strong>Data Storage</strong><br>After gathering all the necessary data the next step is to store it in a database. To do that I set up a local MySQL database. In the MySQL Workbench I can run a sql script that creates all the necessary tables with every column needed (be careful to define an appropriate datatype) and connect them via a primary key — foreign key connection:</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/7e91f3c4eadf50d101c1eae27d3f5ddf/href">https://medium.com/media/7e91f3c4eadf50d101c1eae27d3f5ddf/href</a></iframe><p>Here you can see the resulting database scheme:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/712/1*nTqVKfItlwMxs1Ei88GMGQ.png" /></figure><p><strong>Filling the database using python<br></strong>Now we do have a database, but it is still empty. To fill it with our data, we use the python module sqlalchemy:</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/892a046133e3b1cad3cce862966edbb6/href">https://medium.com/media/892a046133e3b1cad3cce862966edbb6/href</a></iframe><p><strong>Data to the Cloud<br></strong>The next step is to move our database to the cloud. As Amazon Web Services is the biggest player in the Cloud Business I used its Relational Database Service to create an online MySQL instance (when you set up an AWS Account you can use some of its services for free for 12 months which is pretty amazing):</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*KrTvxHRmbPi6sdZfAxvUGg.png" /></figure><p>After creating the instance I used the same sql script I used for my local MySQL instance to create the tables needed and fill the tables with my python scripts. All I had to do was to change the connection parameters:</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/b5de432db57f94808c43885a45f147a3/href">https://medium.com/media/b5de432db57f94808c43885a45f147a3/href</a></iframe><p><strong>Pipeline Automation<br></strong>In the end there is only one more step needed: To automate the pipeline. Because the flight arrivals and the weather predictions will change every day the python script that makes the API calls and updates the tables in the database will have to run every day, too. This is where AWS Lambda and EventBridge come into play. These services will allow you to run your scripts automated and periodically in the cloud at a scheduled time (known as <a href="https://en.wikipedia.org/wiki/Cron">cron</a>).</p><p>First of all we need to create a new Lambda function and choose python as the programming language:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*xm77kosgGAQdmQiIFxIX3A.png" /></figure><p>After that, we can fill the lambda_handler function with our python scripts, here is an extract of my code:</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/fc7aa880c0a8600d3f2abdb7b826b5ba/href">https://medium.com/media/fc7aa880c0a8600d3f2abdb7b826b5ba/href</a></iframe><p>Last but not least we have to set up a cronjob with EventBridge, so that the script will be run automatically every day. First, let’s add a trigger:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*HjQPvaJ0Sfn7W4pG7yh4rg.png" /></figure><p>Second, we need to define the time schedule with a cron expression. For example cron(0 0 * * ? *) means that the script will be run every day at 0:00 am.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/757/1*rC8jkz1D0bxJKkvIhHHpdQ.png" /></figure><p>And that’s it! My Data Pipeline is now fully automated and available in the cloud for everyone with access rights, from everywhere, everytime!</p><p><strong>Conclusion<br></strong>I learned a lot in these two weeks! Data Engineering is no easy task, there is so much involved! But with the massive data available today and cloud applications becoming the new standard, good Data Engineers will be indispensable for most companies and can add a huge benefit to a lot of business models.</p><p>That’s why I am thankful for the opportunity to do this little project in the <a href="https://www.wbscodingschool.com/data-science-bootcamp/">WBS Data Science Bootcamp</a> and get a firsthand experience of Data Engineering.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=d3f497cc644c" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>