https://github.com/apertium/apertium-apy

📦 Apertium HTTP Server in Python

https://github.com/apertium/apertium-apy

Science Score: 26.0%

This score indicates how likely this project is to be science-related based on various indicators:

  • â—‹
    CITATION.cff file
  • ✓
    codemeta.json file
    Found codemeta.json file
  • ✓
    .zenodo.json file
    Found .zenodo.json file
  • â—‹
    DOI references
  • â—‹
    Academic publication links
  • â—‹
    Committers with academic emails
  • â—‹
    Institutional organization owner
  • â—‹
    JOSS paper metadata
  • â—‹
    Scientific vocabulary similarity
    Low similarity (11.4%) to scientific vocabulary

Keywords

apertium apertium-tools machine-translation mt server

Keywords from Contributors

apertium-languages packaging apertium-trunk apertium-incubator dpkg apertium-stream-format archival interactive projection generic
Last synced: 5 months ago · JSON representation

Repository

📦 Apertium HTTP Server in Python

Basic Info
Statistics
  • Stars: 38
  • Watchers: 14
  • Forks: 47
  • Open Issues: 62
  • Releases: 3
Topics
apertium apertium-tools machine-translation mt server
Created about 10 years ago · Last pushed 7 months ago
Metadata Files
Readme Changelog License

README.md

Apertium APy

Build Status Coverage Status PyPI PyPI - Python Version

Apertium APy, Apertium API in Python, is a web server exposing Apertium functions including text, document, and webpage translation, as well as morphological analysis and generation. More information is available on the Apertium Wiki.

Requirements

  • Python 3.9+
  • Tornado 4.5.3 - 6.0.4 (python3-tornado on Debian/Ubuntu)

Additional functionality is provided by installation of the following packages:

  • apertium-streamparser enables spell checking
  • requests enables suggestion handling
  • chromium_compact_language_detector enables improved language detection (cld2)
  • chardet enables website character encoding detection
  • commentjson allows to keep API keys in commented json
  • lxml enables pair preferences

Precise versions are available in requirements.txt and setup.py.

Installation

Before you install, you can try out a live version of APy at apertium.org.

APy is available through PyPi:

$ pip install apertium-apy

On Ubuntu/Debian, it is also available through apt:

$ wget -qO- https://apertium.projectjj.com/apt/install-nightly.sh | bash
$ apt-get install apertium-apy

Finally, GitHub Container Registry hosts an image of the provided Dockerfile with entry point apertium-apy exposing port 2737:

$ docker pull ghcr.io/apertium/apy

Usage

Installation through apt or pip adds an apertium-apy executable:

$ apertium-apy --help
usage: apertium-apy [-h] [-s NONPAIRS_PATH] [-l LANG_NAMES] [-F FASTTEXT_MODEL]
                  [-f MISSING_FREQS] [-p PORT] [-c SSL_CERT] [-k SSL_KEY]
                  [-t TIMEOUT] [-j [NUM_PROCESSES]] [-d] [-P LOG_PATH]
                  [-i MAX_PIPES_PER_PAIR] [-n MIN_PIPES_PER_PAIR]
                  [-u MAX_USERS_PER_PIPE] [-m MAX_IDLE_SECS]
                  [-r RESTART_PIPE_AFTER] [-v VERBOSITY] [-V] [-S]
                  [-M UNKNOWN_MEMORY_LIMIT] [-T STAT_PERIOD_MAX_AGE]
                  [-wp WIKI_PASSWORD] [-wu WIKI_USERNAME] [-b]
                  [-rs RECAPTCHA_SECRET] [-md MAX_DOC_PIPES] [-C CONFIG]
                  [-ak API_KEYS]
                  pairs_path

Apertium APY -- API server for machine translation and language analysis

positional arguments:
  pairs_path            path to Apertium installed pairs (all modes files in
                        this path are included)

