Thursday, October 22, 2020

1.5 Parse API Data Formats with Python

 

Parse API Data Formats with Python

Different types of data formats require different approaches to obtain a specific value when being parsed. In Python, there are many modules to parse a wide variety of data formats. You will focus on parsing YAML, JSON, and XML files with the most used modules. But first, you will prepare the development environment when developing in Python and get to know Visual Studio Code.

Note

Click the Initialize button to start the lab. A progress bar will show you when the lab is initialized and active. Please be patient with the initialization process; several components are loading and getting ready.

After the initialization is complete, start the lab within 10 minutes, or it will be automatically terminated. After you have entered the active lab, do not navigate away from the lab page until you have completed that lab exercise, or it will be terminated.

Note

In case you encounter issues with writing code during the lab, please find the final code snippets in the /home/lab_solutions directory. 



You are using a US English keyboard layout. This cannot be changed once the lab has initialized.

 Visit Device Help for info about changing the OS keyboard layout and screen resolution after lab initialization.


You may navigate away from this page once you begin initializing the lab.

You will be notified once the devices are ready.

Prepare Development Environment

In this procedure, you will set up the environment for developing code in Python. First you will familiarize yourself with Visual Studio Code, which is an integrated development environment (IDE) where you will edit and manage the code with the included tools. You will review the files and folders in the working directory and try to run the Python code using pipenv, a tool for managing Python packages and virtual environments.

Virtual environments allow you to develop and run different Python projects independently, without having to worry about package version clashes (for example, an older project relying on an obsolete version of a package, while a different project requires the latest version). With a pipenv tool, you can select the version of Python your project will use, so some projects can still use the older version 2, while others use the newer version 3. You can also add or remove packages using pip inside the virtual environment; simply run pipenv install or pipenv uninstall instead of pip install or pip uninstall. The configuration of the virtual environment is kept inside the Pipfile to allow easy reinstallation if required.


No comments:

Post a Comment