Feature/versioning (#109)

* Minor fixes for readthedocs compatibility.

* Adding doc templates

* Setting first version to 7.5

* Resolving pypi issues + minor docs
This commit is contained in:
stevedodson 2020-01-10 14:38:56 +00:00 committed by GitHub
parent f93b893f9d
commit 00fb775d29
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
15 changed files with 88 additions and 149 deletions

View File

@ -1,7 +1,41 @@
[![Build Status](https://clients-ci.elastic.co/buildStatus/icon?job=elastic%2Beland%2Bmaster)](https://clients-ci.elastic.co/job/elastic+eland+master/)
_Note, this project is still very much a work in progress and in an alpha state; input and contributions welcome!_
# eland: pandas-like Python client for analysis of Elasticsearch data
<table>
<tr>
<td>Latest Release</td>
<td>
<a href="https://pypi.org/project/eland/">
<img src="https://img.shields.io/pypi/v/eland.svg" alt="latest release" />
</a>
</td>
<tr>
<td>Package Status</td>
<td>
<a href="https://pypi.org/project/eland/">
<img src="https://img.shields.io/pypi/status/eland.svg" alt="status" />
</a>
</td>
</tr>
<tr>
<td>License</td>
<td>
<a href="https://github.com/elastic/eland/LICENSE.txt">
<img src="https://img.shields.io/pypi/l/eland.svg" alt="license" />
</a>
</td>
</tr>
<tr>
<td>Build Status</td>
<td>
<a href="https://clients-ci.elastic.co/job/elastic+eland+master/">
<img src="https://clients-ci.elastic.co/buildStatus/icon?job=elastic%2Beland%2Bmaster" alt="Build Status" />
</a>
</td>
</tr>
</table>
# What is it?
eland is a Elasticsearch client Python package to analyse, explore and manipulate data that resides in Elasticsearch.
@ -39,20 +73,16 @@ max 400140.000000 246.000000 5.000000
See [docs](https://eland.readthedocs.io/en/latest) and [demo_notebook.ipynb](https://eland.readthedocs.io/en/latest/examples/demo_notebook.html) for more examples.
## Connecting to Elasticsearch Cloud
## Where to get it
The source code is currently hosted on GitHub at:
https://github.com/elastic/eland
Binary installers for the latest released version are available at the [Python
package index](https://pypi.org/project/eland).
```sh
pip install eland
```
>>> import eland as ed
>>> from elasticsearch import Elasticsearch
>>> es = Elasticsearch(cloud_id="<cloud_id>", http_auth=('<user>','<password>'))
>>> es.info()
{'name': 'instance-0000000000', 'cluster_name': 'bf900cfce5684a81bca0be0cce5913bc', 'cluster_uuid': 'xLPvrV3jQNeadA7oM4l1jA', 'version': {'number': '7.4.2', 'build_flavor': 'default', 'build_type': 'tar', 'build_hash': '2f90bbf7b93631e52bafb59b3b049cb44ec25e96', 'build_date': '2019-10-28T20:40:44.881551Z', 'build_snapshot': False, 'lucene_version': '8.2.0', 'minimum_wire_compatibility_version': '6.8.0', 'minimum_index_compatibility_version': '6.0.0-beta1'}, 'tagline': 'You Know, for Search'}
>>> df = ed.read_es(es, 'reviews')
```
## Development Setup
@ -86,7 +116,7 @@ eland depends on pandas version 0.25.3.
#### Elasticsearch Versions
eland is versioned like the Elastic stack. E.g. eland 7.5 is compatible with Elasticsearch 7.x up to 7.5
eland is versioned like the Elastic stack (eland 7.5.1 is compatible with Elasticsearch 7.x up to 7.5.1)
A major version of the client is compatible with the same major version of Elasticsearch.
@ -94,6 +124,20 @@ No compatibility assurances are given between different major versions of the cl
Major differences likely exist between major versions of Elasticsearch,
particularly around request and response object formats, but also around API urls and behaviour.
## Connecting to Elasticsearch Cloud
```
>>> import eland as ed
>>> from elasticsearch import Elasticsearch
>>> es = Elasticsearch(cloud_id="<cloud_id>", http_auth=('<user>','<password>'))
>>> es.info()
{'name': 'instance-0000000000', 'cluster_name': 'bf900cfce5684a81bca0be0cce5913bc', 'cluster_uuid': 'xLPvrV3jQNeadA7oM4l1jA', 'version': {'number': '7.4.2', 'build_flavor': 'default', 'build_type': 'tar', 'build_hash': '2f90bbf7b93631e52bafb59b3b049cb44ec25e96', 'build_date': '2019-10-28T20:40:44.881551Z', 'build_snapshot': False, 'lucene_version': '8.2.0', 'minimum_wire_compatibility_version': '6.8.0', 'minimum_index_compatibility_version': '6.0.0-beta1'}, 'tagline': 'You Know, for Search'}
>>> df = ed.read_es(es, 'reviews')
```
## Why eland?
Naming is difficult, but as we had to call it something:

View File

@ -1,10 +0,0 @@
{% set redirect = redirects[pagename.split("/")[-1]] %}
<html>
<head>
<meta http-equiv="Refresh" content="0; url={{ redirect }}.html" />
<title>This API page has moved</title>
</head>
<body>
<p>This API page has moved <a href="{{ redirect }}.html">here</a>.</p>
</body>
</html>

View File

@ -1,6 +0,0 @@
{{ fullname }}
{{ underline }}
.. currentmodule:: {{ module.split('.')[0] }}
.. autoaccessor:: {{ (module.split('.')[1:] + [objname]) | join('.') }}

View File

@ -1,6 +0,0 @@
{{ fullname }}
{{ underline }}
.. currentmodule:: {{ module.split('.')[0] }}
.. autoaccessorattribute:: {{ (module.split('.')[1:] + [objname]) | join('.') }}

View File

@ -1,6 +0,0 @@
{{ fullname }}
{{ underline }}
.. currentmodule:: {{ module.split('.')[0] }}
.. autoaccessorcallable:: {{ (module.split('.')[1:] + [objname]) | join('.') }}.__call__

View File

@ -1,6 +0,0 @@
{{ fullname }}
{{ underline }}
.. currentmodule:: {{ module.split('.')[0] }}
.. autoaccessormethod:: {{ (module.split('.')[1:] + [objname]) | join('.') }}

View File

@ -1,33 +0,0 @@
{% extends "!autosummary/class.rst" %}
{% block methods %}
{% if methods %}
..
HACK -- the point here is that we don't want this to appear in the output, but the autosummary should still generate the pages.
.. autosummary::
:toctree:
{% for item in all_methods %}
{%- if not item.startswith('_') or item in ['__call__'] %}
{{ name }}.{{ item }}
{%- endif -%}
{%- endfor %}
{% endif %}
{% endblock %}
{% block attributes %}
{% if attributes %}
..
HACK -- the point here is that we don't want this to appear in the output, but the autosummary should still generate the pages.
.. autosummary::
:toctree:
{% for item in all_attributes %}
{%- if not item.startswith('_') %}
{{ name }}.{{ item }}
{%- endif -%}
{%- endfor %}
{% endif %}
{% endblock %}

View File

@ -1,6 +0,0 @@
{{ fullname }}
{{ underline }}
.. currentmodule:: {{ module }}
.. autoclass:: {{ objname }}

View File

@ -41,7 +41,11 @@ project = 'eland'
copyright = '2019, Elasticsearch B.V.'
# The full version, including alpha/beta/rc tags
release = '0.1'
import eland
version = str(eland._version.__version__)
release = version
# -- General configuration ---------------------------------------------------

View File

@ -753,7 +753,7 @@
{
"data": {
"text/plain": [
"<eland.index.Index at 0x11acc6e90>"
"<eland.index.Index at 0x1185c3f50>"
]
},
"execution_count": 17,
@ -2704,15 +2704,15 @@
" </tr>\n",
" <tr>\n",
" <th>25%</th>\n",
" <td>410.012798</td>\n",
" <td>410.008918</td>\n",
" <td>2470.545974</td>\n",
" <td>...</td>\n",
" <td>252.821296</td>\n",
" <td>251.942965</td>\n",
" <td>1.000000</td>\n",
" </tr>\n",
" <tr>\n",
" <th>50%</th>\n",
" <td>640.387285</td>\n",
" <td>640.362667</td>\n",
" <td>7612.072403</td>\n",
" <td>...</td>\n",
" <td>503.148975</td>\n",
@ -2720,11 +2720,11 @@
" </tr>\n",
" <tr>\n",
" <th>75%</th>\n",
" <td>841.775043</td>\n",
" <td>842.006180</td>\n",
" <td>9735.660463</td>\n",
" <td>...</td>\n",
" <td>720.534532</td>\n",
" <td>4.000000</td>\n",
" <td>720.569838</td>\n",
" <td>4.243151</td>\n",
" </tr>\n",
" <tr>\n",
" <th>max</th>\n",
@ -2745,9 +2745,9 @@
"mean 628.253689 7092.142457 ... 511.127842 2.835975\n",
"std 266.386661 4578.263193 ... 334.741135 1.939365\n",
"min 100.020531 0.000000 ... 0.000000 0.000000\n",
"25% 410.012798 2470.545974 ... 252.821296 1.000000\n",
"50% 640.387285 7612.072403 ... 503.148975 3.000000\n",
"75% 841.775043 9735.660463 ... 720.534532 4.000000\n",
"25% 410.008918 2470.545974 ... 251.942965 1.000000\n",
"50% 640.362667 7612.072403 ... 503.148975 3.000000\n",
"75% 842.006180 9735.660463 ... 720.569838 4.243151\n",
"max 1199.729004 19881.482422 ... 1902.901978 6.000000\n",
"\n",
"[8 rows x 7 columns]"

File diff suppressed because one or more lines are too long

View File

@ -14,6 +14,7 @@
from __future__ import absolute_import
from eland._version import *
from eland.common import *
from eland.client import *
from eland.filter import *

View File

@ -15,6 +15,6 @@
__title__ = 'eland'
__description__ = 'Python elasticsearch client to analyse, explore and manipulate data that resides in elasticsearch.'
__url__ = 'https://github.com/elastic/eland'
__version__ = '7.5'
__version__ = '7.5.1a1'
__maintainer__ = 'Elasticsearch B.V.'
__maintainer_email__ = 'steve.dodson@elastic.co'

View File

@ -1,36 +0,0 @@
"""
GroupBy
---------
Define the SeriesGroupBy, DataFrameGroupBy, and PanelGroupBy
classes that hold the groupby interfaces (and some implementations).
These are user facing as the result of the ``df.groupby(...)`` operations,
which here returns a DataFrameGroupBy object.
"""
# Copyright 2019 Elasticsearch BV
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
from eland import NDFrame
class DataFrameGroupBy(NDFrame):
def __init__(self,
df,
by):
super().__init__(
query_compiler=df._query_compiler.copy()
)
self._query_compiler.groupby_agg(by)

View File

@ -24,7 +24,7 @@ with open(path.join(here, 'README.md'), encoding='utf-8') as f:
here = path.abspath(path.dirname(__file__))
about = {}
with open(path.join(here, 'eland', '__version__.py'), 'r', 'utf-8') as f:
with open(path.join(here, 'eland', '_version.py'), 'r', 'utf-8') as f:
exec(f.read(), about)
setup(