Metadata-Version: 2.1
Name: mtap
Version: 0.2.0rc0
Summary: A framework for distributed text analysis using gRPC and microservices-based architecture.
Home-page: https://nlpie.github.io/mtap
Author: University of Minnesota NLP/IE Group
Author-email: nlp-ie@umn.edu
License: UNKNOWN
Keywords: nlp grpc microservices
Platform: UNKNOWN
Classifier: Development Status :: 4 - Beta
Classifier: Intended Audience :: Science/Research
Classifier: Intended Audience :: Developers
Classifier: License :: OSI Approved :: Apache Software License
Classifier: Natural Language :: English
Classifier: Operating System :: MacOS
Classifier: Operating System :: POSIX :: Linux
Classifier: Programming Language :: Python :: 3 :: Only
Classifier: Programming Language :: Python :: 3.5
Classifier: Programming Language :: Python :: 3.6
Classifier: Programming Language :: Python :: 3.7
Classifier: Programming Language :: Python :: 3.8
Classifier: Programming Language :: Python :: 3.9
Classifier: Programming Language :: Python :: Implementation :: CPython
Classifier: Topic :: Scientific/Engineering :: Information Analysis
Classifier: Topic :: Software Development :: Libraries
Classifier: Topic :: Text Processing :: General
Classifier: Topic :: Text Processing :: Linguistic
Requires-Python: ~=3.5
Description-Content-Type: text/markdown
Requires-Dist: grpcio (>=1.20.0)
Requires-Dist: grpcio-health-checking (>=1.20.0)
Requires-Dist: protobuf (>=3.7.0)
Requires-Dist: pyyaml
Requires-Dist: python-consul
Requires-Dist: googleapis-common-protos
Provides-Extra: docs
Requires-Dist: sphinx ; extra == 'docs'
Requires-Dist: sphinx-rtd-theme ; extra == 'docs'
Provides-Extra: grpc_tools
Requires-Dist: grpcio-tools ; extra == 'grpc_tools'
Provides-Extra: tests
Requires-Dist: pytest-runner ; extra == 'tests'
Requires-Dist: pytest ; extra == 'tests'
Requires-Dist: grpcio-testing ; extra == 'tests'
Requires-Dist: requests ; extra == 'tests'
Requires-Dist: pytest-mock ; extra == 'tests'

# MTAP

## Microservice Text Analysis Platform

MTAP is a framework for distributed text analysis using gRPC and microservices-based architecture. 
MTAP is used to create independent, scalable, interoperable text analysis pipeline 
components in either Python or Java. 

## Requirements
- Python 3.5+
- Java 8+ (for java framework, integration tests)
- Go 13+ (for gateway, integration tests)

# Developer stuff

## Building

### Building the generated Python protobuf files

```shell script
python setup.py clean build_py
```

### Building a python distributable

```shell script
python setup.py bdist_wheel
```

### Building the Java Framework

```shell script
cd java
./gradlew build fatJar
```

### Building the Go HTTP API Gateway distributables
First time setup, follow the instructions for 
[gRPC Gateway](https://github.com/grpc-ecosystem/grpc-gateway) requirements.

Build stuff:
```shell script
cd go
make proto release
```

### Installing the Go API Gateway

```shell script
cd go
go install mtap-gateway/mtap-gateway.go 
```

# Testing

## Running Python unit tests

The python unit tests run using the version of MTAP installed to the site-packages: 

```shell script
pip install .\[tests]
pytest python/tests
```

## Running the Java unit tests

```shell script
cd java
./gradlew test
```

## Running integration tests

First, the go gateway needs to be installed and ``$GOROOT/bin`` needs to be on your ``$PATH``. From 
the root directory:

```shell script
cd go
go install mtap-gateway/mtap-gateway.go
```

Second, the Java framework fat jar needs to be built. From the root directory:

```shell script
cd java
./gradlew build fatJar
``` 

If you want to test service discovery via consul, consul needs to be started. From another terminal:

```shell script
consul agent -dev -ui
```

Now we're ready to run the integration tests, from the root directory:
```shell script
pip install .\[tests]
MTAP_JAR=java/build/libs/mtap-all-[MTAP VERSION GOES HERE] pytest python/tests --consul --integration
```



