Login and search
This project is responsible for logging in and performing a search for Elasticsearch or Opensearch.
Installation
This package is distributed through PyPI and can be installed using one of:
pip install "cogstack-es[ES9]" # For Elasticsearch 9
pip install "cogstack-es[ES8]" # For Elasticsearch 8
pip install "cogstack-es[OS]" # For Opensearch
PS:
After installation, the import still remains import cogstack even though the installed package is called cogstack-es.
Login details
You need to get your login details and host from your administrator. This is usually an API key. There is also a mechanism for reading hosts and credentials from environmental variables:
from cogstack import read_from_env, CogStack
hosts, api_key, (username, password) = read_from_env()
# subsequently use one of
cs = CogStack.with_api_key_auth(hosts=hosts, api_key=api_key)
#cs = CogStack.with_basic_auth(hosts=hosts, username=username, password=password)
The read_from_env method will read the data from the following environmental variables:
| Environmetnal variable name | Description | Example value |
|---|---|---|
COGSTACK_HOSTS |
The host addresses, comma separated | http://localhost:9200,http://localhost:9201 |
COGSTACK_USERNAME |
The username for basic auth | user123 |
COGSTACK_PASSWORD |
The password for basic auth | sup3rsecur3-pw#946 |
COGSTACK_API_KEY_ID |
The API key ID for authentiaction | l0cGtvtlw1lbsyClOm6w |
COGSTACK_API_KEY |
The unencoded API key for authentiaction with the ID | I01NJf4Z6yvXyXThh1676g |
COGSTACK_API_KEY_ENCODED |
The encoded API key for authentiaction with just the API key | ZZpwMtW3ky6Tw9KEtfavVzTP0JcrC7iLnVf7zXbqAh70A15VKJwHd5YX3J== |
Note: If these fields are left blank then the user will be prompted to enter the details themselves.
If you are unsure about the above information please contact your CogStack system administrator.
How to build a Search query
A core component of cogstack is Elasticsearch which is a search engine built on top of Apache Lucene.
Lucene has a custom query syntax for querying its indexes (Lucene Query Syntax). This query syntax allows for features such as Keyword matching, Wildcard matching, Regular expression, Proximity matching, Range searches.
Full documentation for this syntax is available as part of Elasticsearch query string syntax.
Metadata
Release files for cogstack-es 0.3.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 | |
|---|---|---|---|
| cogstack_es-0.3.0.tar.gz | 21.4 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| cogstack_es-0.3.0-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 35.0 kB
Release files / cogstack_es-0.3.0.tar.gz
| Download URL | cogstack_es-0.3.0.tar.gz |
|---|---|
| Size | 21.4 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
ac0a5b8606a118993c4fd157a5d9fcfeda07b24326fce96be3530ed419fd8a51
|
|
BLAKE2b-256 checksum How to use checksums |
2caa08d11440ffe4c3f3ac6b6c9f337988dd62f427b5ec2a3e0876109b22b517
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.14
|
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.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Oct 16, 2026.
Transparency logRelease files / cogstack_es-0.3.0-py3-none-any.whl
| Download URL | cogstack_es-0.3.0-py3-none-any.whl |
|---|---|
| Size | 13.5 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
0a00431ba6e4b2284feb2f44f62823c3174c7266cc3ac5153902f0083672b99d
|
|
BLAKE2b-256 checksum How to use checksums |
159c6290c2cb5ec2e9ea379af82fc5aa236c0c953a920f1bd5c9ca41576a4885
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.14
|
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.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Oct 16, 2026.
Transparency log