Book Image

Python Essentials for AWS Cloud Developers

By : Serkan Sakinmaz
4 (1)
Book Image

Python Essentials for AWS Cloud Developers

4 (1)
By: Serkan Sakinmaz

Overview of this book

AWS provides a vast variety of services for implementing Python applications, which can pose a challenge for those without an AWS background. This book addresses one of the more predominant problems of choosing the right service and stepping into the implementation of exciting Python apps using AWS. The book begins by showing you how to install Python and create an AWS account, before helping you explore AWS Lambda, EC2, Elastic Beanstalk, and S3 for Python programming. You'll then gain hands-on experience in using these services to build the Python application. As you advance, you'll discover how to debug Python apps using PyCharm, and then start deploying the Python applications on Elastic Beanstalk. You’ll also learn how to monitor Python applications using the CloudWatch service, along with creating and publishing APIs on AWS to access the Python application. The concluding chapters will help you get to grips with storing unstructured and semi-structured data using NoSQL and DynamoDB, as well as advance your knowledge using the Glue serverless data integration service in AWS. By the end of this Python book, you’ll be able to take your application development skills up a notch with AWS services and advance in your career.
Table of Contents (18 chapters)
Part 1: Python Installation and the Cloud
Part 2: A Deep Dive into AWS with Python
Part 3: Useful AWS Services to Implement Python

Database operations with Python

In this section, we are going to read a table using Python. To execute a Python function, we will use PyCharm on a local computer. Carry out the following steps:

  1. Open PyCharm or an IDE, whichever you prefer.
  2. We are going to install MySQL Connector to PyCharm. MySQL Connector will be used for database operations from Python. In PyCharm, select File | New Projects Setup | Preferences for New Projects…:

Figure 8.28 – Preferences

  1. In the panel, select Python Interpreter:

Figure 8.29 – Python Interpreter

  1. To add a new package, click the + symbol:

Figure 8.30 – Adding a package

  1. In the upcoming panel, type mysql-conn to install mysql-connector. You will be able to see mysql-connector. Click Install Package to install it:

Figure 8.31 – Installing mysql-connector