<commit_before>A Python SDK for [the Joyent Manta
Service](http://www.joyent.com/products/manta) (a.k.a. Manta). This provides
a Python 'manta' package (for using the [Manta REST
API](http://apidocs.joyent.com/manta/api.html) and a 'mantash' (MANTA SHell)
CLI and shell. For an introduction to Manta in general, see [Manta getting
started docs](http://apidocs.joyent.com/manta/index.html).


# Current Status

Tested mostly on Mac and SmartOS using Python 2.6 or 2.7. Linux should work.
The *intention* is to support Windows as well. Python 3 is not currently
supported (currently because the dependency paramiko does not work with
Python 3).

Feedback and issues here please: <https://github.com/joyent/python-manta/issues>


# Installation

tl;dr: `pip install --upgrade manta`


## 0. install `pip` (and maybe PyCrypto)

**SmartOS**:

    pkgin install py27-pip py27-crypto

**Mac**:

    # See <http://www.pip-installer.org/en/latest/installing.html>
    curl -O https://bootstrap.pypa.io/get-pip.py
    sudo python get-pip.py

**Ubuntu**:

    sudo apt-get install python-pip

Others? Please [let me
know](https://github.com/joyent/python-manta/issues/new?title=pip+and+pycrypto+install+notes+for+XXX)
if there are better instructions that I can provide for your system, so I can
add them here.


## 1. install python-manta

The preferred way is:

    pip install manta

If you don't have pip (see above), but have `easy_install` then:

    easy_install manta

You should also be able to install from source:

    git clone https://github.com/joyent/python-manta.git
    cd python-manta
    python setup.py install    # might require a 'sudo' prefix


## 2. verify install worked

The 'mantash' CLI should now work:

    $ mantash help
    ...

And `import manta` should now work:

    $ python -c "import manta; print(manta.__version__)"
    2.0.0



# Setup

First setup your environment to match your Joyent Manta account. Adjust
accordingly for your SSH key and Manta login. The SSH key here must match
one of keys uploaded for your Joyent Public Cloud account.

    export MANTA_KEY_ID=`ssh-keygen -l -f ~/.ssh/id_rsa.pub | awk '{print $2}' | tr -d '\n'`
    export MANTA_URL=https://us-east.manta.joyent.com
    export MANTA_USER=jill
    export MANTA_SUBUSER=bob # optional, if using RBAC subuser
    export MANTA_ROLE=ops # optional, if specifying a non-default role for the subuser

`mantash` uses these environment variables (as does the [Manta Node.js SDK
CLI](https://apidocs.joyent.com/manta/index.html#setting-up-your-environment)).
Alternatively you can specify these parameters to `mantash` via command-line
options -- see `mantash --help` for details.

For a colourful `mantash` prompt you can also set:

    export MANTASH_PS1='\e[90m[\u@\h \e[34m\w\e[90m]$\e[0m '

or more simply:

    export MANTASH_PS1='[\u@\h \w]$ '

See `_update_prompt` in bin/mantash for the list of supported PS1 escape
codes.


Now test that things are working:

    $ mantash ls /$MANTA_USER<commit_msg>MANTA-2969 transition python-manta to community-maintained<commit_after>python-manta is a community-maintained Python SDK for [the Joyent Manta
Object Storage Service](http://www.joyent.com/manta) (a.k.a. Manta). This
provides a Python 'manta' package (for using the [Manta REST
API](http://apidocs.joyent.com/manta/api.html) and a 'mantash' (MANTA SHell) CLI
and shell. For an introduction to Manta in general, see [Manta getting started
docs](http://apidocs.joyent.com/manta/index.html).


# Current Status

Tested mostly on Mac and SmartOS using Python 2.6 or 2.7. Linux should work.
The *intention* is to support Windows as well. Python 3 is not currently
supported (currently because the dependency paramiko does not work with
Python 3).

Feedback and issues here please: <https://github.com/joyent/python-manta/issues>


# Installation

tl;dr: `pip install --upgrade manta`


## 0. install `pip` (and maybe PyCrypto)

**SmartOS**:

    pkgin install py27-pip py27-crypto

**Mac**:

    # See <http://www.pip-installer.org/en/latest/installing.html>
    curl -O https://bootstrap.pypa.io/get-pip.py
    sudo python get-pip.py

**Ubuntu**:

    sudo apt-get install python-pip

Others? Please [let me
know](https://github.com/joyent/python-manta/issues/new?title=pip+and+pycrypto+install+notes+for+XXX)
if there are better instructions that I can provide for your system, so I can
add them here.


## 1. install python-manta

The preferred way is:

    pip install manta

If you don't have pip (see above), but have `easy_install` then:

    easy_install manta

You should also be able to install from source:

    git clone https://github.com/joyent/python-manta.git
    cd python-manta
    python setup.py install    # might require a 'sudo' prefix


## 2. verify install worked

The 'mantash' CLI should now work:

    $ mantash help
    ...

And `import manta` should now work:

    $ python -c "import manta; print(manta.__version__)"
    2.0.0



# Setup

First setup your environment to match your Joyent Manta account. Adjust
accordingly for your SSH key and Manta login. The SSH key here must match
one of keys uploaded for your Joyent Public Cloud account.

    export MANTA_KEY_ID=`ssh-keygen -l -f ~/.ssh/id_rsa.pub | awk '{print $2}'`
    export MANTA_URL=https://us-east.manta.joyent.com
    export MANTA_USER=jill
    export MANTA_SUBUSER=bob # optional, if using RBAC subuser
    export MANTA_ROLE=ops # optional, if specifying a non-default role for the subuser

`mantash` uses these environment variables (as does the [Manta Node.js SDK
CLI](https://apidocs.joyent.com/manta/index.html#setting-up-your-environment)).
Alternatively you can specify these parameters to `mantash` via command-line
options -- see `mantash --help` for details.

For a colourful `mantash` prompt you can also set:

    export MANTASH_PS1='\e[90m[\u@\h \e[34m\w\e[90m]$\e[0m '

or more simply:

    export MANTASH_PS1='[\u@\h \w]$ '

See `_update_prompt` in bin/mantash for the list of supported PS1 escape
codes.


Now test that things are working:

    $ mantash ls /$MANTA_USER
{'fraction_non_alphanumeric': 0.1050814010853478, 'fraction_numerical': 0.009537904949843776, 'mean_word_length': 3.692901234567901, 'pattern_counts': {'":': 0, '<': 7, '<?xml version=': 0, '>': 7, 'https://': 12, 'lorem ipsum': 0, 'www.': 4, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '5463140', 'n_tokens_mistral': 2142, 'n_tokens_neox': 1965, 'n_words': 701}