Skip to content

Commit

Permalink
Update docs
Browse files Browse the repository at this point in the history
  • Loading branch information
cj-wong committed Apr 29, 2020
1 parent 16c377f commit a728a60
Show file tree
Hide file tree
Showing 3 changed files with 31 additions and 11 deletions.
34 changes: 26 additions & 8 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,36 +3,54 @@ All notable changes to this project will be documented in this file.

The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/).

## [1.2.0] - 2020-04-29 UNRELEASED
### Changed
- The project has been renamed to *Caltab* for brevity: a tab (spreadsheet) with calendar entries' durations.
- Renamed `process.py` to [main.py](main.py).
- Moved all module-level code in [main.py](main.py) into separate function `main()`.
- Moved all *Google API* related modules into new directory [google](google).
- Changed return value of `api_handler.authorize()` to the credentials.
- Improved README; rewrote to clarify vocabulary and detailed steps for setup.
- [Configuration](config.yaml.example) has been simplified; to maintain separation, neither calendars nor sheets/tabs are nested in the other. Now, it's possible for two calendars to have the same event/sheet to track.
- In the [API handler](google/api_handler.py), `ExpiredCredentialsError` is now `ExpiredCredentials` and subclasses `RuntimeError` instead of an extraneous custom `Error`.
- In [google.calendar](google/calendar.py):
- `Calendar.get_entries()` had its arguments reversed to match the dictionary's structure (`{calendar name: calendar id}`).
- `get_tab()` no longer needs the second argument as `config.TABS` now contains the names and aliases. Furthermore, instead of returning `None`, the function either returns a string (matched tab name) or raises `TabNotFound` - handled with a try-except in `Calendar.get_entries()`.
- In [google.sheets](google/sheets.py):
- `col_to_day()` and `day_to_col()` combined to form `get_yesterday_cell()`.
- `Sheets.get_ids()` was removed, as it wasn't used.
- Moved some functionality of `Sheets.input_hours()` into `Sheets.get_tab_cells()` to refactor. `Sheets.input_hours()` calls the new function to make up for lost functionality.

## [1.1.3] - 2019-12-25
### Changed
- Use `RotatingFileHandler` for logs

## [1.1.2] - 2019-11-20
### Changed
- Changed `len(update)` to more sensible `update['updatedCells']` in [`gsheets.py`](gsheets.py)
- Changed `len(update)` to more sensible `update['updatedCells']` in `gsheets.py`

### Fixed
- Fixed issue with missing `YESTERDAY` reference in [`gsheets.py`](gsheets.py)
- Fixed issue with missing `YESTERDAY` reference in `gsheets.py`

## [1.1.1] - 2019-11-05
### Changed
- Change stream logger error level to `INFO`

### Fixed
- Use `name` instead of `entry` when checking aliases in [`gcalendar.py`](gcalendar.py)
- Use `name` instead of `entry` when checking aliases in `gcalendar.py`

## [1.1] - 2019-10-12
## [1.1.0] - 2019-10-12
### Added
- [`config.py`](config.py) handles configuration shared between all the modules.
- [`api_handler.py`](api_handler.py) handles the *Google API* credentials and directly calls [`gcalendar.py`](gcalendar.py) & [`gsheets.py`](gsheets.py)
- [`gcalendar.py`](gcalendar.py) & [`gsheets.py`](gsheets.py) handle their respective *Google API* modules.
- `api_handler.py` handles the *Google API* credentials and directly calls `gcalendar.py` & `gsheets.py`
- `gcalendar.py` & `gsheets.py` handle their respective *Google API* modules.

### Changed
- [`process.py`](process.py) was broken into the three new modules, for modularity.
- `process.py` was broken into the three new modules, for modularity.
- Furthermore, the Apache License *Google LLC*-licensed code was moved to [`config.py`](config.py)
- Instead of calling `sys.exit`, a new exception `api_handler.ExpiredCredentialsError` is raised.
- Several functions were simplified in name, because `gsheets.Sheets.get_sheet_ids` is redundant compared to `gsheets.Sheets.get_ids`.

## [1.0] - 2019-09-26
## [1.0.0] - 2019-09-26
### Added
- Initial version
4 changes: 2 additions & 2 deletions NOTICE
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
Calendar-to-Sheets
Copyright 2019 cj-wong
Caltab
Copyright 2019-2020 cj-wong

G Suite Python Samples
Copyright 2018 Google LLC
Expand Down
4 changes: 3 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@

Want to record event duration from your *[Google Calendar][GCAL]* calendar into a *[Google Sheets][GSHEETS]* spreadsheet? This project has you covered: it automates the process for you! Each tracked event can be recorded into a spreadsheet containing a sheet with the same name. Aliases can be added per event as necessary.

Although you can run the project manually, I highly recommend using an automation system like `cron` and running once a day at a specific time.

## Requirements

This code is designed around the following:
Expand Down Expand Up @@ -62,7 +64,7 @@ Each event in the configuration must belong only to one calendar and must only b
3. For each sheet/tab you plan to use with calendar tracking, copy the template starting with the name up til `month:`. Follow the below instructions.

- List each tab under `tabs:` with aliases and other attributes. **Note that each tabs must correspond to the `tabs:` under at least one calendar entry in `calendars:`.**
- Record the starting cell (top-left cell) location into `cell:` under `start:`. In the example below, it's `cell: B2`.
- Record the starting cell (top-left cell) location into `cell:` under `start:`. In the example below, it's `cell: B2`. **This column value (e.g. the *B* in *B2*) cannot be *AA* or beyond.**
- Also under `start:`, record which year (`year:`) and month (`month:`) that row corresponds to the cell. In the example below, it's `year: 2019` and `month: 1`.

### Sheets Structure
Expand Down

0 comments on commit a728a60

Please sign in to comment.