Skip to content
This repository has been archived by the owner on Feb 6, 2022. It is now read-only.

vsimakhin/logbook

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

11 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Logbook CLI

This is a command line tool for mainly exporting logbook records from Google Spreadsheet or local XLSX file to PDF file in EASA format. It also supports rendering a map with a visited airports and routes.

Setting up

Google Spreadsheet Logbook

Currently the tool supports only one format of the Logbook, which you will need to copy to your google account (File -> Make a copy) and share as a read-only (Anyone on the internet with this link can view).

The spreadsheet supports some total calculations, but you can remove these lines. The main important lines are started from #13

You can add your flights in the reverse (the most recent flight is in the top) or straight (the most recent flight is at the end) modes

Google API key

You will need to create an API key to allow the tool to fetch the data from the spreadsheet. The manual is here https://support.google.com/googleapi/answer/6158862?hl=en

Local Excel XLSX file

Copy the logbook.xlsx and set the filename location in the configuration file

First run

  1. Download the latest version from the releases
  2. During the first run there will be created a config file ($HOME/.logbook.json)
{
  "type": "",
  "file_name": "",
  "api_key": "",
  "owner": "Loogbook Owner",
  "page_brakes": "",
  "reverse": "true",
  "spreadsheet_id": "",
  "start_row": 20
}
  1. Open the file with a text editor and update the parameters
  • type - should be google or xlsx
  • file_name - excel filename in case the parameter type is xlsx. Can be just logbook.xlsx or a full path to the file /path/to/the/file/logbook.xlsx
  • api_key - the google API key in case the parameter type is google
  • owner - your Name, which will be written in the logbook footer
  • page_brakes - in case you'd like to divide the logbook to several ones add the page numbers. For example, for every 50 pages "page_brakes": "50,50,50"
  • reverse - should be "true" or "false", depends how you add records to the spreadsheet
  • spreadsheet_id - ID of your copied spreadsheet. You can see it in the browser URL: https://docs.google.com/spreadsheets/d/SPREADSHEET_ID/edit?usp=sharing. In case you use xlsx you can skip it.
  • start_row - the first row in the spreadsheet with a flight data. In the example spreadsheet it's a #16
  1. You can test the tool simply running it from the command line: ./logbook export. You should see a meesage like Loogbook has been exported to logbook.pdf and the pdf file in the directory

Supported commands

Export

./logbook export

It will get the data from the logbook and create a PDF logbook in EASA format

Logbook page example

Render map

In case you'd like to create a map with a visited airports and flown routes you can use the command ./logbook render-map

Renders map with visited airports

Usage:
  logbook render-map [flags]

Flags:
  -d, --filter-date DATE   Set filter for the DATE logbook field for map rendering
  -h, --help               help for render-map
      --no-routes          Skip rendering routes on the map

Examples

Create a map with visited airports for the all records

./logbook render-map --no-routes

Visited Airports only

Create a map with flights for the October 2021

./logbook render-map --filter-date "10/2021"

Filtered Map

TODO

  • add show-stats command with total times and some other numbers
  • add goreleaser