Package: pypolona
pypolonaPyPolonais a free and open-source GUI (graphical) app that allows you to search in and download images from thePolona.pldigital library. It also works as appolonaCLI (command-line) tool. And it’s a Python package available fromPyPI. The source is onGithub.Polona.plprovides 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:search Polonaprint or save the search results as a list of URLs, a YAML file, a JSON file and a simple list of Polona document IDsdownload all or some high-resolution images from Polona for the search results, or for a provided list of Polona document IDsThe PyPolona GUI version is made from the command-line version, and uses the same settings as theppolonatool.Remember: torun the GUI on macOS for the first time,Ctrl+clickthe DMG, chooseOpen, thenOpen, then drag to Applications folder, thereCtrl+clickthe app icon, chooseOpen, thenOpen.What’s newCurrent version is1.6.0.1.6.0unless you specify--no-text-pdf, PyPolona now downloads an additional PDF that has searchable text if it’s available--skipis now--no-overwriteimproved PDF metadata import, bugfixes1.5.0-isaves each downloaded document as subfolder with images, otherwise as one PDF (with metadata)--skipinstead of--overwriteflag1.0.0initial releaseInstall standalone PyPolona appDownload DMG for macOSOnmacOS,Ctrl+clickthe downloaded DMG, chooseOpen, thenOpenagain, then drag the icon to the/Applicationsfolder.When yourun the app for the first time,Ctrl+clickthe Polona.app, chooseOpen, then clickOpen. Later, you can just double-click the icon. If the app does not run, double-click again.Download ZIP for WindowsOnWindows, unzip the downloaded ZIP, double-click thesetup_pypolona.exeicon to install the app. You need 64-bit Windows.Install pypolona Python package on macOS or WindowsIf you have Python 3.8+, you can install the Python version withpython3 -m pip install pypolona.Using the graphical PyPolona app (GUI)If you installed the standalone app on macOS,Ctrl-click/Applications/PyPolona.appand chooseOpen, then chooseOpen. You can just double-click the next time to run it.If you installed the standalone app on Windows, runPyPolonafrom your start menu.If you installed the Python version, runppolonaorpython3 -m pypolonaSearch settingsIn the Input tab:Inquery, you can paste one or more URLs from Polona.pl (space-separated).InChoose Oneyou can change what thequeryfield means:if nothing is selected, the query is interpreted as one or more URLs from Polona.plsearch: choose this and in thequeryfield, enter a simple search query likeadam mickiewicz; go to theOptionstab to customizeadvanced: you can use the advanced query syntax, seedocumentation; go to theOptionstab to customizeids: Polona uses IDs for documents, you can just paste a list of space-separated IDs if you already know themIn theOptionstab:InSpace-separated languages, you can enter a space-separated list of languages like Polona uses them, e.g.polski niemiecki angielski. Use the sidebar on thePolonawebsite to find them.InSort search, you can sort the results by score, date, title or creator, in ascending or descending order.InOutput search results in format, you can choose a format in which search results will be output. If you choose ids, you clickRestartand then paste them back into the query field. Choose urls to get clickable links.InSave search results, you can optionally save the search results into the file.Download settingsTurn onDownload found docsto download the content of the queried result.Turn onDownload JPEGs into subfoldersto download each document content as a series of JPEGs. In the download folder, one subfolder will be created per document. The subfolder name starts with the publication year, then part of the title, then the ID. If you are also downloading searchable PDFs, an additional PDF with the_textsuffix will be saved in the subfolder. Also, a YAML file with some metadata will be saved in the subfolder.Turn offDownload JPEGs into subfoldersto download each document content as one PDF. The app will not create subfolders. The PDF name starts with the publication year, then part of the title, then the ID. If you are also downloading searchable PDFs, an additional PDF with the_textsuffix will be also saved.In theOptionstab:InSave downloaded docs in this folder, you can choose into which folder the app will download the documents. By default it uses thepolonasubfolder on your desktop.InDownload max pages, you can limit the maximum number of pages that the app downloads for each document. This is useful for test downloads, since some documents may have hundreds or pages.For some documents, Polona has an extra lower-resolution searchable PDF. By default, that PDF is also downloaded, and saved with a_textsuffix. Turn onSkip downloading searchable PDFsto not download these additional PDFs.By default, the app will re-download and overwrite previously downloaded documents. Turn onSkip existing subfolders/PDFsto skip them.ButtonsClickStartto start the search or download.ClickCancelto close the app.If you’ve started and the search or download has finished, you can:clickRestartto start the search or download with the same settingsclickEditto go back to change the settings, so you can start another search or download.If the download is running, you can clickStopto interrupt it.Using the CLINote: the CLI isppolona, notpypolonaIf you installed the standalone DMG on macOS, use the CLI via/Applications/PyPolona.app/Contents/MacOS/ppolona -hIf you installed the Python version, runppolona -horpython3 -m pypolona -hCommand-line options: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/PDFsMore about PolonaThePolonais a bit overcomplicated to use, but fortunately, Polona publishes aJSON API. The pypolona package uses that API.Polona— the main Polona websitePolona/API— the JSON API that pypolona usesPolona/blog— the blogPolona/typo— a cool minisite that lets you typeset a word and renders it with letters from random publicationsDevelopmentThis project usesGooey. With Gooey, I could rapidly turn the Python command-line app which uses theargparsemodule into a simple GUI app. This project serves as a good example in how this can be done.This project usesPyInstallerto build the standalone app.Building on macOSTo build the Python package, the Mac DMG and the Win EXE (via Wine):./macdeploy prep && ./macdeploy buildBuilding on WindowsInstall Python 3.8 fromPython.org(not the Windows Store!)InstallInno Setuppip3 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 /QLicense and CopyrightCopyright © 2020 Adam Twardoch. Licensed under the terms of theMIT license. This project is not affiliated with and not endorsed by Polona.<script async defer src="https://buttons.github.io/buttons.js"></script>