{"id":15487952,"url":"https://github.com/dblock/opensearch-python-client-demo","last_synced_at":"2025-09-20T02:33:51.971Z","repository":{"id":66277138,"uuid":"580911363","full_name":"dblock/opensearch-python-client-demo","owner":"dblock","description":"OpenSearch Python Client Demo","archived":false,"fork":false,"pushed_at":"2024-11-27T22:22:53.000Z","size":71,"stargazers_count":4,"open_issues_count":0,"forks_count":3,"subscribers_count":2,"default_branch":"main","last_synced_at":"2024-12-28T21:05:40.851Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/dblock.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE.txt","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null}},"created_at":"2022-12-21T19:14:12.000Z","updated_at":"2024-11-27T22:22:57.000Z","dependencies_parsed_at":"2023-11-16T01:36:36.433Z","dependency_job_id":"517716e2-d971-4762-b2c5-cdf984bc5562","html_url":"https://github.com/dblock/opensearch-python-client-demo","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dblock%2Fopensearch-python-client-demo","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dblock%2Fopensearch-python-client-demo/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dblock%2Fopensearch-python-client-demo/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dblock%2Fopensearch-python-client-demo/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/dblock","download_url":"https://codeload.github.com/dblock/opensearch-python-client-demo/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":233566907,"owners_count":18695286,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-10-02T06:44:58.225Z","updated_at":"2025-09-20T02:33:46.659Z","avatar_url":"https://github.com/dblock.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# OpenSearch Python Client Demo\n\nMakes requests to Amazon OpenSearch using the [OpenSearch Python Client](https://github.com/opensearch-project/opensearch-py). Supports OpenSearch Serverless since opensearch-py 2.2.1.\n\n### Install Prerequisites\n\n#### Pyenv\n\nUse pyenv to manage multiple versions of Python. This can be installed with [pyenv-installer](https://github.com/pyenv/pyenv-installer) on Linux and MacOS, and [pyenv-win](https://github.com/pyenv-win/pyenv-win#installation) on Windows.\n\n```\ncurl -L https://github.com/pyenv/pyenv-installer/raw/master/bin/pyenv-installer | bash\n```\n\nFollow the intructions to add `pyenv init` into your `.bashrc`, reopen a new shell.\n\n#### Python 3.9\n\nPython projects in this repository use Python 3.x. The latest version at the time of writing this is 3.11.1. See the [Python Beginners Guide](https://wiki.python.org/moin/BeginnersGuide) if you have never worked with the language.\n\n```\n$ python3 --version\nPython 3.11.1\n```\n\nIf you are using pyenv.\n\n```\npyenv install 3.11.1\npyenv global 3.11.1\n```\n\n#### Pipenv\n\nThis project uses [pipenv](https://pipenv.pypa.io/en/latest/), which is typically installed with `pip install --user pipenv`. Pipenv automatically creates and manages a virtualenv for your projects, as well as adds/removes packages from your `Pipfile` as you install/uninstall packages. It also generates the ever-important `Pipfile.lock`, which is used to produce deterministic builds.\n\n```\n$ pip install pipenv\n\n$ pipenv --version\npipenv, version 2022.12.19\n```\n\nOn Windows, run `pyenv rehash` if `pipenv` cannot be found. This rehashes pyenv shims, creating a `pipenv` file in `/.pyenv/pyenv-win/shims/`.\n\n#### Install Packages\n\nInstall dependencies.\n\n```\ncd sync\npipenv install\n```\n\n## Running\n\nCreate an OpenSearch domain in (AWS) which support IAM based AuthN/AuthZ.\n\n```\nexport AWS_ACCESS_KEY_ID=\nexport AWS_SECRET_ACCESS_KEY=\nexport AWS_SESSION_TOKEN=\nexport AWS_REGION=us-west-2\n\nexport SERVICE=es # use \"aoss\" for OpenSearch Serverless.\nexport ENDPOINT=https://....us-west-2.es.amazonaws.com\n\npipenv run python example.py\n```\n\nThis will output the version of OpenSearch and a search result.\n\n```\nopensearch: 2.3.0\n{'director': 'Bennett Miller', 'title': 'Moneyball', 'year': 2011}\n```\n\nThe [sync](sync/example.py) and the [async](async/example.py) examples will create an index, add a document, search for it, then cleanup. There's also an example of inserting and searching for vectors in [k-nn.py](sync/k-nn.py) and another example making direct `transport` calls instead of a higher level DSL in [transport.py](sync/transport.py).\n\n## License \n\nThis project is licensed under the [Apache v2.0 License](LICENSE.txt).\n\n## Copyright\n\nCopyright OpenSearch Contributors. See [NOTICE](NOTICE.txt) for details.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdblock%2Fopensearch-python-client-demo","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdblock%2Fopensearch-python-client-demo","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdblock%2Fopensearch-python-client-demo/lists"}