Nicolas Lambert

Hi. I'm Nicolas Lambert, research engineer in geographic information science at CNRS (France). My job is to draw maps and teach cartography at the university. I am a geographer 🌎, and not really a developer 🖥️.

Fetch an Excel sheet

The sheetjs library allows you to easily import data in xls or xlsx format. This can be useful if you don't want to modify by hand a data table provided by a supplier (here, the UN). But be careful, these are not open formats. In practice, I advise as much as possible to build your applications based on data in csv or json format.

In this notebook, I made a small wrapper around the library allowing to import an excel file online, with the possibility to skip the first n rows and the first m columns. For this, I also had to use a proxy. Explanations here.

url = "https://www.un.org/development/desa/pd/sites/www.un.org.development.desa.pd/files/undesa_pd_2020_ims_stock_by_sex_and_destination.xlsx"

data = Error: 403

Data Handling & display

RuntimeError: 403

Helpers

proxy = "https://corsproxy.io/?"

getExcel = async ƒ(url, sheetname, skipCol, skipRow)

Dependencies

xlsx = Object {version: "0.17.0", parse_xlscfb: ƒ(e, r), parse_zip: ƒ(e, r), read: ƒ(e, r), readFile: ƒ(e, r), readFileSync: ƒ(e, r), write: ƒ(e, r), writeFile: ƒ(e, r, t), writeFileSync: ƒ(e, r, t), writeFileAsync: ƒ(e, r, t, a), utils: Object, SSF: Object, CFB: Object}
xlsx=require("xlsx@0.17.0/dist/xlsx.core.min.js")