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.

For end users

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.

For Anthology maintainers

If you want to instantiate the library from a script within the repo, e.g. in order to make modifications to the data and push them to a branch, instantiate the library like this:

anthology = Anthology.from_within_repo()

If you want to quickly check or try out something in a Python REPL, you can invoke just python repl (or simply just repl if you're within the python/ folder) to start a REPL with this anthology object already instantiated.

For developers

This package uses uv for project management. Development is easiest with the just command runner.

Running just -l will list all available recipes in the current directory, while just -n <recipe> will print the commands that the recipe would run.

Given below are example just commands that can be run inside the python/ folder (or with just python from the repository root).

Running checks, pre-commit hooks, and tests

  • just check will run ruff (linter and formatter), 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!

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-1.3.0.tar.gz (146.9 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

acl_anthology-1.3.0-py3-none-any.whl (177.1 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: acl_anthology-1.3.0.tar.gz
  • Upload date:
  • Size: 146.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.11.28 {"installer":{"name":"uv","version":"0.11.28","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Fedora Linux","version":"43","id":"","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}

File hashes

Hashes for acl_anthology-1.3.0.tar.gz
Algorithm Hash digest
SHA256 284655fb4f21211d3fa79739b3e2b5e0d877f10fa09d6728556f5b21db98d3e5
MD5 1b7bbdea9d231f3d26f58481bcdde503
BLAKE2b-256 0a0c63d8d18ad7080a89b5621daade29eea2c09566cb1771a286419b51046c4c

See more details on using hashes here.

File details

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

File metadata

  • Download URL: acl_anthology-1.3.0-py3-none-any.whl
  • Upload date:
  • Size: 177.1 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.11.28 {"installer":{"name":"uv","version":"0.11.28","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Fedora Linux","version":"43","id":"","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}

File hashes

Hashes for acl_anthology-1.3.0-py3-none-any.whl
Algorithm Hash digest
SHA256 cd5fc0cdf1bd056af4c1c88249d2f9c44813ef37703fdf923dc9379ee1f15d1c
MD5 9e66b921ddb1f39cfed72df5d21b7dfd
BLAKE2b-256 4a47dd469f46b7d4c0acdb421da2a8df65b1e5b109a08ce4e3f486e3879d1ce1

See more details on using hashes here.

Supported by

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