@@ -65,9 +65,10 @@ export const read_json = async (source) => {
6565
6666/**
6767 * Reads an Excel file from local or remote address
68- * * @param {kwargs } kwargs --> {
69- * source : string, URL or local file path to retreive Excel file
70- * configs: object, (Optional) {
68+ * @param {string } source URL or local file path to retreive Excel file.
69+ * @param {object } configs (Optional) Configuration options when reading excel files
70+ *
71+ * {
7172 * sheet : string, (Optional) number of the sheet to parse. Default will be the first sheet.
7273 * }
7374 * @returns {Promise } DataFrame structure of parsed Excel data
@@ -79,33 +80,38 @@ export const read_excel = async (source, configs) => {
7980
8081/**
8182 * Opens a file using frictionless.js specification.
82- * @param {string } pathOrDescriptor A path to the file/resources. It can be a local file,
83+ * @param {string } source A path to the file/resources. It can be a local file,
8384 * a URL to a tabular data (CSV, EXCEL) or Datahub.io Data Resource.
8485 * Data comes with extra properties and specification conforming to the Frictionless Data standards.
85- * @param {object } configs { data_num (Defaults => 0): The specific dataset to load, when reading data from a datapackage.json,
86- * header (Defaults => true): Whether the dataset contains header or not.
87- * }
86+ * @param {object } configs {
87+ *
88+ * data_num (Defaults => 0): The specific dataset to load, when reading data from a datapackage.json
89+ *
90+ * header (Defaults => true): Whether the dataset contains header or not.
91+ *
92+ * sheet (Defaults => 0): Number of the excel sheet which u want to load.
93+ * }
8894 * @returns {DataFrame } Danfo DataFrame/Series
8995 */
9096export const read = async (
91- path_or_descriptor ,
97+ source ,
9298 configs = { }
9399) => {
94100 let { data_num, header, sheet } = configs ;
95101 data_num = data_num === undefined ? 0 : data_num ;
96102 header = header === undefined ? true : header ;
97103 let rows , file ;
98104
99- if ( isDataset ( path_or_descriptor ) ) {
105+ if ( isDataset ( source ) ) {
100106 console . log (
101107 "datapackage.json found. Loading Dataset package from Datahub.io"
102108 ) ;
103- const dataset = await Dataset . load ( path_or_descriptor ) ;
109+ const dataset = await Dataset . load ( source ) ;
104110 file = dataset . resources [ data_num ] ;
105111 rows = await toArray ( await file . rows ( ) ) ;
106112 } else {
107113 try {
108- file = open ( path_or_descriptor ) ;
114+ file = open ( source ) ;
109115 if ( sheet ) {
110116 rows = await toArray ( await file . rows ( { sheet } ) ) ;
111117 } else {
0 commit comments