Skip to main content

Python 3 API to the TweeboParser

Project description

Tweebo Parser Python API

This is a Python 3 API to the TweeboParser using the TweeboParser API server which is servered using the Docker image which can be found here.

Installation and setup

  1. Requires Python 3.6
  2. pip install tweebo-parser-python-api
  3. Install docker
  4. Start the TweeboParser API server running locally on port 8000: docker run -p -d --rm 8000:8000 mooreap/tweeboparserdocker

NOTE This will run the server using as many threads as you have CPU cores on your machine. If you would like to specify the number of threads use the --threads flag e.g.:

docker run -p -d --rm 8000:8000 mooreap/tweeboparserdocker --threads 4

Also to stop the docker server running:

  1. Find the name assigned to the docker image using: docker ps
  2. Then stop the relevant docker image: docker stop name_of_image

Example

from tweebo_parser import API, ServerError
# Assumes server is running locally at 0.0.0.0:8000
tweebo_api = API()
text_data = ['Guangdong University of Foreign Studies is located in Guangzhou.',
             'Lucy is in the sky with diamonds.']
try:
    result_stanford = tweebo_api.parse_stanford(text_data)
    result_conll = tweebo_api.parse_conll(text_data)
except ServerError as e:
    print(f'{e}\n{e.message}')

For a more detailed example see the following jupyter notebook

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

tweebo_parser_python_api-1.0.1.tar.gz (3.2 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

tweebo_parser_python_api-1.0.1-py3-none-any.whl (3.7 kB view details)

Uploaded Python 3

File details

Details for the file tweebo_parser_python_api-1.0.1.tar.gz.

File metadata

File hashes

Hashes for tweebo_parser_python_api-1.0.1.tar.gz
Algorithm Hash digest
SHA256 d6de5ecc45460805591240d62fe342b048fca15d07cd9d875a33398e3f7b3498
MD5 1ebf028f68b08e4374a15a800a3a12d5
BLAKE2b-256 ae66d5b97ac4d6c093e5a7328027144692416e4ac606372898406c7e06c1b637

See more details on using hashes here.

File details

Details for the file tweebo_parser_python_api-1.0.1-py3-none-any.whl.

File metadata

File hashes

Hashes for tweebo_parser_python_api-1.0.1-py3-none-any.whl
Algorithm Hash digest
SHA256 ff81efca041c0f5df2d6edcfcc79461070754844767a07522c3d29b2a303c6e4
MD5 68851ba77118709147f786975d722313
BLAKE2b-256 94c78f228e688dc99459c3b2c09f1c0ab3d68b20f01f4d02a54df7ea96fbaf5c

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page