pypolona

Logo

Search the Polona.pl website of the Polish National Library and download all images from publications

View the Project on GitHub twardoch/pypolona

pypolona

PyPolona is a free and open-source GUI (graphical) app that allows you to search in and download images from the Polona.pl digital library. It also works as a ppolona CLI (command-line) tool. And it’s a Python package available from PyPI. The source is on Github.

Polona.pl provides digitized books, magazines, graphics, maps, music, fliers and manuscripts from collections of the National Library of Poland and co-operating institutions.

With PyPolona, you can:

The PyPolona GUI version is made from the command-line version, and uses the same settings as the ppolona tool.

Remember: to run the GUI on macOS for the first time, Ctrl+click the DMG, choose Open, then Open, then drag to Applications folder, there Ctrl+click the app icon, choose Open, then Open.

What’s new

Current version is 1.6.2.

1.6.2

1.6.0

1.5.0

1.0.0

Install standalone PyPolona app

Download DMG for macOS

On macOS, Ctrl+click the downloaded DMG, choose Open, then Open again, then drag the icon to the /Applications folder.

When you run the app for the first time, Ctrl+click the Polona.app, choose Open, then click Open. Later, you can just double-click the icon. If the app does not run, double-click again.

Download ZIP for Windows

On Windows, unzip the downloaded ZIP, double-click the setup_pypolona.exe icon to install the app. You need 64-bit Windows.

Install pypolona Python package on macOS or Windows

If you have Python 3.8+, you can install the Python version with python3 -m pip install pypolona.

Using the graphical PyPolona app (GUI)

Search settings

Input tab

In the Input tab:

In query, you can paste one or more URLs from Polona.pl (space-separated).

Search in input

In Choose One you can change what the query field means:

In the Options tab:

Download settings

Turn on Download found docs to download the content of the queried result.

In the Options tab:

Options

Buttons

Result

Using the CLI

Note: the CLI is ppolona, not pypolona

usage: ppolona [-h] [-S | -A | -I] [-D] [-i] [-l [language [language ...]]] [-s {score desc,date desc,date asc,title asc,creator asc}]
               [-f {ids,urls,yaml,json}] [-o results_file] [-d download_folder] [-M num_pages] [-T] [-O]
               query [query ...]

Search in and download from Polona.pl. GUI: Help › PyPolona 1.6.0 Help. CLI: ppolona -h

optional arguments:
  -h, --help            show this help message and exit

Input:
  query                 query is a Polona.pl URL unless you choose search, advanced or ids
  -S, --search          Query is search query, see Options
  -A, --advanced        Query is advanced search query, see Documentation
  -I, --ids             Query is space-separated IDs
  -D, --download        Download found docs, see Options
  -i, --images          Download JPEGs into subfolders instead of PDF

Options:
  -l [language [language ...]], --lang [language [language ...]]
                        Space-separated languages: polski angielski niemiecki...
  -s {score desc,date desc,date asc,title asc,creator asc}, --sort {score desc,date desc,date asc,title asc,creator asc}
                        Sort search results by score, date, title or creator (descending or ascending)
  -f {ids,urls,yaml,json}, --format {ids,urls,yaml,json}
                        Output search results in format
  -o results_file, --output results_file
                        Save search results to this file
  -d download_folder, --download-dir download_folder
                        Save downloaded docs in this folder
  -M num_pages, --max-pages num_pages
                        Download max pages per doc (0: all)
  -T, --no-text-pdf     Skip downloading searchable PDFs
  -O, --no-overwrite    Skip existing subfolders/PDFs

More about Polona

The Polona is a bit overcomplicated to use, but fortunately, Polona publishes a JSON API. The pypolona package uses that API.

Development

Building on macOS

To build the Python package, the Mac DMG and the Win EXE (via Wine):

./macdeploy prep && ./macdeploy build

Building on Windows

  1. Install Python 3.8 from Python.org (not the Windows Store!)
  2. Install Inno Setup
pip3 install --user --upgrade .[dev]
python -m PyInstaller --distpath="app/build/dist-win" --workpath="app/build" -y "app/pyinstaller-win.spec"
"C:\Program Files (x86)\Inno Setup 6\ISCC.exe" /dMyAppVersion="1.1.7" app/pypolona.iss /Q

Copyright © 2020 Adam Twardoch. Licensed under the terms of the MIT license. This project is not affiliated with and not endorsed by Polona.