Skip to main content

A library for accessing the ACL Anthology

Project description

acl-anthology-py

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

This package accesses data from the ACL Anthology.

API documentation can already be generated locally (see below for instructions), more documentation (included a web-hosted version) is coming.

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 usage examples:

paper = anthology.get("C92-1025")

print(str(paper.title))
# Two-Level Morphology with Composition

print([author.name for author in paper.authors])
# [Name(first='Lauri', last='Karttunen'), Name(first='Ronald M.', last='Kaplan'), Name(first='Annie', last='Zaenen')]

from acl_anthology.people import Name
print(anthology.people.get_by_name(Name("Lauri", "Karttunen")))
# [Person(id='lauri-karttunen', names=[Name(first='Lauri', last='Karttunen')],
#         item_ids={('C94', '2', '206'), ('W05', '12', '6'), ('C69', '70', '1'),
#                   ('J83', '2', '5'), ('C86', '1', '16'), ('C92', '1', '25'), ...})]

Developing

This package uses Python 3.10+ with the Poetry packaging system.

Cloning the repository and running make will install all dependencies via Poetry, run all style and type checks, run all tests, and generate the documentation.

Install dependencies and pre-commit hooks

make setup will install all package dependencies in development mode, as well as install the pre-commit hooks that run on every attempted git commit.

If you only want the dependencies, but not the hooks, run make dependencies.

Running checks

make check will run black, ruff, and some other pre-commit hooks, as well as the mypy type checker on all files in the repo.

Running tests

make test will run Python unit tests and integration tests.

Running benchmarks

The benchmarks/ folder collects some benchmarks intended to be run with the richbench tool:

poetry run richbench benchmarks/

Generating and writing documentation

  • make docs (to generate in site/)
  • make docs-serve (to serve locally)

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

Uploaded Source

Built Distribution

acl_anthology_py-0.4.1-py3-none-any.whl (119.6 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: acl_anthology_py-0.4.1.tar.gz
  • Upload date:
  • Size: 97.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.5.0 CPython/3.11.5 Linux/6.5.6-200.fc38.x86_64

File hashes

Hashes for acl_anthology_py-0.4.1.tar.gz
Algorithm Hash digest
SHA256 cb291dfd8f5d543727ca3bd014f83b220a0d8cce93809b75fc98e90e72ca172e
MD5 a18fd06d7538593cbe3f355508cb6de1
BLAKE2b-256 aa6339fbf4ec7420bf6e60fc1feedb9cfe2f5ae6b8d3bb4bb69fed2e359c9e26

See more details on using hashes here.

File details

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

File metadata

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

File hashes

Hashes for acl_anthology_py-0.4.1-py3-none-any.whl
Algorithm Hash digest
SHA256 a7a5f9cecfa47fe7677f3aab680359d0b3eae34da4af6f0e36d7caf048f30e85
MD5 45a6621c4fca1e5dec6d07139650a72c
BLAKE2b-256 dbcbf4b31716df9939f70b7da9debbc4324093c2bfe2c375e4696facdb3ead73

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