aboutsummaryrefslogtreecommitdiffstats
path: root/README.md
blob: c82cd7a72cd72d192e9f8a35e11d326b7a4677d6 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
# icaltool - extract events from ical/vcal files.

`icaltool` is a simple tool to extract events mathching a pattern from standard calendar files.

It started out as a tool for myself to count the number of vacation days I had used from an ownCloud calendar. Since ownCloud didn't have the functionality, I downloaded the ics file, and wrote this tool to extract it myself. Hopefully it can be useful to others as well.

## Usage

    icaltool <calendar.ics> <pattern>

The pattern is a regular expression, optionally prefixed by the ical fields to match against and a colon. If the optional field name is left out, the regex is matched against all fields.

## Examples

Find any event with 'vacation' somewhere in it's summary field:

    icaltool calendar.ics summary:vacation

Find all events in 2018 starting on the 14th of the month

    icaltool calendar.ics dtstart:2018\\d{2}14

Find any event which mentions icaltool in any field:

    icaltool calendar.ics icaltool

## Limitations

* Queries against more than one key is not supported at this time.
* Timezones or other parameters are not taken into consideration.
* The output format is not configurable, except by changing the code and recompiling it.

The heavy lifting of parsing the ics files is done by the [ical crate](https://docs.rs/crate/ical).

## Contributing

If you do find this tool useful, and have suggestions or even patches that will improve it, please [let me know](mailto:haraldei@anduin.net).

`icaltool` is licensed as [GPLv3](https://www.gnu.org/licenses/gpl.txt), see the file LICENSE for the details.