Skip to main content

A library for accessing the ACL Anthology

Project description

acl-anthology-py

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-py

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_py-0.4.3.tar.gz (102.8 kB view details)

Uploaded Source

Built Distribution

acl_anthology_py-0.4.3-py3-none-any.whl (125.6 kB view details)

Uploaded Python 3

File details

Details for the file acl_anthology_py-0.4.3.tar.gz.

File metadata

  • Download URL: acl_anthology_py-0.4.3.tar.gz
  • Upload date:
  • Size: 102.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.5.0 CPython/3.11.6 Linux/6.5.7-200.fc38.x86_64

File hashes

Hashes for acl_anthology_py-0.4.3.tar.gz
Algorithm Hash digest
SHA256 5da8fc8f86ec79b50572c0ecf1e755f99f2da2db95ec0f149cbeda43fe344bcd
MD5 ab558ccbf21966fb36d24384fc441a5e
BLAKE2b-256 da1d262508f56c96b902708b277803ee521a6a4ebe1ac0e62137f8fdfdb66822

See more details on using hashes here.

File details

Details for the file acl_anthology_py-0.4.3-py3-none-any.whl.

File metadata

  • Download URL: acl_anthology_py-0.4.3-py3-none-any.whl
  • Upload date:
  • Size: 125.6 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.5.0 CPython/3.11.6 Linux/6.5.7-200.fc38.x86_64

File hashes

Hashes for acl_anthology_py-0.4.3-py3-none-any.whl
Algorithm Hash digest
SHA256 aba358c2cf75ef206aca8fbaca699a6f2da91717761b43d3f8f98aa3721f3ea4
MD5 14bab18d1680397f2461202a9b40544f
BLAKE2b-256 d95e9f9c2b597ef5572a14a5b1a3b0a4bcd2b89252fc724fee27bff5622f9398

See more details on using hashes here.

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