Observable Data importing for Web Server / Google Colab Tutorials

By | January 24, 2020


Firstly let’s create a table of data in Google spreadsheet. We only want to show some or selected data so we will create a new data table which we can share with public Let’s name this data table as private. Therefore here we use Query and select formula formula which will select all the data from private data table select will select particular column from private data table in a new sheet. Let’s name this new data table as shared info. In Google sheet, click on ‘publish to web’ from file menu. Click on entire document then Select the shared info and click on publish. Copy the link and check whether all the data are there or not Now click on web page and select on tab separated values (.tsv). Copy the link and we will use this link in our programming. To start with a program let’s name it Data Importing . Since we are dealing with importing data from Google sheet. On a new cell I am going to define an in-built method i,e [email protected] It is mainly use for data binding from array. Earlier we got a .tsv file link from Google spreadsheet. So I am going to define it here as URL =And I Paste the link here. Here I am setting family=and writing whole code inside it it because the data table inside it will be list of a family. Constant family=[ ] will collect all the information and put It inside an array. I am keeping constant Google sheet here it uses promise named await which fetches a data or file from another server. .then will chain a code or makes continue next code. Here the code after dot then method it is pushing or mapping all the information or data from another web server inside an array named Family. Return will return the final value. As you can see an array name is family. And data inside it is data from a web server. Here I am planning to pick a random value from array named Family. I am keeping constant number because it will be a random number. Math.Random returns a pseudo random number in range of 0-1 to increase its scale I am multiplying it with array’s length. Math.floor will round of the final random number into its lower value. I am keeping constant ‘output’ because I want this to be displayed when I clicked on play button. So in final output it will be a sentence sentence like sonam is my younger brother , sonam was born on 08/09/1992 it will change whenever we click on play button. This code will fetch date and will make date format of day month and year. I am keeping constant sorted this code will sort by their date. Array .from (family) means the code is referring it’s value from array named Family. .sort(), it assumes that you are sorting strings here this code will arrange from highest date to lowest date. And for the final result to be in sentence where it will have a heading with bold letters I am planning ever sentences to be in displayed in in new line. This statement is for my sentence where I have a heading ever sentence will be in a new line. The sentence will be like ‘name’ is ‘relation’ and was born on ‘date of birth’, Now let’s see the result. Here as you can see that is arrange in oldest to youngest. Here in this statement I have used h3 header since it will be in bold letters and I have used italic style for older to youngest text. Here in the result you can see that rest sentences are in normal style and date is displayed in italic style. And as this code is to arrange from oldest to youngest, you can see here that date are arrange from highest to lowest order.

3 thoughts on “Observable Data importing for Web Server / Google Colab Tutorials

  1. Tshering Pelzom Post author

    Thanks. Was having difficulty importing data from web 😂 👍

    Reply

Leave a Reply

Your email address will not be published. Required fields are marked *