Skip to content

Commit

Permalink
fix: validate first page and last page
Browse files Browse the repository at this point in the history
Additional tests for first page and last page.
Linter changes.
Improved contribution docs.
Change to dev status beta.

Move to v0.6.2.
  • Loading branch information
cofiem committed Jul 22, 2023
1 parent f8af932 commit fbf948d
Show file tree
Hide file tree
Showing 26 changed files with 5,508 additions and 4,128 deletions.
2 changes: 1 addition & 1 deletion .idea/watcherTasks.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

9 changes: 9 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,14 @@
# Change log

## [v0.6.2](https://github.com/anotherbyte-net/leaf-focus/releases/tag/v0.6.2)

[full change log](https://github.com/anotherbyte-net/leaf-focus/compare/v0.6.1...v0.6.2)

- Validate first page and last page
- Additional tests for first page and last page
- Linter changes
- Improved contribution docs

## [v0.6.1](https://github.com/anotherbyte-net/leaf-focus/releases/tag/v0.6.1)

[full change log](https://github.com/anotherbyte-net/leaf-focus/compare/v0.6.0...v0.6.1)
Expand Down
47 changes: 41 additions & 6 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,12 +11,14 @@ python -m venv .venv
Install runtime dependencies and development dependencies:

```bash
# Windows
.venv\Scripts\activate.ps1
# Windows MINGW64
source .venv/Scripts/activate

# Linux
source .venv/bin/activate

# Any

# install dependencies
python -m pip install --upgrade pip setuptools wheel
python -m pip install --upgrade -r requirements-dev.txt -r requirements.txt
Expand All @@ -35,8 +37,30 @@ If the pip dependencies have changed, it might be necessary to
To run using all available python versions:

```bash
export TEST_INCLUDE_SLOW=true
# Windows
python install_xpdf.py \
--download-dir=.xpdf/download \
--install-dir=.xpdf/install \
--gpg-key-url=https://www.xpdfreader.com/gpg-key.txt \
--file-sig-url=https://dl.xpdfreader.com/xpdf-tools-win-4.04.zip.sig \
--file-comp-url=https://dl.xpdfreader.com/xpdf-tools-win-4.04.zip

# Windows
export TEST_XPDF_EXE_DIR=.xpdf/install/xpdf-tools-win-4.04/bin64

# Linux
python install_xpdf.py \
--download-dir=.xpdf/download \
--install-dir=.xpdf/install \
--gpg-key-url=https://www.xpdfreader.com/gpg-key.txt \
--file-sig-url=https://dl.xpdfreader.com/xpdf-tools-linux-4.04.tar.gz.sig \
--file-comp-url=https://dl.xpdfreader.com/xpdf-tools-linux-4.04.tar.gz

# Linux
export TEST_XPDF_EXE_DIR=.xpdf/install/xpdf-tools-linux-4.04/bin64

# Any
export TEST_INCLUDE_SLOW=true
python -X dev -m tox
```

Expand Down Expand Up @@ -79,16 +103,18 @@ When uploading:

Go to the [test project page](https://test.pypi.org/project/leaf-focus) and check that it looks ok.

Then create a new virtual environment, install the dependencies, and install from Test PyPI.
Then create a new virtual environment, install the dependencies from the main PyPI, and install from Test PyPI.
Make sure to install the dependencies from the main PyPI, as the packages on Test PyPI are not the same.

```bash
deactivate
rm -rf .venv-test
python -m venv .venv-test
source .venv-test/bin/activate
python -m pip install --upgrade pip setuptools wheel
python -m pip install --upgrade -r requirements.txt

LEAF_FOCUS_VERSION='0.6.1'
export LEAF_FOCUS_VERSION='0.6.2'
pip install --index-url https://test.pypi.org/simple/ --no-deps leaf-focus==$LEAF_FOCUS_VERSION
# or
pip install dist/leaf_focus-$LEAF_FOCUS_VERSION-py3-none-any.whl
Expand All @@ -99,7 +125,16 @@ Test the installed package.
```bash
leaf-focus --version
leaf-focus --help
leaf-focus tests/resources/example1/452.06-win10-win8-win7-release-notes.pdf .pypi-test/ --ocr --exe-dir [path-to-xpdf-exe-dir]

# Windows
leaf-focus tests/resources/example1/452.06-win10-win8-win7-release-notes.pdf \
.pypi-test/ --ocr \
--exe-dir .xpdf/install/xpdf-tools-win-4.04/bin64

# Linux
leaf-focus tests/resources/example1/452.06-win10-win8-win7-release-notes.pdf \
.pypi-test/ --ocr \
--exe-dir .xpdf/install/xpdf-tools-linux-4.04/bin64
```

If the package seems to work as expected, upload it to the live PyPI.
Expand Down
2 changes: 1 addition & 1 deletion VERSION
Original file line number Diff line number Diff line change
@@ -1 +1 @@
0.6.1
0.6.2
19 changes: 15 additions & 4 deletions docs/leaf_focus.html
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<meta name="generator" content="pdoc 13.1.1"/>
<meta name="generator" content="pdoc 14.0.0"/>
<title>leaf_focus API documentation</title>

<style>/*! * Bootstrap Reboot v5.0.0 (https://getbootstrap.com/) * Copyright 2011-2021 The Bootstrap Authors * Copyright 2011-2021 Twitter, Inc. * Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE) * Forked from Normalize.css, licensed MIT (https://github.com/necolas/normalize.css/blob/master/LICENSE.md) */*,::after,::before{box-sizing:border-box}@media (prefers-reduced-motion:no-preference){:root{scroll-behavior:smooth}}body{margin:0;font-family:system-ui,-apple-system,"Segoe UI",Roboto,"Helvetica Neue",Arial,"Noto Sans","Liberation Sans",sans-serif,"Apple Color Emoji","Segoe UI Emoji","Segoe UI Symbol","Noto Color Emoji";font-size:1rem;font-weight:400;line-height:1.5;color:#212529;background-color:#fff;-webkit-text-size-adjust:100%;-webkit-tap-highlight-color:transparent}hr{margin:1rem 0;color:inherit;background-color:currentColor;border:0;opacity:.25}hr:not([size]){height:1px}h1,h2,h3,h4,h5,h6{margin-top:0;margin-bottom:.5rem;font-weight:500;line-height:1.2}h1{font-size:calc(1.375rem + 1.5vw)}@media (min-width:1200px){h1{font-size:2.5rem}}h2{font-size:calc(1.325rem + .9vw)}@media (min-width:1200px){h2{font-size:2rem}}h3{font-size:calc(1.3rem + .6vw)}@media (min-width:1200px){h3{font-size:1.75rem}}h4{font-size:calc(1.275rem + .3vw)}@media (min-width:1200px){h4{font-size:1.5rem}}h5{font-size:1.25rem}h6{font-size:1rem}p{margin-top:0;margin-bottom:1rem}abbr[data-bs-original-title],abbr[title]{-webkit-text-decoration:underline dotted;text-decoration:underline dotted;cursor:help;-webkit-text-decoration-skip-ink:none;text-decoration-skip-ink:none}address{margin-bottom:1rem;font-style:normal;line-height:inherit}ol,ul{padding-left:2rem}dl,ol,ul{margin-top:0;margin-bottom:1rem}ol ol,ol ul,ul ol,ul ul{margin-bottom:0}dt{font-weight:700}dd{margin-bottom:.5rem;margin-left:0}blockquote{margin:0 0 1rem}b,strong{font-weight:bolder}small{font-size:.875em}mark{padding:.2em;background-color:#fcf8e3}sub,sup{position:relative;font-size:.75em;line-height:0;vertical-align:baseline}sub{bottom:-.25em}sup{top:-.5em}a{color:#0d6efd;text-decoration:underline}a:hover{color:#0a58ca}a:not([href]):not([class]),a:not([href]):not([class]):hover{color:inherit;text-decoration:none}code,kbd,pre,samp{font-family:SFMono-Regular,Menlo,Monaco,Consolas,"Liberation Mono","Courier New",monospace;font-size:1em;direction:ltr;unicode-bidi:bidi-override}pre{display:block;margin-top:0;margin-bottom:1rem;overflow:auto;font-size:.875em}pre code{font-size:inherit;color:inherit;word-break:normal}code{font-size:.875em;color:#d63384;word-wrap:break-word}a>code{color:inherit}kbd{padding:.2rem .4rem;font-size:.875em;color:#fff;background-color:#212529;border-radius:.2rem}kbd kbd{padding:0;font-size:1em;font-weight:700}figure{margin:0 0 1rem}img,svg{vertical-align:middle}table{caption-side:bottom;border-collapse:collapse}caption{padding-top:.5rem;padding-bottom:.5rem;color:#6c757d;text-align:left}th{text-align:inherit;text-align:-webkit-match-parent}tbody,td,tfoot,th,thead,tr{border-color:inherit;border-style:solid;border-width:0}label{display:inline-block}button{border-radius:0}button:focus:not(:focus-visible){outline:0}button,input,optgroup,select,textarea{margin:0;font-family:inherit;font-size:inherit;line-height:inherit}button,select{text-transform:none}[role=button]{cursor:pointer}select{word-wrap:normal}select:disabled{opacity:1}[list]::-webkit-calendar-picker-indicator{display:none}[type=button],[type=reset],[type=submit],button{-webkit-appearance:button}[type=button]:not(:disabled),[type=reset]:not(:disabled),[type=submit]:not(:disabled),button:not(:disabled){cursor:pointer}::-moz-focus-inner{padding:0;border-style:none}textarea{resize:vertical}fieldset{min-width:0;padding:0;margin:0;border:0}legend{float:left;width:100%;padding:0;margin-bottom:.5rem;font-size:calc(1.275rem + .3vw);line-height:inherit}@media (min-width:1200px){legend{font-size:1.5rem}}legend+*{clear:left}::-webkit-datetime-edit-day-field,::-webkit-datetime-edit-fields-wrapper,::-webkit-datetime-edit-hour-field,::-webkit-datetime-edit-minute,::-webkit-datetime-edit-month-field,::-webkit-datetime-edit-text,::-webkit-datetime-edit-year-field{padding:0}::-webkit-inner-spin-button{height:auto}[type=search]{outline-offset:-2px;-webkit-appearance:textfield}::-webkit-search-decoration{-webkit-appearance:none}::-webkit-color-swatch-wrapper{padding:0}::file-selector-button{font:inherit}::-webkit-file-upload-button{font:inherit;-webkit-appearance:button}output{display:inline-block}iframe{border:0}summary{display:list-item;cursor:pointer}progress{vertical-align:baseline}[hidden]{display:none!important}</style>
Expand Down Expand Up @@ -31,6 +31,7 @@ <h2>Contents</h2>
</ul></li>
<li><a href="#change-log">Change log</a>
<ul>
<li><a href="#v062httpsgithubcomanotherbyte-netleaf-focusreleasestagv062"><a href="https://github.com/anotherbyte-net/leaf-focus/releases/tag/v0.6.2">v0.6.2</a></a></li>
<li><a href="#v061httpsgithubcomanotherbyte-netleaf-focusreleasestagv061"><a href="https://github.com/anotherbyte-net/leaf-focus/releases/tag/v0.6.1">v0.6.1</a></a></li>
<li><a href="#v060httpsgithubcomanotherbyte-netleaf-focusreleasestagv060"><a href="https://github.com/anotherbyte-net/leaf-focus/releases/tag/v0.6.0">v0.6.0</a></a></li>
<li><a href="#v053httpsgithubcomanotherbyte-netleaf-focusreleasestagv053"><a href="https://github.com/anotherbyte-net/leaf-focus/releases/tag/v0.5.3">v0.5.3</a></a></li>
Expand Down Expand Up @@ -77,7 +78,7 @@ <h2 id="install">Install</h2>
<p>Install from PyPI using pip:</p>

<div class="pdoc-code codehilite">
<pre><span></span><code>pip install leaf-focus
<pre><span></span><code>pip<span class="w"> </span>install<span class="w"> </span>leaf-focus
</code></pre>
</div>

Expand Down Expand Up @@ -121,10 +122,10 @@ <h3 id="examples">Examples</h3>

<div class="pdoc-code codehilite">
<pre><span></span><code><span class="c1"># Extract the pdf information and embedded text.</span>
leaf-focus --exe-dir <span class="o">[</span>path-to-xpdf-exe-dir<span class="o">]</span> file.pdf file-pages
leaf-focus<span class="w"> </span>--exe-dir<span class="w"> </span><span class="o">[</span>path-to-xpdf-exe-dir<span class="o">]</span><span class="w"> </span>file.pdf<span class="w"> </span>file-pages

<span class="c1"># Extract the pdf information, embedded text, an image of each page, and Optical Character Recognition results of each page.</span>
leaf-focus --exe-dir <span class="o">[</span>path-to-xpdf-exe-dir<span class="o">]</span> file.pdf file-pages --ocr
leaf-focus<span class="w"> </span>--exe-dir<span class="w"> </span><span class="o">[</span>path-to-xpdf-exe-dir<span class="o">]</span><span class="w"> </span>file.pdf<span class="w"> </span>file-pages<span class="w"> </span>--ocr
</code></pre>
</div>

Expand All @@ -138,6 +139,16 @@ <h2 id="dependencies">Dependencies</h2>

<h1 id="change-log">Change log</h1>

<h2 id="v062httpsgithubcomanotherbyte-netleaf-focusreleasestagv062"><a href="https://github.com/anotherbyte-net/leaf-focus/releases/tag/v0.6.2">v0.6.2</a></h2>

<p><a href="https://github.com/anotherbyte-net/leaf-focus/compare/v0.6.1...v0.6.2">full change log</a></p>

<ul>
<li>Validate first page and last page</li>
<li>Additional tests for first page and last page</li>
<li>Linter changes</li>
</ul>

<h2 id="v061httpsgithubcomanotherbyte-netleaf-focusreleasestagv061"><a href="https://github.com/anotherbyte-net/leaf-focus/releases/tag/v0.6.1">v0.6.1</a></h2>

<p><a href="https://github.com/anotherbyte-net/leaf-focus/compare/v0.6.0...v0.6.1">full change log</a></p>
Expand Down
Loading

0 comments on commit fbf948d

Please sign in to comment.