Book Image

Data Ingestion with Python Cookbook

By : Gláucia Esppenchutz
Book Image

Data Ingestion with Python Cookbook

By: Gláucia Esppenchutz

Overview of this book

Data Ingestion with Python Cookbook offers a practical approach to designing and implementing data ingestion pipelines. It presents real-world examples with the most widely recognized open source tools on the market to answer commonly asked questions and overcome challenges. You’ll be introduced to designing and working with or without data schemas, as well as creating monitored pipelines with Airflow and data observability principles, all while following industry best practices. The book also addresses challenges associated with reading different data sources and data formats. As you progress through the book, you’ll gain a broader understanding of error logging best practices, troubleshooting techniques, data orchestration, monitoring, and storing logs for further consultation. By the end of the book, you’ll have a fully automated set that enables you to start ingesting and monitoring your data pipeline effortlessly, facilitating seamless integration with subsequent stages of the ETL process.
Table of Contents (17 chapters)
1
Part 1: Fundamentals of Data Ingestion
9
Part 2: Structuring the Ingestion Pipeline

Creating our NoSQL table in MongoDB

After successfully connecting and understanding how Studio 3T works, we will now import some MongoDB collections. We have seen in the Connecting to a NoSQL database (MongoDB) recipe how to get started with MongoDB, and in this recipe, we will import a MongoDB database and come to understand its structure. Although MongoDB has a specific format to organize data internally, understanding how a NoSQL database behaves is crucial when working with data ingestion.

We will practice by ingesting the imported collections in the following recipes in this chapter.

Getting ready

For this recipe, we will use a sample dataset of Airbnb reviews called listingsAndReviews.json. You can find this dataset in the GitHub repository of this book at https://github.com/PacktPublishing/Data-Ingestion-with-Python-Cookbook/tree/main/Chapter_5/datasets/sample_airbnb. After downloading it, put the file into our mongo-local directory, created in Chapter 1.

I kept...