Skip to main content

OPUS (opus.lingfil.uu.se) Python API

Project description

            /$$$$$$            /$$$$$$$  /$$   /$$  /$$$$$$
           /$$__  $$          | $$__  $$| $$  | $$ /$$__  $$
  /$$$$$$$| $$  \ $$  /$$$$$$ | $$  \ $$| $$  | $$| $$  \__/
 /$$_____/| $$  | $$ /$$__  $$| $$$$$$$/| $$  | $$|  $$$$$$
| $$      | $$  | $$| $$  \__/| $$____/ | $$  | $$ \____  $$
| $$      | $$  | $$| $$      | $$      | $$  | $$ /$$  \ $$
|  $$$$$$$|  $$$$$$/| $$      | $$      |  $$$$$$/|  $$$$$$/
 \_______/ \______/ |__/      |__/       \______/  \______/
https://img.shields.io/pypi/v/opus-api.svg https://img.shields.io/travis/yonkornilov/opus-api.svg Documentation Status Updates

OPUS (opus.lingfil.uu.se) Python API

Features

  • Get parallel corpora for src-target languages from OPUS, the online parallel corpus

  • JSON API

  • Caching for quick results

  • Command Line Interface

  • Filter corpora by range of desired total tokens

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.lingfil.uu.se/download.php?f=OpenSubtitles2016%2Fen-ru.txt.zip"
    },
  ...
    {
      "id": 13,
      "name": "KDE4",
      "src_tokens": "1.8M",
      "trg_tokens": "1.4M",
      "url": "http://opus.lingfil.uu.se/download.php?f=KDE4%2Fen-ru.txt.zip"
    }
  ]
}

Credits

This package’s CLI is powered by click.

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

History

0.1.0 (2017-10-03)

  • First release on PyPI.

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

opus_api-0.1.5.tar.gz (14.8 kB view hashes)

Uploaded Source

Built Distribution

opus_api-0.1.5-py2.py3-none-any.whl (8.8 kB view hashes)

Uploaded Python 2 Python 3

Supported by

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