0% found this document useful (0 votes)
36 views

Coding - Python Camp - Notes

The document describes how to programmatically add data to a Google Sheet using the Google Sheets API and Python. It involves creating a Google Sheet, obtaining API credentials, installing required Python libraries, defining the data to add as a list, and making a API call to append the data to the sheet. Code examples are provided to authenticate with the API and make the API call to add the row of data to the sheet.

Uploaded by

Sina
Copyright
© © All Rights Reserved
Available Formats
Download as TXT, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
36 views

Coding - Python Camp - Notes

The document describes how to programmatically add data to a Google Sheet using the Google Sheets API and Python. It involves creating a Google Sheet, obtaining API credentials, installing required Python libraries, defining the data to add as a list, and making a API call to append the data to the sheet. Code examples are provided to authenticate with the API and make the API call to add the row of data to the sheet.

Uploaded by

Sina
Copyright
© © All Rights Reserved
Available Formats
Download as TXT, PDF, TXT or read online on Scribd
You are on page 1/ 5

Date, 4th, April

Day 38
- Create a new Google Sheet: First, create a new Google Sheet to store your workout
data. You can do this by going to Google Drive, clicking the "New" button, and
selecting "Google Sheets". Give your sheet a name, and add column headers for the
different types of data you want to track (e.g. "Date", "Exercise", "Reps",
"Weight").

Get API credentials: In order to access your Google Sheet programmatically, you'll
need to obtain API credentials. You can do this by following the instructions in
Google's API documentation, which will guide you through creating a new project,
enabling the Sheets API, and generating API keys.

Install required libraries: You'll need to install a few Python libraries to


interact with the Google Sheets API. The google-auth and google-auth-oauthlib
libraries are used to authenticate your API credentials, while the google-api-
python-client library is used to interact with the Sheets API. You can install
these libraries using pip.

- from google.oauth2 import service_account


from googleapiclient.discovery import build

# Path to your API credentials JSON file


credentials_file = 'path/to/credentials.json'

# ID of your Google Sheet (found in the Sheet's URL)


sheet_id = 'your_sheet_id_here'

# Create an authorized API client


creds = service_account.Credentials.from_service_account_file(credentials_file)
service = build('sheets', 'v4', credentials=creds)

# Define the new row of data to add


new_row = ['4/8/2023', 'Squats', 10, 135]

# Add the new row to the Sheet


sheet_range = 'Sheet1!A1:D1' # replace with the range of cells where you want to
add the data
service.spreadsheets().values().append(
spreadsheetId=sheet_id,
range=sheet_range,
valueInputOption='USER_ENTERED',
insertDataOption='INSERT_ROWS',
body={'values': [new_row]}
).execute()

Date, 5th April

Day 39

- The project uses Python libraries such as BeautifulSoup, Selenium, and Requests
to scrape flight information from a website.
The program then checks the prices against a set threshold and sends an email
notification to the user if a deal is found.
The user can configure the program to search for specific airports, dates, and
destination cities.
The project is designed to help users save money by finding flight deals that they
may not have otherwise discovered.
To run the program, you will need to set up a virtual environment and install the
required libraries.
The code is written in Python 3 and can be edited and customized to fit your needs.
This project is a great way to learn about web scraping, data manipulation, and
email automation using Python.

Date, 6th April, 2023

Day 40
- The Flight Club Capstone project involves building a web application that allows
users to search for flights between two cities and view information about those
flights, such as the airline, departure and arrival times, and ticket prices. The
project requires you to use several Python libraries, including Flask, SQLAlchemy,
and Jinja2, as well as APIs from several airlines to retrieve flight data.

- To approach the project, the beginner had to set up their development environment
by installing Python, Flask, SQLAlchemy, and Jinja2, as well as creating a virtual
environment for their project to ensure that dependencies were isolated from other
Python projects on their system.

They then designed their database schema by creating a database schema to store
information about flights, airports, and airlines using SQLAlchemy to define the
schema and create the database tables.

