Skip to main content

Download Psyfar and convert to EPUB

A command line tool and library to download Psyfar and convert to EPUB

Introduction

Psyfar is a Dutch magazine for continuing medical education for psychiatrists.

This package provides a Python libary and command line tool for convenient downloading of the online contents.

Installation

If you have Python on your system you can do the usual:

$ pip install psyfar-downloader

Quickstart

Command line usage examples

List all issues in the current year. For listing only, no authentication is required.

$ psyfar-downloader -l

List all issues in the years 2002, 2004, 2006, 2007, and 2008:

$ psyfar-downloader -l -y 2002 2004 2006-2008

Download the latest issue to the default download-directory. For downloading, a username and password is required for authentication.

$ psyfar-downloader -u username -p password -d

Download the issues with the IDs 2022-4 and 2022-5 to the ~/Downloads download-directory. An ID is composed of the year and number of the issue.

$ psyfar-downloader -u username -p password -d -i 2022-4 2022-5 -w ~/Downloads

Email the latest issue:

$ psyfar-downloader -e -u username -p password --smtp_host smtp.example.com --smtp_port 587 --smtp_username user@example.com --smtp_password <password> --sender user@example.com --recipient info@example.com

Show command line help::

$ psyfar-downloader -h

Configuration File

The configuration file config.ini can change the default values for command line options. It should be written using a standard INI style. The keys should be grouped into sections. For now, the name of the sections are ignored. The section name appears on a line by itself, in square brackets ([ and ]). Configuration files may include comments, prefixed by # or ;. Comments may appear on their own on an otherwise empty line, possibly indented.

Location

The config.ini configuration file should be put in the default config directory. This location is different on different operating systems. A custom configuration file can be provided with the --config argument.

  • Linux: $HOME/.config/psyfar-downloader/config.ini, which respects the XDG_CONFIG_HOME environment variable.

  • MacOS: $HOME/Library/Application Support/psyfar-downloader/config.ini

  • Windows: %APPDATA%\psyfar-downloader\config.ini

Precedence / Override order

Command line options override the values in a configuration file.

Example config.ini

; This is a comment
# This is another comment
[settings]  ; a section marker is required in INI files
verbose = True
download_dir = /home/folkert/Downloads
username = <username>  ; username for authentication with https://www.psyfar.nl/
password = <password>  ; password
smtp_host = smtp.example.com  ; host name or ip address of the SMTP server
smtp_port = 587  ; port of the SMTP server
smtp_username = user@example.com  ; accountname, username, or email address of your email account for authentication
smtp_password = <password>  ; password of your email account for authentication.
sender = user@example.com
recipient = info@example.com

Download

When an issue is downloaded, it is copied to the default download directory. This location is different on different operating systems. A custom download directory can be provided with the --download_dir argument.

Location

  • macOS: ~/Library/Application Support/psyfar-downloader

  • Windows: %APPDATA%\psyfar-downloader

  • Linux (and other Unices): ~/.local/share/psyfar-downloader

Email

You can send an automated email message with the downloaded Epub as an attachment, for example to send it to your Kindle. To use this feature, the --email argument should be provided to the command line tool, along with the required arguments: --smtp_host, --smtp_port, --smtp_username, --smtp_password, --sender, and --recipient. This option presumes the --download argument.

Please note that if you use 2-step-verification in a Gmail-account, you might need an App Password (see https://support.google.com/accounts/answer/185833)

Changelog

[0.1.1] - 2022-08-01

  • Fix arguments
  • Correct Windows default download directory in README
  • Fix handling of subject and body arguments

[0.1.0] - 2022-03-01

  • First release on PyPI.

Author

Metadata

Release files for psyfar-downloader 0.1.1

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for psyfar-downloader 0.1.1
File Size Uploaded
psyfar-downloader-0.1.1.tar.gz 12.3 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for psyfar-downloader 0.1.1
File Interpreter ABI Platform
psyfar_downloader-0.1.1-py3-none-any.whl Python 3 none any Details

Total release size: 23.4 kB

Release files / psyfar-downloader-0.1.1.tar.gz

Download URL psyfar-downloader-0.1.1.tar.gz
Size 12.3 kB
Tags Source
SHA-256 checksum
How to use checksums
30fe03c44935fa512678b88b0c7aca6b4d06366a3bb163e79b35ad2e6434d4b5
BLAKE2b-256 checksum
How to use checksums
24ef025e75de3d6e2f6efb52bf7c0a5df5d81bbdda8e23d1aa68c3834e931163
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/3.8.0 pkginfo/1.8.2 readme-renderer/32.0 requests/2.27.1 requests-toolbelt/0.9.1 urllib3/1.26.8 tqdm/4.62.3 importlib-metadata/4.11.1 keyring/23.5.0 rfc3986/2.0.0 colorama/0.4.4 CPython/3.9.2

Release files / psyfar_downloader-0.1.1-py3-none-any.whl

Download URL psyfar_downloader-0.1.1-py3-none-any.whl
Size 11.1 kB
Tags Python 3
SHA-256 checksum
How to use checksums
61c6bf6e3fff13e64835b76cfc3a3dc8efd2590e323023e42ec38cbb34be667f
BLAKE2b-256 checksum
How to use checksums
c431fc1db318bea8ae47449bcc2d292580a48db86fcaf3edad6a972c3d5f9216
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/3.8.0 pkginfo/1.8.2 readme-renderer/32.0 requests/2.27.1 requests-toolbelt/0.9.1 urllib3/1.26.8 tqdm/4.62.3 importlib-metadata/4.11.1 keyring/23.5.0 rfc3986/2.0.0 colorama/0.4.4 CPython/3.9.2

Release history Release notifications | RSS feed

This release

0.1.1 This release

2 release files

0.1.0

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page