An API client for Swiftype Enterprise
Project description
<p align="center"><img src="https://github.com/swiftype/swiftype-enterprise-python/blob/master/logo-enterprise-search.png?raw=true" alt="Elastic Enterprise Search Logo"></p>
> A first-party Python client for [Elastic Enterprise Search](https://www.elastic.co/solutions/enterprise-search).
## Contents
+ [Getting started](#getting-started-)
+ [Usage](#usage)
+ [FAQ](#faq-)
+ [Contribute](#contribute-)
+ [License](#license-)
***
## Getting started 🐣
Supports Python 2.7 and Python 3.3+.
Depends on [futures](https://github.com/PythonCharmers/python-future) and [requests](https://github.com/requests/requests).
Installed with
`pip <http://pypi.python.org/pypi/pip>`:
```bash
$ python -m pip install swiftype_enterprise
```
You can also download and install the project source:
```bash
$ python setup.py install
```
## Usage
Retrieve your access token and a content source key after creating your content source.
Indexing a document into a custom content source:
```python
from swiftype_enterprise import SwiftypeEnterpriseClient
from swiftype_enterprise.exceptions import SynchronousDocumentIndexingFailed
content_source_key = 'content source key'
authorization_token = 'authorization token'
client = SwiftypeEnterpriseClient(authorization_token)
documents = [
{
'external_id': '1234',
'url': 'https://github.com/swiftype/swiftype-enterprise-python',
'title': 'Swiftype Enterprise Python Github',
'body': 'A descriptive body, with document contents and metadata'
}
]
try:
document_results = client.index_documents(content_source_key, documents, timeout=10, delay=2)
print(document_results)
except SynchronousDocumentIndexingFailed:
# Timed out before documents could finish indexing
pass
```
## FAQ 🔮
### Where do I report issues with the client?
If something is not working as expected, please open an [issue](https://github.com/swiftype/swiftype-enterprise-python/issues/new).
## Contribute 🚀
We welcome contributors to the project. Before you begin, a couple notes...
+ Before opening a pull request, please create an issue to [discuss the scope of your proposal](https://github.com/swiftype/swiftype-enterprise-python/issues).
+ Please write simple code and concise documentation, when appropriate.
## License 📗
[MIT](https://github.com/swiftype/swiftype-enterprise-python/blob/master/LICENSE) © [Elastic](https://github.com/elastic)
Thank you to all the [contributors](https://github.com/swiftype/swiftype-enterprise-python/graphs/contributors)!
> A first-party Python client for [Elastic Enterprise Search](https://www.elastic.co/solutions/enterprise-search).
## Contents
+ [Getting started](#getting-started-)
+ [Usage](#usage)
+ [FAQ](#faq-)
+ [Contribute](#contribute-)
+ [License](#license-)
***
## Getting started 🐣
Supports Python 2.7 and Python 3.3+.
Depends on [futures](https://github.com/PythonCharmers/python-future) and [requests](https://github.com/requests/requests).
Installed with
`pip <http://pypi.python.org/pypi/pip>`:
```bash
$ python -m pip install swiftype_enterprise
```
You can also download and install the project source:
```bash
$ python setup.py install
```
## Usage
Retrieve your access token and a content source key after creating your content source.
Indexing a document into a custom content source:
```python
from swiftype_enterprise import SwiftypeEnterpriseClient
from swiftype_enterprise.exceptions import SynchronousDocumentIndexingFailed
content_source_key = 'content source key'
authorization_token = 'authorization token'
client = SwiftypeEnterpriseClient(authorization_token)
documents = [
{
'external_id': '1234',
'url': 'https://github.com/swiftype/swiftype-enterprise-python',
'title': 'Swiftype Enterprise Python Github',
'body': 'A descriptive body, with document contents and metadata'
}
]
try:
document_results = client.index_documents(content_source_key, documents, timeout=10, delay=2)
print(document_results)
except SynchronousDocumentIndexingFailed:
# Timed out before documents could finish indexing
pass
```
## FAQ 🔮
### Where do I report issues with the client?
If something is not working as expected, please open an [issue](https://github.com/swiftype/swiftype-enterprise-python/issues/new).
## Contribute 🚀
We welcome contributors to the project. Before you begin, a couple notes...
+ Before opening a pull request, please create an issue to [discuss the scope of your proposal](https://github.com/swiftype/swiftype-enterprise-python/issues).
+ Please write simple code and concise documentation, when appropriate.
## License 📗
[MIT](https://github.com/swiftype/swiftype-enterprise-python/blob/master/LICENSE) © [Elastic](https://github.com/elastic)
Thank you to all the [contributors](https://github.com/swiftype/swiftype-enterprise-python/graphs/contributors)!
Project details
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Close
Hashes for swiftype_enterprise-0.1.0.tar.gz
Algorithm | Hash digest | |
---|---|---|
SHA256 | 1d3cc08479871a017edaeb7509aed1a942380f8b75d307fe2bd2d80ed81fe751 |
|
MD5 | a307d4fa8327b6388c0cead6b3b8e792 |
|
BLAKE2b-256 | f102bcf18c354a99cf831932b2e70c7d59a906b2cdd9080394963f848ddf0abd |