Next, they retrieved flight data by using APIs from airlines to retrieve
information about flights between two cities. They used Python's requests library
to make HTTP requests to the API endpoints, and json to parse the response data.

They then stored flight data in their database by using SQLAlchemy to create
database records for flights, airports, and airlines.

Afterwards, they created a web interface that allowed users to search for flights
and view information about them. They used Flask and Jinja2 to create templates for
their web pages, and to handle HTTP requests and responses.

Once the beginner was satisfied that their application worked correctly and there
were no bugs, they tested their application by using Python's built-in unittest
library to create test cases for their code.

Finally, they deployed their application to a web server so that others could use
it. There were many options for hosting a Flask application, such as Heroku, AWS,
or Google Cloud Platform.

While the Flight Club Capstone project was a challenging project, it was also a
great opportunity for a beginner in Python to practice their skills and build a
real-world application.

Date, 7th April, 2023

Day 41
- HTML code is made up of elements, which are enclosed in angled brackets, like
this: <element>. Elements can contain content, such as text or images, and can also
have attributes that provide additional information about the element.

For example, the <p> element is used to define a paragraph of text.


-

<html>
<head>
<title>My Webpage</title>
</head>
<body>
<h1>Welcome to my
we111111111111111111111111111111111111111111111111111111111111111111111111111111111
11111111111111111`36```````````````````````````````````````````````````````````````
```````````````````````````````````````````````````````````````````````````````````
```````````````````````````````````````````````````````````````````````````````````
```````````````````````````````````````````````````````````````````````````````````
```````````````````````````````````````````````````````````````````````````````````
```````````````````````````````````````````````````````````````````````````````````
```````````````````````````````````````````````````````````````````````````````````
```````````````````````````````````````````````````````````````````````````````````
```````````````````````````````````````````````````````````````````````````````````
```````````````````````````````````````````````````````````````````````````````````
```````````````````````````````````````````````````````````````````````````````````
```````````````````````````````````````````````````````````````````````````````````
```````````````````````````````````````````````````````````````````````````````````
```````````````````````````````````````````````````````````````````````````````````
```````````````````````````````````````````````````````````````````````````````````
```````````````````````````````````````````````````````````````````````````````````
```````````````````````````````````````````````````````````````````````````````````
```````````````````````````````````````````````````````````````````````````````````
```````````````````````````````````````````````````````````````````````````````````
```````````````````````````````````````````````````````````````````````````````````
```````````````````````````````````````````````````````````````````````````````````
```````````````````````````````````````````````````````````````````````````````````
```````````````````````````````````````````````````````````````````````````````````
```````````````````````````````````````````````````````````````````````````````````
```````````````````````````````````````````````````````````````````````````````````
```````````````````````````````````````````````````````````````````````````````````
```````````````````````````````````````````````````````````````````````````````````
```````````````````````````````````````````````````````````````````````````````````
```````````````````````````````````````````````````````````````````````````````````
```````````````````````````````````````````````````````````````````````````````````
```````````````````````````````````````````````````````````````````````````````````
```````````````````````````````````````````````````````````````````````````````````
```````````````````````````````````````````````````````````````````````````````````
```````````````````````````````````````````````````````````````````````````````````
```````````````````````````````````````````````````````````````````````````````````
```````````````````````````````````````````````````````````````````````````````````
```````````````````````````````````````````````````````````````````````````````````
```````````````````````````````````````````````````````````````````````````````````
```````````````````````````````````````````````````````````````````````````````````
```````````````````````````````````````````````````````````````````````````````````
```````````````````````````````````````````````````````````````````````````````````
```````````````````````````````````````````````````````````````````````````````````
```````````````````````````````````````````````````````````````````````````````````
```````````````````````````````````````````````````````````````````````````````````
```````````````````````````````````````````````````````````````````````````````````
```````````````````````````````````````````````````````````````````````````````````
```````````````````````````````````````````````````````````````````````````````````
```````````````````````````````````````````````````````````````````````````````````
```````````````````````````````````````````````````````````````````````````````````
```````````````````````````````````````````````````````````````````````````````````
```````````````````````````````````````````````````````````````````````````````````
```````````````````````````````````````````````````````````````````````````````````
```````````````````````````````````````````````````````````````````````````````````
```````````````````````````````````````````````````````````````````````````````````
```````````````````````````````````````````````````````````````````````````````````
```````````````````````````````````````````````````````````````````````````````````
```````````````````````````````````````````````````````````````````````````````````
```````````````````````````````````````````````````````````````````````````````````
```````````````````````````````````````````````````````````````````````````````````
```````````````````````````````````````````````````````````````````````````````````
```````````````````````````````````````````````````````````````````````````````````
```````````````````````````````````````````````````````````````````````````````````
```````````````````````````````````````````````````````````````````````````````````
```````````````````````````````````````````````````````````````````````````````````
```````````````````````````````````````````````````````````````````````````````````
```````````````````````````````````````````````````````````````````````````````````
```````````````````````````````````````````````````````````````````````````````````
```````````````````````````````````````````````````````````````````````````````````
```````````````````````````````````````````````````````````````````````````````````
```````````````````````````````````````````````````````````````````````````````````
```````````````````````````````````````````````````````````````````````````````````
```````````````````````````````````````````````````````````````````````````````````
```````````````````````````````````````````````````````````````````````````````````
```````````````````````````````````````````````````````````````````````````````````
```````````````````````````````````````````````````````````````````````````````````
```````````````````````````````````````````````````````````````````````````````````
```````````````````````````````````````````````````````````````````````````````````
```````````````````````````````````````````````````````````````````````````````````
```````````````````````````````````````````````````````````````````````````````````
```````````````````````````````````````````````````````````````````````````````````
```````````````````````````````````````````````````````````````````````````````````
```````````````````````````````````````````````````````````````````````````````````
```````````````````````````````````````````````````````````````````````````````````
```````````````````````````````````````````````````````````````````````````````````
```````````````````````````````````````````````````````````````````````````````````
```````````````````````````````````````````````````````````````````````````````````
```````````````````````````````````````````````````````````````````````````````````
```````````````````````````````````````````````````````````````````````````````````
```````````````````````````````````````````````````````````````````````````````````
```````````````````````````````````````````````````````````````````````````````````
```````````````````````````````````````````````````````````````````````````````````
```````````````````````````````````````````````````````````````````````````````````
```````````````````````````````````````````````````````````````````````````````````
```````````````````````````````````````````````````````````````````````````````````
```````````````````````````````````````````````````````````````````````````````````
```````````````````````````````````````````````````````````````````````````````````
```````````````````````````````````````````````````````````````````````````````````
```````````````````````````````````````````````````````````````````````````````````
```````````````````````````````````````````````````````````````````````````````````
```````````````````````````````````````````````````````````````````````````````````
```````````````````````````````````````````````````````````````````````````````````
```````````````````````````````````````````````````````````````````````````````````
```````````````````````````````````````````````````````````````````````````````````
```````````````````````````````````````````````````````````````````````````````````
```````````````````````````````````````````````````````````````````````````````````
```````````````````````````````````````````````````````````````````````````````````
```````````````````````````````````````````````````````````````````````````````````
```````````````````````````````````````````````````````````````````````````````````
```````````````````````````````````````````````````````````````````````````````````
```````````````````````````````````````````````````````````````````````````````````
```````````````````````````````````````````````````````````````````````````````````
```````````````````````````````````````````````````````````````````````````````````
```````````````````````````````````````````````````````````````````````````````````
```````````````````````````````````````````````````````````````````````````````````
```````````````````````````````````````````````````````````````````````````````````
```````````````````````````````````````````````````````````````````````````````````
```````````````````````````````````````````````````````````````````````````````````
```````````````````````````````````````````````````````````````````````````````````
```````````````````````````````````````````````````````````````````````````````````
`````````````````
```````````````````````````````````````````````````````````````````````````````````
```````````````````````````````````````````````````````````````````````````````````
```````````````````````````````````````````````````````````````````````````````````
````````````````````````````````````````

You might also like