Base

This is the base notebook for the istatapi package. It contains the code to make the API calls.

source

get_custom_ssl_session

 get_custom_ssl_session ()

Get a session with a custom ssl context


source

CustomHttpAdapter

 CustomHttpAdapter (ssl_context=None, **kwargs)

Transport adapter” that allows us to use custom ssl_context.


source

ISTAT

 ISTAT ()

Base class that provides useful functions to communicate with ISTAT API


source

ISTAT._request

 ISTAT._request (path, **kwargs)

Make a request to ISTAT API given a ‘path’

The ‘ISTAT’ class already implements the ‘base_url’, therefore ‘path’ only needs to include the other parameters of the request. Here is an example of a succesful request:

istat = ISTAT()
path = "dataflow/IT1"
test_response = istat._request(path=path)
test_response
<Response [200]>