mindsdb-js-sdk
Advanced tools
Comparing version 0.2.0 to 0.3.0
{ | ||
"name": "mindsdb-js-sdk", | ||
"version": "0.2.0", | ||
"version": "0.3.0", | ||
"license": "MIT", | ||
@@ -8,3 +8,3 @@ "homepage": "https://github.com/mindsdb/mindsdb_sdks#readme", | ||
"type": "git", | ||
"url": "git+https://github.com/mindsdb/mindsdb_sdks.git" | ||
"url": "https://github.com/mindsdb/mindsdb_sdks.git" | ||
}, | ||
@@ -15,3 +15,6 @@ "bugs": { | ||
"keywords": [ | ||
"MindsDB" | ||
"MindsDB", | ||
"mindsdb_js_sdk", | ||
"neural-network", | ||
"machine-learning" | ||
], | ||
@@ -49,7 +52,3 @@ "author": "MindsDB", | ||
"axios": "^0.18.1" | ||
}, | ||
"description": "## install and build", | ||
"directories": { | ||
"lib": "lib" | ||
} | ||
} |
120
README.md
@@ -1,13 +0,37 @@ | ||
# JS MindsDB SDK | ||
# <a href='https://www.mindsdb.com/'><img src='https://assets.website-files.com/5c7e77a16fbaf30ffda0de72/5cc69a9fd9da3369c3848e5b_logo.png' height='40' alt='MindsDB' aria-label='mindsdb.com/' /></a> | ||
## install and build | ||
[![npm version](https://img.shields.io/badge/npm-v6.13.7-orange)](https://www.npmjs.com/package/mindsdb-js-sdk) | ||
[![build status](https://img.shields.io/badge/build-passing-green)](https://www.npmjs.com/package/mindsdb-js-sdk) | ||
[![axios](https://img.shields.io/badge/axios-v0.18.1-orange)](https://www.npmjs.com/package/mindsdb-js-sdk) | ||
[![install size](https://img.shields.io/badge/install%20size-202%20KB-green)](https://www.npmjs.com/package/mindsdb-js-sdk) | ||
## JS MindsDB SDK | ||
MindsDB generates metadata about your specific machine learning task, that you can visualize through our graphical user interface [MindsDB GUI](https://www.mindsdb.com/). | ||
## Installing | ||
Using npm: | ||
```bash | ||
$ npm install mindsdb-js-sdk | ||
``` | ||
Using yarn: | ||
```bash | ||
$ yarn add mindsdb-js-sdk | ||
``` | ||
## Install and build | ||
Commands should executed from `javascript/` folder. | ||
1. install dependencies: | ||
``` | ||
yarn | ||
``` | ||
or | ||
``` | ||
``` | ||
npm install | ||
@@ -17,6 +41,7 @@ ``` | ||
2. build: | ||
``` | ||
yarn build | ||
``` | ||
or | ||
``` | ||
@@ -26,3 +51,3 @@ npm run build | ||
## folder structure | ||
## Folder Structure | ||
@@ -42,5 +67,6 @@ ``` | ||
## usage | ||
## Usage | ||
example of usage: | ||
``` | ||
@@ -76,10 +102,13 @@ import MindsDB from 'mindsdb-js-sdk'; | ||
### `MindsDB.connect(url)` | ||
Initialize connection to MindsDV server | ||
**params** | ||
* url *string* - server url | ||
- url _string_ - server url | ||
**returns** undefined | ||
### `MindsDB.disconnect()` | ||
Clear connection data | ||
@@ -90,2 +119,3 @@ | ||
### `async MindsDB.ping()` | ||
Check connection | ||
@@ -96,2 +126,3 @@ | ||
### `async MindsDB.predictors()` | ||
return list of existing predictors | ||
@@ -101,2 +132,3 @@ **returns** [{PredictorObject}, ...] | ||
### `async MindsDB.dataSources()` | ||
return list of existing datasources | ||
@@ -106,15 +138,19 @@ **returns** [{DatasourceObject}, ...] | ||
### `MindsDB.DataSource(opts = { name })` | ||
return datasource object | ||
**params** | ||
* opts *object* | ||
* name *string* datasource name | ||
- opts _object_ | ||
- name _string_ datasource name | ||
**returns** {DataSourceObject} | ||
### `MindsDB.Predictor(opts = { name })` | ||
return predictor object | ||
**params** | ||
* opts *object* | ||
* name *string* predictor name | ||
- opts _object_ | ||
- name _string_ predictor name | ||
**returns** {PredictorObject} | ||
@@ -125,2 +161,3 @@ | ||
### `async DataSourceObject.load()` | ||
load data for this dataSource | ||
@@ -131,17 +168,22 @@ | ||
### `async DataSourceObject.upload(file, onProgress)` | ||
upload datasource-file to server | ||
**params** | ||
* file *object* | ||
* onProgress *function* | ||
- file _object_ | ||
- onProgress _function_ | ||
**returns** undefined | ||
### `async DataSourceObject.uploadFromUrl(url)` | ||
upload datasource to server, by url | ||
**params** | ||
* url *string* | ||
- url _string_ | ||
**returns** undefined | ||
### `async DataSourceObject.download()` | ||
initiate datasource downloading | ||
@@ -152,5 +194,7 @@ | ||
### `async DataSourceObject.getDownloadUrl()` | ||
**returns** string download datasource url | ||
### `async DataSourceObject.delete()` | ||
delete datasource | ||
@@ -160,2 +204,3 @@ **returns** undefined | ||
### `async DataSourceObject.loadData()` | ||
get datasource rows | ||
@@ -166,2 +211,3 @@ | ||
### `async DataSourceObject.loadMissedFileList()` | ||
get list of missed files for datasource | ||
@@ -172,9 +218,11 @@ | ||
### `async DataSourceObject.uploadFile(opts = { column, rowIndex, extension, file })` | ||
**params** | ||
* opts *object* | ||
* column *string* | ||
* rowIndex *string* | ||
* extension *string* | ||
* file *object* | ||
- opts _object_ | ||
- column _string_ | ||
- rowIndex _string_ | ||
- extension _string_ | ||
- file _object_ | ||
**returns** bool - successful | ||
@@ -185,2 +233,3 @@ | ||
### `async PredictorObject.load()` | ||
load data for this predictor | ||
@@ -191,2 +240,3 @@ | ||
### `async PredictorObject.loadColumns()` | ||
load information about columns used for make predictor. After loading columns will be available at this.columns | ||
@@ -199,19 +249,23 @@ | ||
**params** | ||
* opts *object* | ||
* dataSourceName *string* name of datasource | ||
* fromData *string* Optional url to a file that you want to learn from | ||
* toPredict *[string]* list of column names to predict | ||
- opts _object_ | ||
- dataSourceName _string_ name of datasource | ||
- fromData _string_ Optional url to a file that you want to learn from | ||
- toPredict _[string]_ list of column names to predict | ||
**returns** string empty string | ||
### `async PredictorObject.queryPredict(when)` | ||
query to predictor | ||
**params** | ||
* when *object* key-value for query fields, example: | ||
> when: {sqft: "1000", location: "good"} | ||
- when _object_ key-value for query fields, example: | ||
> when: {sqft: "1000", location: "good"} | ||
**returns** object key-value for query and predicted foelds | ||
### `async PredictorObject.delete()` | ||
delete predictor | ||
@@ -222,11 +276,14 @@ | ||
### `async PredictorObject.upload(file, onProgress)` | ||
upload predictor to server | ||
**params** | ||
* file *object* | ||
* onProgress *function* | ||
- file _object_ | ||
- onProgress _function_ | ||
**returns** undefined | ||
### `async PredictorObject.download()` | ||
initiate predictor downloading | ||
@@ -237,2 +294,7 @@ | ||
### `async PredictorObject.getDownloadUrl()` | ||
**returns** string download predictor url | ||
**returns** string download predictor url | ||
## License | ||
[MIT](LICENSE) |
203128
282