<commit_before># nodegdc

This nodejs module to access GoodData REST API.

Based on logic in https://github.com/byrot/phpgdc


## Installation

The following recommended installation requires [npm](https://npmjs.org/). If you are unfamiliar with npm, see the [npm docs](https://npmjs.org/doc/). Npm comes installed with Node.js since node version 0.8.x therefore you likely already have it.

Add the following to your `package.json` file:

```json
{
  ...
  "dependencies": {
    ...
    "gdc": "0.0.1"
  }
}
```

Install nodcgec and its dependencies:

```bash
npm install
```

## Sample Code
```javascript
var gdc = require('../nodegdc')('<EMAIL>', 'gooddatapassword', 'project-code', true)

var testData = []
testData.push({'d_domains_name.nm_name': 'Company A', 'f_domains.dt_createddate_id': '2014-01-20', 'f_domains.nm_domain_url': 'company-a.com'});
testData.push({'d_domains_name.nm_name': 'Company B', 'f_domains.dt_createddate_id': '2014-01-21', 'f_domains.nm_domain_url': 'company-b.com'});
testData.push({'d_domains_name.nm_name': 'Company C', 'f_domains.dt_createddate_id': '2014-01-22', 'f_domains.nm_domain_url': 'company-c.com'});
testData.push({'d_domains_name.nm_name': 'Company D', 'f_domains.dt_createddate_id': '2014-01-23', 'f_domains.nm_domain_url': 'company-d.com'});

var constraints = { 'f_domains.dt_createddate_id': {'date': 'yyyy-MM-dd'}};

var dataSet;
gdc.login().then(function() {
  dataSet = gdc.getDataSet('dataset.domains');
  return dataSet.downloadConfig();
}).then(function() {
  dataSet.adjustManifest({constraints: constraints, mode: 'FULL'});
  return dataSet.prepareUpload(testData);<commit_msg>Removing NPM installation instructions until submitted to npmjs<commit_after># nodegdc

This nodejs module to access GoodData REST API.

Based on logic in https://github.com/byrot/phpgdc


## Sample Code
```javascript
var gdc = require('../nodegdc')('<EMAIL>', 'gooddatapassword', 'project-code', true)

var testData = []
testData.push({'d_domains_name.nm_name': 'Company A', 'f_domains.dt_createddate_id': '2014-01-20', 'f_domains.nm_domain_url': 'company-a.com'});
testData.push({'d_domains_name.nm_name': 'Company B', 'f_domains.dt_createddate_id': '2014-01-21', 'f_domains.nm_domain_url': 'company-b.com'});
testData.push({'d_domains_name.nm_name': 'Company C', 'f_domains.dt_createddate_id': '2014-01-22', 'f_domains.nm_domain_url': 'company-c.com'});
testData.push({'d_domains_name.nm_name': 'Company D', 'f_domains.dt_createddate_id': '2014-01-23', 'f_domains.nm_domain_url': 'company-d.com'});

var constraints = { 'f_domains.dt_createddate_id': {'date': 'yyyy-MM-dd'}};

var dataSet;
gdc.login().then(function() {
  dataSet = gdc.getDataSet('dataset.domains');
  return dataSet.downloadConfig();
}).then(function() {
  dataSet.adjustManifest({constraints: constraints, mode: 'FULL'});
  return dataSet.prepareUpload(testData);
{'fraction_non_alphanumeric': 0.17659352142110762, 'fraction_numerical': 0.024033437826541274, 'mean_word_length': 6.004878048780488, 'pattern_counts': {'":': 2, '<': 5, '<?xml version=': 0, '>': 5, 'https://': 4, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 2, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '2508347', 'n_tokens_mistral': 1110, 'n_tokens_neox': 1021, 'n_words': 203}