Python Virtual Training For Arcesium - Module III

Oct 11-15, 2021 Vikrant Patil

These notes are available online at https://notes.pipal.in/2021/arcesium_finop_batch2/

© Pipal Academy LLP

Day 1 | Day 2 | Day 3 | Day 4 | Day 5

We will be using jupyter hub from https://lab2.pipal.in for this training.

create a notebook with name module3-day3

Downloading data from internet

Http protocols 4 methods

Webapi will usually have documentation about whetehr the url is got get/post/put/delete

Post request

Authentication

There are different kinds of authentications, kerberos is one of those

pip install requests requests-kerberos

kerberos_auth=HTTPKerberosAuth(mutual_authentication=OPTIONAL)
response=requests.get(request_url, auth=kerberos_auth, params=params).json()

General Scraping

<tag1>
  <tag2>
      <item>
      <leaf>
      text
      </leaf>
      </item>
  </tag2>
</tag1>

Downloading file

Example

Some useful packages

which you can try in your private virtual env

https://nsetools.readthedocs.io/en/latest/

pip install nsetools

Reading pdf files

we will make use of PyPDF2 library to read pdf files

!python3 -m pip install PyPDF2

we will make use of this pdf to write our sample code https://notes.pipal.in/2021/arcesium_finop_batch2/upload.pdf