options:
  -h, --help            show this help message and exit
  -s NONPAIRS_PATH, --nonpairs-path NONPAIRS_PATH
                        path to Apertium tree (only non-translator debug modes
                        are included from this path)
  -l LANG_NAMES, --lang-names LANG_NAMES
                        path to localised language names sqlite database
                        (default = langNames.db)
  -F FASTTEXT_MODEL, --fasttext-model FASTTEXT_MODEL
                        path to fastText language identification model (e.g.
                        lid.release.ftz)
  -f MISSING_FREQS, --missing-freqs MISSING_FREQS
                        path to missing word frequency sqlite database
                        (default = None)
  -p PORT, --port PORT  port to run server on (default = 2737)
  -c SSL_CERT, --ssl-cert SSL_CERT
                        path to SSL Certificate
  -k SSL_KEY, --ssl-key SSL_KEY
                        path to SSL Key File
  -t TIMEOUT, --timeout TIMEOUT
                        timeout for requests (default = 10)
  -j [NUM_PROCESSES], --num-processes [NUM_PROCESSES]
                        number of processes to run (default = 1; use 0 to run
                        one http server per core, where each http server runs
                        all available language pairs)
  -d, --daemon          daemon mode: redirects stdout and stderr to files
                        apertium-apy.log and apertium-apy.err; use with --log-
                        path
  -P LOG_PATH, --log-path LOG_PATH
                        path to log output files to in daemon mode; defaults
                        to local directory
  -i MAX_PIPES_PER_PAIR, --max-pipes-per-pair MAX_PIPES_PER_PAIR
                        how many pipelines we can spin up per language pair
                        (default = 1)
  -n MIN_PIPES_PER_PAIR, --min-pipes-per-pair MIN_PIPES_PER_PAIR
                        when shutting down pipelines, keep at least this many
                        open per language pair (default = 0)
  -u MAX_USERS_PER_PIPE, --max-users-per-pipe MAX_USERS_PER_PIPE
                        how many concurrent requests per pipeline before we
                        consider spinning up a new one (default = 5)
  -m MAX_IDLE_SECS, --max-idle-secs MAX_IDLE_SECS
                        if specified, shut down pipelines that have not been
                        used in this many seconds
  -r RESTART_PIPE_AFTER, --restart-pipe-after RESTART_PIPE_AFTER
                        restart a pipeline if it has had this many requests
                        (default = 1000)
  -v VERBOSITY, --verbosity VERBOSITY
                        logging verbosity
  -V, --version         show APY version
  -S, --scalemt-logs    generates ScaleMT-like logs; use with --log-path;
                        disables
  -M UNKNOWN_MEMORY_LIMIT, --unknown-memory-limit UNKNOWN_MEMORY_LIMIT
                        keeps unknown words in memory until a limit is
                        reached; use with --missing-freqs (default = 1000)
  -T STAT_PERIOD_MAX_AGE, --stat-period-max-age STAT_PERIOD_MAX_AGE
                        How many seconds back to keep track request timing
                        stats (default = 3600)
  -wp WIKI_PASSWORD, --wiki-password WIKI_PASSWORD
                        Apertium Wiki account password for SuggestionHandler
  -wu WIKI_USERNAME, --wiki-username WIKI_USERNAME
                        Apertium Wiki account username for SuggestionHandler
  -b, --bypass-token    ReCAPTCHA bypass token
  -rs RECAPTCHA_SECRET, --recaptcha-secret RECAPTCHA_SECRET
                        ReCAPTCHA secret for suggestion validation
  -md MAX_DOC_PIPES, --max-doc-pipes MAX_DOC_PIPES
                        how many concurrent document translation pipelines we
                        allow (default = 3)
  -C CONFIG, --config CONFIG
                        Configuration file to load options from
  -ak API_KEYS, --api-keys API_KEYS
                        Configuration file to load API keys

Contributing

APy uses GitHub Actions for continuous integration. Locally, use make test to run the same checks it does. After installing Pipenv, run pipenv install --dev to install the requirements required for development, e.g. linters.

Owner

  • Name: Apertium
  • Login: apertium
  • Kind: organization
  • Email: apertium-contact@lists.sourceforge.net

