Skip to main content
Warning: You are using the test version of PyPI. This is a pre-production deployment of Warehouse. Changes made here affect the production instance of TestPyPI (testpypi.python.org).
Help us improve Python packaging - Donate today!

An API client for Swiftype Enterprise

Project Description
=========================================
Swiftype Enterprise API Client for Python
=========================================

About
=====

A Python client for interacting with Swiftype Enterprise content sources.
Documentation for this api client can be found at `readthedocs
<http://swiftype-enterprise.readthedocs.io/en/latest/`_. For
more information, go to our `generic documentation page
<https://app.swiftype.com/ent/docs/custom_sources>`_.

Installation
============
Swiftype Enterprise Client can be installed with
`pip <http://pypi.python.org/pypi/pip>`_::

$ python -m pip install swiftype_enterprise

You can also download the project source and do::

$ python setup.py install

Dependencies
============
Swiftype Enterprise Client supports Python 2.7 and Python 3.3+. It depends
on futures and requests.

Examples
========
Here's a basic example for indexing a document into a custom content source.
You can get an access token and a content source key after creating a content
source `here <https://app.swiftype.com/ent/sources/custom/new>`:

.. code-block:: 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': '1',
'url': 'https://github.com/swiftype/swiftype-enterprise-python',
'title': 'Swiftype Enterprise Python Github',
'body': 'A descriptive body'
}
]
>>> try:
>>> document_receipt_ids = client.index_documents(content_source_key, documents, timeout=10, delay=2)
>>> print(document_receipt_ids)
>>> except SynchronousDocumentIndexingFailed:
>>> # Timed out before documents could finish indexing
[{'status': 'complete', 'errors': [], 'external_id': 'doc_receipt_1', 'id': '1', 'links': {'document_receipt': 'http://localhost:3002/api/v1/ent/document_receipts/5955d325f81eeace502f0a50'}}, ...]

Release History

Release History

This version
History Node

0.0.1

Download Files

Download Files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

File Name & Checksum SHA256 Checksum Help Version File Type Upload Date
swiftype_enterprise-0.0.1.tar.gz (5.7 kB) Copy SHA256 Checksum SHA256 Source Jun 30, 2017

Supported By

WebFaction WebFaction Technical Writing Elastic Elastic Search Pingdom Pingdom Monitoring Dyn Dyn DNS Sentry Sentry Error Logging CloudAMQP CloudAMQP RabbitMQ Heroku Heroku PaaS Kabu Creative Kabu Creative UX & Design Fastly Fastly CDN DigiCert DigiCert EV Certificate Rackspace Rackspace Cloud Servers DreamHost DreamHost Log Hosting