Skip to main content

A library for accessing the ACL Anthology

Project description

acl-anthology

License Build Status Documentation Code Coverage Supported Python Versions Development Status Package on PyPI

This package accesses data from the ACL Anthology.

How to use

Install via pip:

$ pip install acl-anthology

Instantiate the library, automatically fetching data files from the ACL Anthology repo (requires git to be installed on your system):

from acl_anthology import Anthology
anthology = Anthology.from_repo()

Some brief usage examples:

>>> paper = anthology.get("C92-1025")
>>> str(paper.title)
Two-Level Morphology with Composition
>>> [author.name for author in paper.authors]
[
    Name(first='Lauri', last='Karttunen'),
    Name(first='Ronald M.', last='Kaplan'),
    Name(first='Annie', last='Zaenen')
]
>>> anthology.find_people("Karttunen, Lauri")
[
    Person(
        id='lauri-karttunen', names=[Name(first='Lauri', last='Karttunen')],
        item_ids=<set of 30 AnthologyIDTuple objects>, comment=None
    )
]

Find more examples and details on the API in the official documentation.

Developing

This package uses the Poetry packaging system. Development is easiest with the just command runner; running just -l will list all available recipes, while just -n <recipe> will print the commands that the recipe would run.

Running checks, pre-commit hooks, and tests

  • just check will run black, ruff, mypy, and some other pre-commit hooks on all files in the repo.

    • just install-hooks will install pre-commit hooks so they run on every attempted commit.
  • just test-all will run all tests except for tests that run on the full Anthology data.

    • just test NAME will only run test functions with NAME in them.
    • just test-integration will run tests on the full Anthology data.
  • just fix-and-test (or just ft for short) will run all checks and tests, additionally re-running the checks on failure, so that the checking and testing will continue even if some hooks have modified files.

  • The justfile defines several more useful recipes; list them with just -l!

Running benchmarks

There are some benchmark scripts intended to be run with richbench:

poetry run richbench benchmarks/

Generating and writing documentation

  • just docs generates the documentation in the site/ folder.
  • just docs-serve serves the documentation for local browsing.

Docstrings are written in Google style as this supports the most features with the mkdocstrings handler (particularly compared to Sphinx/reST).

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

acl_anthology-0.5.2.tar.gz (116.1 kB view details)

Uploaded Source

Built Distribution

acl_anthology-0.5.2-py3-none-any.whl (145.7 kB view details)

Uploaded Python 3

File details

Details for the file acl_anthology-0.5.2.tar.gz.

File metadata

  • Download URL: acl_anthology-0.5.2.tar.gz
  • Upload date:
  • Size: 116.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/2.0.1 CPython/3.13.3 Linux/6.14.5-200.fc41.x86_64

File hashes

Hashes for acl_anthology-0.5.2.tar.gz
Algorithm Hash digest
SHA256 9bcdfa87129d07e2c3b973e6f27398db094f816cda72048671cc6c9de0b13783
MD5 50fb9b509dafa8f4da07f4a0a85710cf
BLAKE2b-256 ab8548810f71973120174599a0e2f4b6b5e90d6d8dbd4c4e1f7b2d61aad69651

See more details on using hashes here.

File details

Details for the file acl_anthology-0.5.2-py3-none-any.whl.

File metadata

  • Download URL: acl_anthology-0.5.2-py3-none-any.whl
  • Upload date:
  • Size: 145.7 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/2.0.1 CPython/3.13.3 Linux/6.14.5-200.fc41.x86_64

File hashes

Hashes for acl_anthology-0.5.2-py3-none-any.whl
Algorithm Hash digest
SHA256 bec3698303339e46644a263abebf34ef3b70369d679df9104edda9ec2df921d1
MD5 a49caadc64d772ce833d4f0f620172a3
BLAKE2b-256 332847672c3b3de9b0ea904b87e7d6d0f8da5dfa786f65e07aba9a2b7222cc87

See more details on using hashes here.

Supported by

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