Free/open-source platform for developing rule-based machine translation systems and language technology

GitHub Events

Total
  • Create event: 10
  • Release event: 1
  • Watch event: 4
  • Delete event: 17
  • Member event: 1
  • Issue comment event: 6
  • Push event: 26
  • Pull request review event: 1
  • Pull request review comment event: 1
  • Pull request event: 13
  • Fork event: 4
Last Year
  • Create event: 10
  • Release event: 1
  • Watch event: 4
  • Delete event: 17
  • Member event: 1
  • Issue comment event: 6
  • Push event: 26
  • Pull request review event: 1
  • Pull request review comment event: 1
  • Pull request event: 13
  • Fork event: 4

Committers

Last synced: 8 months ago

All Time
  • Total Commits: 742
  • Total Committers: 36
  • Avg Commits per committer: 20.611
  • Development Distribution Score (DDS): 0.67
Past Year
  • Commits: 25
  • Committers: 9
  • Avg Commits per committer: 2.778
  • Development Distribution Score (DDS): 0.72
Top Committers
Name Email Commits
Sushain Cherivirala s****n@s****e 245
Kevin Brubeck Unhammer u****r@f****g 232
Jonathan Washington j****n@g****m 101
Xavi Ivars x****s@g****m 50
dependabot[bot] 4****] 19
Tino Didriksen m****l@t****m 18
ericye16 e****6@7****0 15
Shardul Chiplunkar s****r@g****m 9
E e****i@e****t 6
Robin Richtsfeld r****d@g****m 6
Francis Tyers f****s 5
Marc Riera Irigoyen m****n@g****m 4
Hèctor Alòs i Font h****s@g****m 3
Joonas Kylmälä j****a@g****m 2
Alexandros Kosiaris a****s@g****m 2
Alina Vykliuk 1****k 2
Anthony J. Bentley a****y@a****e 2
Sai Vineet s****9@g****m 2
ryanachi 3****i 2
wolfgangth w****h@w****e 1
milanandreew 4****w 1
jdmasa 4****a 1
Marc Riera m****c@m****t 1
Milan Andreew M****w@g****m 1
gkkulik g****k@o****l 1
selimcan s****n@7****0 1
Simon Narang s****2@g****m 1
Ng Wei En w****2 1
Monish Godhia m****7@g****m 1
Marc Riera M****a 1
and 6 more...
Committer Domains (Top 20 + Academic)

Issues and Pull Requests

Last synced: 8 months ago

All Time
  • Total issues: 43
  • Total pull requests: 94
  • Average time to close issues: about 1 year
  • Average time to close pull requests: 2 months
  • Total issue authors: 13
  • Total pull request authors: 24
  • Average comments per issue: 2.79
  • Average comments per pull request: 2.37
  • Merged pull requests: 58
  • Bot issues: 0
  • Bot pull requests: 31
Past Year
  • Issues: 0
  • Pull requests: 16
  • Average time to close issues: N/A
  • Average time to close pull requests: 24 days
  • Issue authors: 0
  • Pull request authors: 5
  • Average comments per issue: 0
  • Average comments per pull request: 0.88
  • Merged pull requests: 8
  • Bot issues: 0
  • Bot pull requests: 9
Top Authors
Issue Authors
  • unhammer (11)
  • jonorthwash (10)
  • sushain97 (5)
  • TinoDidriksen (4)
  • ftyers (3)
  • MarcRiera (2)
  • Ryu945 (2)
  • alrevuelta (1)
  • ayushjainrksh (1)
  • mpescadorsantirso (1)
  • Juanpabl (1)
  • kartikm (1)
  • ghost (1)
  • danielwalo (1)
Pull Request Authors
  • dependabot[bot] (43)
  • sushain97 (17)
  • xavivars (8)
  • unhammer (6)
  • vykliuk (6)
  • hectoralos (5)
  • MarcRiera (4)
  • ayushjainrksh (4)
  • gopalM-3 (2)
  • jdmasa (2)
  • share-with-me (2)
  • chribjel (2)
  • satti-hari-krishna-reddy (2)
  • Axle7XStriker (1)
  • JamesKainer (1)
