Tools for using article data in Python
- Python >=3.5
- libxml2 (Ubuntu, Arch)
Install via pip:
$ pip install elifetools
You might need to install libxml manually first
$ sudo STATIC_DEPS=true pip install lxml==3.4.1
To install the latest version directly from git
$ pip install git+https://github.com/elifesciences/elife-tools.git@master
or you can add it to your project's requirements.txt file
git+https://github.com/elifesciences/elife-tools.git@master
Clone the git repo
Make a virtualenv (optional)
Then
$ python setup.py install
>>> from elifetools import parseJATS as parser
>>> soup = parser.parse_document('tests/sample-xml/elife-kitchen-sink.xml')
>>> print(parser.doi(soup))
More code examples can be found in tests/basic_usage_test.py
You can run the full automated test suite from the base folder with:
$ python -m unittest discover tests
or you can run tests with coverage:
$ coverage run -m unittest discover tests
and then view the coverage report:
$ coverage report -m