<commit_before>---
title: Installing ❒ data
date: 2017-09-19
---

This guide will cover how to install the **data** tool and verify that it is working properly. **data** is distributed as a command line tool.

There are two options for installation:

1. Installing pre-built binaries. These have no dependencies and will work "out of the box"
2. Install via npm: if you have node (>= v7.6) and npm installed you can install via npm

## Installing binaries

1. Go to the [releases page](/download)
2. Download the pre-built binary for your platform (MacOS and LinuxOS x64 at present)
3. Make it executable

    ```bash
    $ chmod +x data-{os-distribution}
    ```
4. Move the binary into your `$PATH` e.g. on Mac you could move to `/usr/local/bin/`

    ```bash
    $ mv data-{os-distribution} /usr/local/bin/data
    ```

**Note:** *For linux users, if you encounter errors related to location of `xdg-open` package. Use the following command to copy it from `/usr/bin/xdg-open` to `/usr/local/bin/xdg-open`.*

```
$ cp /usr/bin/xdg-open /usr/local/bin/xdg-open
```

## Installing via npm

You can also install it from `npm` as follows:

```bash
$ npm install -g datahub-cli
```

## Verifying

To test that it is installed correctly run:

```bash
$ data --version
```

This should output a version number, for example on my machine it shows:

```
0.6.3
```

## A first step

Finally, and as a last test, you can try out your first `❒ data` command: `info`.

**Note:** *This command makes **no** changes to anything on your machine or on the DataHub so it is completely safe to try out!*

The `info` command provides info on a data file or dataset whether it is on the DataHub or your local disk. Here's an example for you to try:
<commit_msg>[docs][xs]: updated docs for installation of data tool<commit_after>---
title: Installing ❒ data
date: 2017-09-19
---

This guide will cover how to install the **data** tool and verify that it is working properly. **data** is distributed as a command line tool.

There are two options for installation:

1. Installing pre-built binaries. These have no dependencies and will work "out of the box"
2. Install via npm: if you have node (>= v7.6) and npm installed you can install via npm

## Installing binaries

1. Go to the [releases page](/download)
2. Download the pre-built binary for your platform (MacOS, LinuxOS x64 or Windows)
3. Uncompress downloaded asset

    ```bash
    $ gunzip -f data-{os-distribution}.gz
    ```
4. Make it executable

    ```bash
    $ chmod +x data-{os-distribution}
    ```
5. Move the binary into your `$PATH` e.g. on Mac you could move to `/usr/local/bin/`

    ```bash
    $ mv data-{os-distribution} /usr/local/bin/data
    ```

**Note:** *For linux users, if you encounter errors related to location of `xdg-open` package. Use the following command to copy it from `/usr/bin/xdg-open` to `/usr/local/bin/xdg-open`.*

```
$ cp /usr/bin/xdg-open /usr/local/bin/xdg-open
```

## Installing via npm

You can also install it from `npm` as follows:

```bash
$ npm install -g data-cli
```

## Verifying

To test that it is installed correctly run:

```bash
$ data --version
```

This should output a version number, for example on my machine it shows:

```
0.6.3
```

## A first step

Finally, and as a last test, you can try out your first `❒ data` command: `info`.

**Note:** *This command makes **no** changes to anything on your machine or on the DataHub so it is completely safe to try out!*

The `info` command provides info on a data file or dataset whether it is on the DataHub or your local disk. Here's an example for you to try:

{'fraction_non_alphanumeric': 0.11341632088520055, 'fraction_numerical': 0.01189488243430152, 'mean_word_length': 3.458692971639951, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 5, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 5, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '3855342', 'n_tokens_mistral': 1173, 'n_tokens_neox': 1095, 'n_words': 534}