Top Labels
Issue Labels
enhancement (15) bug (10) help wanted (5) question (4) good first issue (2)
Pull Request Labels
dependencies (43) python (7)

Packages

  • Total packages: 1
  • Total downloads:
    • pypi 130 last-month
  • Total dependent packages: 0
  • Total dependent repositories: 1
  • Total versions: 13
  • Total maintainers: 3
pypi.org: apertium-apy

Apertium Web Service

  • Versions: 13
  • Dependent Packages: 0
  • Dependent Repositories: 1
  • Downloads: 130 Last month
Rankings
Forks count: 6.4%
Dependent packages count: 10.1%
Stargazers count: 11.8%
Average: 12.9%
Downloads: 14.7%
Dependent repos count: 21.5%
Maintainers (3)
Last synced: 6 months ago

Dependencies

Pipfile pypi
  • coverage * develop
  • coveralls * develop
  • flake8 * develop
  • flake8-commas * develop
  • flake8-quotes * develop
  • mypy * develop
  • pep8-naming * develop
  • twine * develop
  • types-chardet * develop
  • types-requests * develop
  • apertium-streamparser *
  • chardet *
  • commentjson *
  • lxml *
  • requests *
  • tornado ==6.0.3
Pipfile.lock pypi
  • bleach ==5.0.1 develop
  • certifi ==2022.6.15 develop
  • cffi ==1.15.1 develop
  • charset-normalizer ==2.0.12 develop
  • colorama ==0.4.5 develop
  • coverage ==6.2 develop
  • coveralls ==3.3.1 develop
  • cryptography ==37.0.4 develop
  • docopt ==0.6.2 develop
  • docutils ==0.19 develop
  • flake8 ==4.0.1 develop
  • flake8-commas ==2.1.0 develop
  • flake8-polyfill ==1.0.2 develop
  • flake8-quotes ==3.3.1 develop
  • idna ==3.3 develop
  • importlib-metadata ==4.12.0 develop
  • jeepney ==0.8.0 develop
  • keyring ==23.6.0 develop
  • mccabe ==0.6.1 develop
  • mypy ==0.930 develop
  • mypy-extensions ==0.4.3 develop
  • pep8-naming ==0.12.1 develop
  • pkginfo ==1.8.3 develop
  • pycodestyle ==2.8.0 develop
  • pycparser ==2.21 develop
  • pyflakes ==2.4.0 develop
  • pygments ==2.12.0 develop
  • readme-renderer ==35.0 develop
  • requests ==2.26.0 develop
  • requests-toolbelt ==0.9.1 develop
  • rfc3986 ==2.0.0 develop
  • secretstorage ==3.3.2 develop
  • six ==1.16.0 develop
  • tomli ==2.0.1 develop
  • tqdm ==4.64.0 develop
  • twine ==3.7.1 develop
  • types-chardet ==4.0.2 develop
  • types-requests ==2.26.3 develop
  • typing-extensions ==4.3.0 develop
  • urllib3 ==1.26.9 develop
  • webencodings ==0.5.1 develop
  • zipp ==3.8.0 develop
  • apertium-streamparser ==5.0.2
  • certifi ==2022.6.15
  • chardet ==4.0.0
  • charset-normalizer ==2.0.12
  • commentjson ==0.9.0
  • idna ==3.3
  • lark-parser ==0.7.8
  • lxml ==4.9.1
  • requests ==2.26.0
  • tornado ==6.0.3
  • urllib3 ==1.26.9
setup.py pypi
  • tornado >=4.2,<7
.github/workflows/build-push-container.yml actions
  • actions/checkout v2 composite
  • docker/build-push-action v2 composite
  • docker/login-action v1 composite
  • docker/setup-buildx-action v1 composite
.github/workflows/main.yml actions
  • actions/cache v2 composite
  • actions/checkout v2 composite
Dockerfile docker
  • ghcr.io/apertium/base latest build