OPUS (opus.nlpl.eu) Python3 API
Latest commit ed5e22f Aug 5, 2018
Permalink
Failed to load latest commit information.
.github initial commit from cookiecutter Oct 3, 2017
docs changed installation instructions to reflect existence of Makefile Oct 29, 2017
opus_api bump versions to 0.6.2 Aug 4, 2018
tests bumped verson and migrated OPUS URL Oct 29, 2017
.editorconfig initial commit from cookiecutter Oct 3, 2017
.gitignore ignoring .venv, changed makefile to delete .egg recursively, added as… Oct 3, 2017
.travis.yml bump version to 0.5.0 and change all python version settings to 3.5 Apr 22, 2018
AUTHORS.rst bumped version and remodified docs to not have index replicas Oct 8, 2017
CONTRIBUTING.rst initial commit from cookiecutter Oct 3, 2017
HISTORY.rst fixed HTML caching, bumped version and changed history Oct 10, 2017
LICENSE initial commit from cookiecutter Oct 3, 2017
MANIFEST.in more explicit file name reference and addition of file name to MANIFE… Oct 6, 2017
Makefile bumped version and included API docs Oct 9, 2017
README.recipe.rst using shields.io for RTD Oct 29, 2017
README.rst using shields.io for RTD Oct 29, 2017
modules.rst opus_api module docs generated Oct 9, 2017
opus_api.rst opus_api module docs generated Oct 9, 2017
requirements.txt Merge pull request #73 from yonkornilov/pyup-update-sphinx-1.7.5-to-1… Aug 4, 2018
setup.cfg bump versions to 0.6.2 Aug 4, 2018
setup.py bump versions to 0.6.2 Aug 4, 2018
tox.ini bump version to 0.5.0 and change all python version settings to 3.5 Apr 22, 2018
travis_pypi_setup.py added travis, pypi, and pyup configs Oct 6, 2017

README.rst

            /$$$$$$            /$$$$$$$  /$$   /$$  /$$$$$$
           /$$__  $$          | $$__  $$| $$  | $$ /$$__  $$
  /$$$$$$$| $$  \ $$  /$$$$$$ | $$  \ $$| $$  | $$| $$  \__/
 /$$_____/| $$  | $$ /$$__  $$| $$$$$$$/| $$  | $$|  $$$$$$
| $$      | $$  | $$| $$  \__/| $$____/ | $$  | $$ \____  $$
| $$      | $$  | $$| $$      | $$      | $$  | $$ /$$  \ $$
|  $$$$$$$|  $$$$$$/| $$      | $$      |  $$$$$$/|  $$$$$$/
 \_______/ \______/ |__/      |__/       \______/  \______/

pypi build Documentation Status Updates

OPUS (opus.nlpl.eu) Python API

Requirements

Download PhantomJS and make sure its in your PATH, eg:

$ wget -qO- https://bitbucket.org/ariya/phantomjs/downloads/phantomjs-2.1.1-linux-x86_64.tar.bz2 | tar xvj -C ~/.local/bin --strip 2 phantomjs-2.1.1-linux-x86_64/bin

Installation

Stable release

To install Opus API, run this command in your terminal:

$ pip install opus_api

This is the preferred method to install Opus API, as it will always install the most recent stable release.

If you don't have pip installed, this Python installation guide can guide you through the process.

From sources

The sources for Opus API can be downloaded from the Github repo.

You can either clone the public repository:

$ git clone git://github.com/yonkornilov/opus_api

Or download the tarball:

$ curl  -OL https://github.com/yonkornilov/opus_api/tarball/master

Once you have a copy of the source, you can install it with:

$ make install

Usage

Find your languages:

$ opus_api langs

[
...
  {
    "description": "en (English)",
    "id": 69,
    "name": "en"
  },
  ...
  {
    "description": "ru (Russian)",
    "id": 198,
    "name": "ru"
  }...
...
]

Find corpora:

$ opus_api get en ru --maximum 300 --minimum 3

{
  "corpora": [
    {
      "id": 1,
      "name": "OpenSubtitles2016",
      "src_tokens": "157.5M",
      "trg_tokens": "133.6M",
      "url": "http://opus.nlpl.eu/download.php?f=OpenSubtitles2016%2Fen-ru.txt.zip"
    },
  ...
    {
      "id": 13,
      "name": "KDE4",
      "src_tokens": "1.8M",
      "trg_tokens": "1.4M",
      "url": "http://opus.nlpl.eu/download.php?f=KDE4%2Fen-ru.txt.zip"
    }
  ]
}

TODO

  1. Get: parallel corpora for formats other than MOSES and TMX
  2. New feature: query available languages for corpora set

Credits

This package's CLI is powered by click.

This package was created with Cookiecutter and the audreyr/cookiecutter-pypackage project template.