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

This package accesses data from the ACL Anthology.

:warning: This package is still work in progress. :warning:

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

Clone the ACL Anthology repo to obtain the data files (there will be an option to automate this step in a future version):

$ git clone https://github.com/acl-org/acl-anthology

Afterwards, the library can be instantiated as follows:

from acl_anthology import Anthology

# "datadir" needs to point to the "data/" folder of the acl-anthology repo
anthology = Anthology(datadir="acl-anthology/data")

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

Uploaded Source

Built Distribution

acl_anthology_py-0.2.0-py3-none-any.whl (100.1 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: acl_anthology_py-0.2.0.tar.gz
  • Upload date:
  • Size: 85.4 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.5.1 CPython/3.11.4 Linux/6.2.9-200.fc37.x86_64

File hashes

Hashes for acl_anthology_py-0.2.0.tar.gz
Algorithm Hash digest
SHA256 83f63c69f152110de6786e96a8e1de7ea3b957a053110dd6a6b75c5e31d181d7
MD5 08fe4b7a7e513aaf2e9b2806f1fd8ff8
BLAKE2b-256 ef9507b380898fa17a0aac164f04f590d030a406ecbac670bc06b01873564334

See more details on using hashes here.

File details

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

File metadata

  • Download URL: acl_anthology_py-0.2.0-py3-none-any.whl
  • Upload date:
  • Size: 100.1 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.5.1 CPython/3.11.4 Linux/6.2.9-200.fc37.x86_64

File hashes

Hashes for acl_anthology_py-0.2.0-py3-none-any.whl
Algorithm Hash digest
SHA256 2c59df33760c3e3cc6ed7847da841abd1d72b3cc48d8f1b881456bdbc20add67
MD5 a89d7acc47688abc557a6af5dd01ba7d
BLAKE2b-256 076b8c9fe166028bc3c4b4e00c8bd06a777d60288d9d387b3d5a767f030fdaf9

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