Skip to main content
This is a pre-production deployment of Warehouse. Changes made here affect the production instance of PyPI (
Help us improve Python packaging - Donate today!

A sentiment analysis server implementation. Designed to be extendable, so new algorithms and sources can be used.

Project Description

![GSI Logo](

This tool will take several input formats and translates them to semantic formats. It focuses on translating corpora to the NIF+[Marl]( format, usin json-ld.

Conpy is under heavy development. As of this writing, it supports:

* Creating and administrating translation templates (admin level)
* Editing templates to convert traditional formats (csv, tsv, xls, xml) formats to NIF+Marl+Onyx.
* Using the available templates to translate known formats through this portal or via POST requests
* Saving or outputting the result
* Logging translation requests
* Auto selection of the best template based on the input format

In the future, we might include the following features:
* Conversion of semantic formats
* Automatic translation between semantic formats (e.g. [RDF]( to [JSON-LD](

Translating a document
Documents can be translated via the Web Interface, through the REST interface, or via Command-Line.

The Generator endpoint takes the following parameters:

* input (i): The original file to be translated
* informat (f): The format of the original file
* intype (t) [Optional]:
* direct (default)
* url
* file
* outformat (o):
* json-ld
* rdfxml
* turtle (default, to comply with NIF)
* ntriples
* trix
* base URI (u) [Optional]: base URI to use for the corpus
* prefix (p) [Optional]: prefix to replace the base URI
* language (l) [Optional]: language code (see dc:terms and [ISO 639]( )
* template (t) [Optional]: ID of the template to use. If it is omitted, a template to convert from informat to outformat will be used, or a template from informat to another format (e.g. json-ld), with automatic conversion (*to be done*).
* toFile [Optional]: Whether the result should be sent in the response (default) or written to a file. For convenience, this value defaults to False when using the Web Form.

Using the command line tool *curl*, a request can be made like this:

curl -F"template=Example_to_Marl" -F"input=@input-file.csv" -F"intype=FILE"
> result.jsonld

Command-line tool
In addition to the methods above, this tool can be used directly in the command line.
The conversion

python -m conpy.cli -i <file to be converted> --template <conversion template> -o <output>

Installation instructions
This repository contains all the code necessary to run conpy. To install it, follow the following steps:

* Copy the conpy/ to conpy/
* Add your database information to
* Create a virtualenv (preferably, in the project root)
* Install the required packages:

pip install -r requirements.txt

* Test the environment with:

python runserver localhost:<PORT>

If the standalone server works, you can try serving the portal via apache/nginx and WSGI. It has been tested with apache2 and uwsgi. In that case you will also need to serve the static files from your web server. An example configuration for Apache2 would be:

<VirtualHost *:80>

[ ... ]

WSGIScriptAlias /conpy /path_to_conpy/
WSGIDaemonProcess conpy user=www-data group=www-data processes=nprocesses threads=nthreads python-path=/path_to_conpy:/path_to_conpy/venv/lib/python2.7/site-packages
WSGIProcessGroup conpy
<Directory /path_to_conpy>
Order allow,deny
Allow from all

Alias /conpy/robots.txt /path_to_conpy/static/robots.txt
Alias /conpy/favicon.ico /path_to_conpy/static/favicon.ico

AliasMatch ^conpy/([^/]*\.css) /path_to_conpy/static/styles/$1

Alias /conpy/media/ /path_to_conpy/media/
Alias /conpy/static/ /path_to_conpy/static/

<Directory /path_to_conpy/static>
Order deny,allow
Allow from all
Options -Indexes

<Directory /path_to_conpy/media>
Order deny,allow
Allow from all
Options -Indexes


Grant Agreement no: 296277
Starting date: 01/09/2012
Project duration: 24 months

![Eurosentiment Logo](logo_grande.png)
![FP7 logo](logo_fp7.gif)

Release History

This version
History Node


Download Files

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

File Name & Hash SHA256 Hash Help Version File Type Upload Date
(77.0 kB) Copy SHA256 Hash SHA256
Source Mar 1, 2015

Supported By

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 Google Google Cloud Servers DreamHost DreamHost Log Hosting