=================
A command-line tool and API for various Elasticsearch operations.
.. image:: https://travis-ci.org/getconversio/elastic-companion.svg?branch=master
:target: https://travis-ci.org/getconversio/elastic-companion
Install
-------
pip install elastic-companion
**Note**: The 1.X versions of elastic-companion support Elasticsearch 1.X and
the 5.X versions support Elasticsearch 5.X. This is similar to the versioning
of the official library
Commands
--------
To see the list of commands, use the ``-h`` or ``--help`` flag.
Each command has a corresponding Python module that can be imported and used as
an API rather than from the command-line.
### `setup`
The `setup` command will load all indexes, mappings, templates and scripts from the data directory, and send them to ES.
#### `/scripts`
The scripts folder should have `.json` files which act as script descriptors. Each file should have the content:
```json
{
"id": "SCRIPT_ID",
"lang": "SCRIPT_LANG",
"body": "SCRIPT_BODY",
"path": "SCRIPT_BODY_FILE_PATH"
}
```
While `id` and `lang` are required and should match the requirements of ES. These will determine how each script is stored. The values `body` and `path`, however, are mutually exclusive and only one is required. You can specify the script's body directly inline under `body`, or point to a file using `path`.
Developing
----------
If you are using Docker and Docker Compose, then you don't need to fiddle with
python and pip manually. Otherwise, see below.
Download Python 3, then::
$ pyvenv-3.X venv
$ source venv/bin/activate
$ pip3 install -r requirements.txt
$ ./cli.py -h
On Ubuntu, there's a bit of an issue with ``pip3`` and the above might not work.
Then::
$ pyvenv-3.X venv --without-pip
$ source venv/bin/activate
$ cd venv
$ wget https://bootstrap.pypa.io/get-pip.py
$ python3 get-pip.py
$ cd ..
$ pip3 install -r requirements.txt
$ ./cli.py -h
Testing
-------
Use ``nose``::
$ nosetests
or::
$ docker-compose run --rm companion nosetests
Deploying
---------
You need access to the pypi repository first, then it's just a matter of::
$ python setup.py sdist bdist_wheel
$ twine upload dist/*
Metadata
Release files for elastic-companion 5.1.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| elastic-companion-5.1.0.tar.gz | 12.8 kB | Without provenance | Details for elastic-companion-5.1.0.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| elastic_companion-5.1.0-py3-none-any.whl | Python 3 | none | any | Details for elastic_companion-5.1.0-py3-none-any.whl |
Total release size: 29.5 kB
Release files / elastic-companion-5.1.0.tar.gz
| Download URL | elastic-companion-5.1.0.tar.gz |
|---|---|
| Size | 12.8 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
38d7bc4ff8138030f88d4131e11ee5fb52485c4b667184f9a9fbd9aa266948e2
|
|
BLAKE2b-256 checksum How to use checksums |
be67361ab3d7dea98922e240b8cba487499f2730311b18de48325a59f40b2538
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
Release files / elastic_companion-5.1.0-py3-none-any.whl
| Download URL | elastic_companion-5.1.0-py3-none-any.whl |
|---|---|
| Size | 16.7 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
87347bd0010e1f6297d36b7b32104d0ea4013b88de12ddae355fabca47a0a83c
|
|
BLAKE2b-256 checksum How to use checksums |
61d954fc6c2e25e16d639be40b0d39922f4f32bc0b662fbdbd36948b098e1084
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
Security for elastic-companion 5.1.0
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.