package-poa
Generate, transform and assemble files for a PoA article.
This library is used to transform a zip file input to produce output consisting of a reformatted zip file and to help produce a PDF file with its coverage page removed.
The transform procedure in summary follows these steps:
- get an article DOI from the
manifest.xmlfile inside the input zip file - get the zip's list of files and their titles, also by reading the
manifest.xml - rename files and add them into a new zip file, not including the PDF or the
manifest.xml - coordinate removing the cover page from the PDF file by relying on an external executable to modify the PDF
The PDF cover page is removed with the code in https://github.com/elifesciences/strip-coverletter
The output files generated by this library can then be accompanied with a Publish on Accept (PoA) research article JATS XML file, and all together can be bundled up and sent to journal publishing ingestion workflow.
Requirements and install
a) Install from pypi package index
pip install packagepoa
b) Install locally
Clone the git repo
git clone https://github.com/elifesciences/package-poa.git
Create a python virtual environment and activate it
python3 -m venv venv
source venv/bin/activate
Install it locally
pip install -r requirements.txt
python setup.py install
In order to run the transform function as written, it will require strip-coverletter to be installed and ready to run locally, which will also require Docker to be installed and running.
Configuration
The packagepoa.cfg configuration file provided in this repository can be changed in order specify different output file naming, depending on the journal, and to configure the temporary folder path and the location of the PDF strip coverletter executable.
Example usage
This library is meant to be integrated into another operational system, where the input zip file can be downloaded from an S3 bucket and then processed. The following example illustrates how it might be invoked using interactive Python:
>>> from packagepoa import transform
>>> from packagepoa.conf import raw_config, parse_raw_config
>>> config = parse_raw_config(raw_config('elife'))
>>> transform.process_zipfile("tests/test_data/18022_1_supp_mat_highwire_zip_268991_x75s4v.zip", config)
Run code tests
Use pytest for testing, install it if missing:
pip install pytest
Run tests
pytest
Run tests with coverage
coverage run -m pytest
then report on code coverage
converage report -m
License
Licensed under MIT.
Metadata
Release files for packagepoa 0.3.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| packagepoa-0.3.0.tar.gz | 9.6 kB | Without provenance | Details for packagepoa-0.3.0.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| packagepoa-0.3.0-py3-none-any.whl | Python 3 | none | any | Details for packagepoa-0.3.0-py3-none-any.whl |
Total release size: 17.4 kB
Release files / packagepoa-0.3.0.tar.gz
| Download URL | packagepoa-0.3.0.tar.gz |
|---|---|
| Size | 9.6 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
541568f6f6d9852f3b228ba6b235475a9a78d047dbb5142bccfd28243d63876b
|
|
BLAKE2b-256 checksum How to use checksums |
3228ddf38629717197e41b667dbca1409bbfb16ea1db066c96074897d4392345
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/4.0.2 CPython/3.8.10
|
Release files / packagepoa-0.3.0-py3-none-any.whl
| Download URL | packagepoa-0.3.0-py3-none-any.whl |
|---|---|
| Size | 7.7 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
2b68e59d96443cfe678537700b449be1b3197445a15ab38241c049fb3f29ad65
|
|
BLAKE2b-256 checksum How to use checksums |
b32fcd0873f957e505b2be48407039e85f6946e1991b725940dd9ee8ad2bf4e3
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/4.0.2 CPython/3.8.10
|
Security for packagepoa 0.3.0
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.