{"id":15044361,"url":"https://github.com/elastic/workplace-search-python","last_synced_at":"2025-10-19T20:31:36.048Z","repository":{"id":57425992,"uuid":"95817845","full_name":"elastic/workplace-search-python","owner":"elastic","description":"Elastic Workplace Search Official Python Client","archived":false,"fork":false,"pushed_at":"2024-08-08T11:20:26.000Z","size":106,"stargazers_count":10,"open_issues_count":1,"forks_count":3,"subscribers_count":29,"default_branch":"master","last_synced_at":"2025-01-28T20:58:38.954Z","etag":null,"topics":["api-client","elastic","elastic-enterprise-search","elastic-workplace-search","python","python-client","search","swiftype"],"latest_commit_sha":null,"homepage":"https://www.elastic.co/workplace-search","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/elastic.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":"LICENSE.txt","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2017-06-29T20:40:35.000Z","updated_at":"2023-06-29T05:16:49.000Z","dependencies_parsed_at":"2022-09-19T09:51:25.256Z","dependency_job_id":null,"html_url":"https://github.com/elastic/workplace-search-python","commit_stats":null,"previous_names":["swiftype/swiftype-enterprise-python"],"tags_count":4,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/elastic%2Fworkplace-search-python","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/elastic%2Fworkplace-search-python/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/elastic%2Fworkplace-search-python/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/elastic%2Fworkplace-search-python/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/elastic","download_url":"https://codeload.github.com/elastic/workplace-search-python/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":237215445,"owners_count":19273549,"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":["api-client","elastic","elastic-enterprise-search","elastic-workplace-search","python","python-client","search","swiftype"],"created_at":"2024-09-24T20:50:29.762Z","updated_at":"2025-10-19T20:31:30.786Z","avatar_url":"https://github.com/elastic.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"\u003e **⚠️ This client is deprecated ⚠️**\n\u003e\n\u003e As of Enterprise Search version 7.10.0, we are directing users to the new [Enterprise Search Python Client](https://github.com/elastic/enterprise-search-python) and\n\u003e deprecating this client.\n\u003e\n\u003e This client will be compatible with all Enterprise Search 7.x releases, but will not be compatible with 8.x releases. Our development effort on this project will\n\u003e be limited to bug fixes. All future enhancements will be focused on the Enterprise Search Python Client.\n\u003e\n\u003e Thank you! - Elastic\n\n\u003cp align=\"center\"\u003e\u003ca href=\"https://github.com/elastic/workplace-search-python/actions\"\u003e\u003cimg src=\"https://github.com/elastic/workplace-search-python/workflows/CI/badge.svg\" alt=\"GitHub Actions\"\u003e\u003c/a\u003e\n\n\u003e A first-party Python client for [Elastic Workplace Search](https://www.elastic.co/workplace-search).\n\n## Contents\n\n+ [Getting started](#getting-started-)\n+ [Usage](#usage)\n+ [FAQ](#faq-)\n+ [Contribute](#contribute-)\n+ [License](#license-)\n\n***\n\n## Getting started 🐣\n\nSupports Python 2.7 and Python 3.4+.\n\nInstalled with\n`pip \u003chttp://pypi.python.org/pypi/pip\u003e`:\n\n```bash\n$ python -m pip install elastic_workplace_search\n```\n\nYou can also download and install the project source:\n\n```bash\n$ python setup.py install\n```\n\nDepends on [requests](https://github.com/requests/requests) for making HTTP requests.\n\n## Usage\n\n### Creating a new Client\n\n```python\n  from elastic_workplace_search import Client\n  authorization_token = 'authorization token'\n  client = Client(authorization_token)\n```\n\nRetrieve your access token and a content source key after creating your content source.\n\n### Change API endpoint\n\n```python\nclient = Client(authorization_token, \"https://your-server.example.com/api/ws/v1\")\n```\n\n### Custom Source Documents\n\nDocument API features are found in the `client.documents` module.\n\n#### Indexing Documents\n\nIndexing a document into a custom content source:\n\n```python\n  content_source_key = 'content source key'\n  documents = [\n    {\n      'id': '1234',\n      'url': 'https://github.com/elastic/workplace-search-python',\n      'title': 'Elastic Workplace Search Official Python Client',\n      'body': 'A descriptive body, with document contents and metadata'\n    }\n  ]\n\n  client.documents.index_documents(content_source_key, documents)\n```\n\n#### Deleting Documents\n\nDeleting a document from a custom content source:\n\n```python\n  content_source_key = 'content source key'\n  ids = ['1234']\n\n  client.documents.delete_documents(content_source_key, ids)\n```\n\n### Permissions\n\nPermissions API features are found in the `client.permissions` module.\n\n#### Listing all permissions\n\n```python\ncontent_source_key = 'content source key'\n\nclient.permissions.list_all_permissions(content_source_key)\n```\n\n#### Listing all permissions with paging\n\n```python\ncontent_source_key = 'content source key'\n\nclient.permissions.list_all_permissions(content_source_key, size=20, current=2)\n```\n\n#### Retrieve a User's permissions\n\n```python\ncontent_source_key = 'content source key'\nuser = 'enterprise_search'\n\nclient.permissions.get_user_permissions(content_source_key, user)\n```\n\n#### Add permissions to a User\n\n```python\ncontent_source_key = 'content source key'\nuser = 'enterprise_search'\npermissions = ['permission1']\n\nclient.permissions.add_user_permissions(content_source_key, 'enterprise_search', { 'permissions': permissions })\n```\n\n#### Update a User's permissions\n\n```python\ncontent_source_key = 'content source key'\nuser = 'enterprise_search'\npermissions = ['permission2']\n\nclient.permissions.update_user_permissions(content_source_key, 'enterprise_search', { 'permissions': permissions })\n```\n\n#### Remove permissions from a User\n\n```python\ncontent_source_key = 'content source key'\nuser = 'enterprise_search'\npermissions = ['permission2']\n\nclient.permissions.remove_user_permissions(content_source_key, 'enterprise_search', { 'permissions': permissions })\n```\n\n## FAQ 🔮\n\n### Where do I report issues with the client?\n\nIf something is not working as expected, please open an [issue](https://github.com/elastic/workplace-search-python/issues/new).\n\n## Contribute 🚀\n\nWe welcome contributors to the project. Before you begin, a couple notes...\n\n+ Before opening a pull request, please create an issue to [discuss the scope of your proposal](https://github.com/elastic/workplace-search-python/issues).\n+ Please write simple code and concise documentation, when appropriate.\n\n## License 📗\n\n[Apache 2.0](https://github.com/elastic/workplace-search-python/blob/master/LICENSE.txt) © [Elastic](https://github.com/elastic)\n\nThank you to all the [contributors](https://github.com/elastic/workplace-search-python/graphs/contributors)!\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Felastic%2Fworkplace-search-python","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Felastic%2Fworkplace-search-python","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Felastic%2Fworkplace-search-python/lists"}