|
| 1 | +# Installation Guide |
| 2 | + |
| 3 | +This guide explains how to install the Easysearch Python Client. |
| 4 | + |
| 5 | +## Table of Contents |
| 6 | + |
| 7 | +- [Install Directly from GitHub (Easiest)](#install-directly-from-github-easiest) |
| 8 | +- [Install from GitHub Releases](#install-from-github-releases) |
| 9 | +- [Install from Source](#install-from-source) |
| 10 | +- [Install from PyPI](#install-from-pypi) |
| 11 | +- [Verify Installation](#verify-installation) |
| 12 | + |
| 13 | +--- |
| 14 | + |
| 15 | +## Install Directly from GitHub (Easiest) |
| 16 | + |
| 17 | +You can install directly from GitHub using pip, no need to download files manually! |
| 18 | + |
| 19 | +### Install from Latest Code (main branch) |
| 20 | + |
| 21 | +```bash |
| 22 | +pip install git+https://github.com/infinilabs/easysearch-py.git |
| 23 | +``` |
| 24 | + |
| 25 | +### Install from Specific Version Tag |
| 26 | + |
| 27 | +```bash |
| 28 | +# Install version 0.1.0 |
| 29 | +pip install git+https://github.com/infinilabs/ [email protected] |
| 30 | + |
| 31 | +# Install version 0.2.0 |
| 32 | +pip install git+https://github.com/infinilabs/ [email protected] |
| 33 | +``` |
| 34 | + |
| 35 | +### Install from Specific Branch |
| 36 | + |
| 37 | +```bash |
| 38 | +# Install from develop branch |
| 39 | +pip install git+https://github.com/infinilabs/easysearch-py.git@develop |
| 40 | +``` |
| 41 | + |
| 42 | +### Install from Specific Commit |
| 43 | + |
| 44 | +```bash |
| 45 | +pip install git+https://github.com/infinilabs/easysearch-py.git@abc1234 |
| 46 | +``` |
| 47 | + |
| 48 | +### Using requirements.txt |
| 49 | + |
| 50 | +Add to your `requirements.txt`: |
| 51 | + |
| 52 | +```txt |
| 53 | +# Latest from main branch |
| 54 | +git+https://github.com/infinilabs/easysearch-py.git |
| 55 | +
|
| 56 | +# Or specific version |
| 57 | +git+https://github.com/infinilabs/[email protected] |
| 58 | +
|
| 59 | +# Or with egg name for reference |
| 60 | +git+https://github.com/infinilabs/[email protected]#egg=easysearch |
| 61 | +``` |
| 62 | + |
| 63 | +Then install: |
| 64 | +```bash |
| 65 | +pip install -r requirements.txt |
| 66 | +``` |
| 67 | + |
| 68 | +### Advantages |
| 69 | + |
| 70 | +✅ **No manual download needed** - pip handles everything |
| 71 | +✅ **Always up-to-date** - install latest or pin specific versions |
| 72 | +✅ **Works in CI/CD** - perfect for automated deployments |
| 73 | +✅ **No PyPI dependency** - works even if PyPI has issues |
| 74 | +✅ **Easy to upgrade** - just change the version tag |
| 75 | + |
| 76 | +--- |
| 77 | + |
| 78 | +## Install from GitHub Releases |
| 79 | + |
| 80 | +You can download pre-built packages from [GitHub Releases](https://github.com/infinilabs/easysearch-py/releases), or install directly from release URLs. |
| 81 | + |
| 82 | +### Option A: Install Directly from Release URL (No Download Needed) |
| 83 | + |
| 84 | +```bash |
| 85 | +# Install wheel from GitHub Release (recommended) |
| 86 | +pip install https://github.com/infinilabs/easysearch-py/releases/download/v0.1.0/easysearch-0.1.0-py2.py3-none-any.whl |
| 87 | + |
| 88 | +# Or install source package |
| 89 | +pip install https://github.com/infinilabs/easysearch-py/releases/download/v0.1.0/easysearch-0.1.0.tar.gz |
| 90 | +``` |
| 91 | + |
| 92 | +Replace `v0.1.0` and `0.1.0` with the version you want. |
| 93 | + |
| 94 | +### Option B: Download and Install Locally |
| 95 | + |
| 96 | +#### Step 1: Download the Package |
| 97 | + |
| 98 | +Visit the [releases page](https://github.com/infinilabs/easysearch-py/releases) and download either: |
| 99 | +- `easysearch-X.Y.Z-py2.py3-none-any.whl` (wheel package, recommended) |
| 100 | +- `easysearch-X.Y.Z.tar.gz` (source package) |
| 101 | + |
| 102 | +Replace `X.Y.Z` with the version number (e.g., `0.1.0`). |
| 103 | + |
| 104 | +#### Step 2: Install the Downloaded Package |
| 105 | + |
| 106 | +**Option 1: Install wheel package (faster)** |
| 107 | +```bash |
| 108 | +pip install easysearch-0.1.0-py2.py3-none-any.whl |
| 109 | +``` |
| 110 | + |
| 111 | +**Option 2: Install source package** |
| 112 | +```bash |
| 113 | +pip install easysearch-0.1.0.tar.gz |
| 114 | +``` |
| 115 | + |
| 116 | +#### Step 3: Verify Checksums (Optional but Recommended) |
| 117 | + |
| 118 | +Download the `SHA256SUMS` file from the same release page: |
| 119 | + |
| 120 | +```bash |
| 121 | +# Verify the checksum |
| 122 | +sha256sum -c SHA256SUMS |
| 123 | +``` |
| 124 | + |
| 125 | +--- |
| 126 | + |
| 127 | +## Install from Source |
| 128 | + |
| 129 | +Clone the repository and install: |
| 130 | + |
| 131 | +```bash |
| 132 | +# Clone the repository |
| 133 | +git clone https://github.com/infinilabs/easysearch-py.git |
| 134 | +cd easysearch-py |
| 135 | + |
| 136 | +# Install in development mode |
| 137 | +pip install -e . |
| 138 | + |
| 139 | +# Or build and install |
| 140 | +python -m build |
| 141 | +pip install dist/easysearch-*.whl |
| 142 | +``` |
| 143 | + |
| 144 | +--- |
| 145 | + |
| 146 | +## Install from PyPI |
| 147 | + |
| 148 | +> **Note:** PyPI package name may differ due to naming conflicts. Check the latest instructions in the README. |
| 149 | +
|
| 150 | +```bash |
| 151 | +# When available on PyPI |
| 152 | +pip install easysearch-py |
| 153 | +``` |
| 154 | + |
| 155 | +--- |
| 156 | + |
| 157 | +## Verify Installation |
| 158 | + |
| 159 | +After installation, verify that the package is installed correctly: |
| 160 | + |
| 161 | +```bash |
| 162 | +python -c "from easysearch import Easysearch; print('Easysearch client installed successfully!')" |
| 163 | +``` |
| 164 | + |
| 165 | +### Quick Test |
| 166 | + |
| 167 | +```python |
| 168 | +from easysearch import Easysearch |
| 169 | + |
| 170 | +# Connect to your Easysearch instance |
| 171 | +es = Easysearch(['http://localhost:9200']) |
| 172 | + |
| 173 | +# Get cluster information |
| 174 | +info = es.info() |
| 175 | +print(info) |
| 176 | +``` |
| 177 | + |
| 178 | +--- |
| 179 | + |
| 180 | +## Requirements |
| 181 | + |
| 182 | +- **Python:** 3.6 or higher (Python 2.7 and 3.4+ are supported, but 3.6+ recommended) |
| 183 | +- **Dependencies:** |
| 184 | + - `urllib3>=1.21.1,<2` |
| 185 | + - `certifi` |
| 186 | + - `aiohttp>=3` (for async support, Python 3.6+ only) |
| 187 | + |
| 188 | +Dependencies are automatically installed by pip. |
| 189 | + |
| 190 | +--- |
| 191 | + |
| 192 | +## Offline Installation |
| 193 | + |
| 194 | +For environments without internet access: |
| 195 | + |
| 196 | +### Step 1: Download packages on a machine with internet |
| 197 | + |
| 198 | +```bash |
| 199 | +# Download the package and all dependencies |
| 200 | +pip download easysearch -d /path/to/packages/ |
| 201 | +``` |
| 202 | + |
| 203 | +Or download from GitHub Releases manually. |
| 204 | + |
| 205 | +### Step 2: Transfer to offline machine |
| 206 | + |
| 207 | +Copy the packages directory to your offline machine. |
| 208 | + |
| 209 | +### Step 3: Install offline |
| 210 | + |
| 211 | +```bash |
| 212 | +pip install --no-index --find-links=/path/to/packages/ easysearch |
| 213 | +``` |
| 214 | + |
| 215 | +--- |
| 216 | + |
| 217 | +## Troubleshooting |
| 218 | + |
| 219 | +### SSL Certificate Verification Errors |
| 220 | + |
| 221 | +If you encounter SSL certificate errors: |
| 222 | + |
| 223 | +```python |
| 224 | +from easysearch import Easysearch |
| 225 | + |
| 226 | +es = Easysearch( |
| 227 | + ['https://localhost:9200'], |
| 228 | + use_ssl=True, |
| 229 | + verify_certs=False, # Disable certificate verification (development only) |
| 230 | + ssl_show_warn=False |
| 231 | +) |
| 232 | +``` |
| 233 | + |
| 234 | +**Warning:** Only disable certificate verification in development environments. |
| 235 | + |
| 236 | +### ImportError |
| 237 | + |
| 238 | +If you get `ImportError: No module named 'easysearch'`: |
| 239 | + |
| 240 | +1. Verify installation: `pip list | grep easysearch` |
| 241 | +2. Check Python version: `python --version` |
| 242 | +3. Ensure you're using the correct Python environment |
| 243 | + |
| 244 | +### Connection Refused |
| 245 | + |
| 246 | +If you cannot connect to Easysearch: |
| 247 | + |
| 248 | +1. Verify Easysearch is running: `curl http://localhost:9200` |
| 249 | +2. Check the host and port in your connection string |
| 250 | +3. Verify firewall settings |
| 251 | + |
| 252 | +--- |
| 253 | + |
| 254 | +## Uninstallation |
| 255 | + |
| 256 | +To remove the Easysearch Python client: |
| 257 | + |
| 258 | +```bash |
| 259 | +pip uninstall easysearch |
| 260 | +``` |
| 261 | + |
| 262 | +--- |
| 263 | + |
| 264 | +## Next Steps |
| 265 | + |
| 266 | +- Read the [Quick Start Guide](README.rst) |
| 267 | +- Check [API Documentation](docs/index.asciidoc) |
| 268 | +- View [Examples](examples/) |
| 269 | +- Report issues on [GitHub](https://github.com/infinilabs/easysearch-py/issues) |
0 commit comments