Skip to content

Commit

Permalink
Merge pull request #36 from chinapandaman/PPF-29
Browse files Browse the repository at this point in the history
PPF-29: update README with test procedures
  • Loading branch information
chinapandaman authored Oct 31, 2020
2 parents abe0adc + 653a3bf commit c4d852c
Show file tree
Hide file tree
Showing 2 changed files with 31 additions and 9 deletions.
37 changes: 30 additions & 7 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,17 +7,17 @@ drawing image and merging multiple PDFs together.

## Installing

Install using [pip](https://pip.pypa.io/en/stable/quickstart/):
Install using [pip](https://pip.pypa.io/en/stable/quickstart/):

`````commandline
pip install -U PyPDFForm
`````
```commandline
pip install PyPDFForm
```

## Quick Example

You can find a sample PDF form from [here](https://github.com/chinapandaman/PyPDFForm/blob/master/pdf_samples/sample_template.pdf). Download it and try:
A sample PDF form can be found [here](https://github.com/chinapandaman/PyPDFForm/blob/master/pdf_samples/sample_template.pdf). Download it and try:

````python
```python
import os

from PyPDFForm import PyPDFForm
Expand Down Expand Up @@ -45,11 +45,34 @@ with open(PATH_TO_DOWNLOADED_SAMPLE_PDF_FORM, "rb+") as template:

with open(PATH_TO_FILLED_PDF_FORM, "wb+") as output:
output.write(filled_pdf.stream)
````
```

After running the above code snippet you can find `output.pdf` at the location you specified
and it should look like [this](https://github.com/chinapandaman/PyPDFForm/blob/master/pdf_samples/sample_filled_font_20.pdf).

## Documentation

(WIP)

## Tests

PyPDFForm utilizes [pytest](https://docs.pytest.org/en/stable/) for unit and
functional tests. Tests can be run by first installing dependencies using
[pip](https://pip.pypa.io/en/stable/quickstart/):

```commandline
pip install -r requirements.txt
```

In order to run tests, source root needs to be added to PYTHONPATH by running
the following command at project root:

```shell script
export PYTHONPATH=$PYTHONPATH:$(pwd)/PyPDFForm
```

From there run tests using:

```commandline
pytest
```
3 changes: 1 addition & 2 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,7 @@

setuptools.setup(
name="PyPDFForm",
version="0.0.6",
author="Jinge Li",
version="0.0.7",
description="python library for PDF forms",
long_description=long_description,
long_description_content_type="text/markdown",
Expand Down

0 comments on commit c4d852c

Please sign in to comment.