Skip to content
master
Go to file
Code
This branch is 34 commits behind andrewresearch:master.

Latest commit

 

Git stats

Files

Permalink
Failed to load latest commit information.
Type
Name
Latest commit message
Commit time
 
 
 
 
 
 
 
 
 
 

README.md

PyPI version https://img.shields.io/badge/license-Apache%202.0-blue.svg

TapCliPy

Python Client Library for TAP

Installation

Install with pip:

> pip install tapclipy

Basic Example

from tapclipy import tap_connect

# Create TAP Connection
tap = tap_connect.Connect('http://tap.yourdomain.com')

# Get and print the Current Schema
tap.fetch_schema()
for query,type in tap.schema_query_name_types().items():
    print("{} >> {}".format(query, type))
print("----------------------------------------------")

# Analyse some text for some basic metrics
query = tap.query('metrics')
text = "This is a very small test of TAP. It should produce some metrics on these two sentences!"
json = tap.analyse_text(query, text)

print()
print("METRICS:\n", json)

should output:


visible >> StringResult
clean >> StringResult
cleanPreserve >> StringResult
cleanMinimal >> StringResult
cleanAscii >> StringResult
annotations >> SentencesResult
vocabulary >> VocabResult
metrics >> MetricsResult
expressions >> ExpressionsResult
syllables >> syllables
spelling >> SpellingResult
posStats >> PosStatsResult
reflectExpressions >> ReflectExpressionsResult
moves >> StringListResult
----------------------------------------------

METRICS:
 {'data': {'metrics': {'analytics': {'words': 17, 'sentences': 2, 'sentWordCounts': [8, 9], 'averageSentWordCount': 8.5}}}}

Process finished with exit code 0

Currently available queries

Query Return Type
visible StringResult
clean StringResult
cleanPreserve StringResult
cleanMinimal StringResult
cleanAscii StringResult
annotations SentencesResult
vocabulary VocabResult
metrics MetricsResult
expressions ExpressionsResult
syllables syllables
spelling SpellingResult
posStats PosStatsResult
reflectExpressions ReflectExpressionsResult
moves StringListResult

About

TAP client for Python

Resources

License

Packages

No packages published

Languages

You can’t perform that action at this time.