diff options
author | Harald Eilertsen <haraldei@anduin.net> | 2025-01-04 16:06:13 +0100 |
---|---|---|
committer | Harald Eilertsen <haraldei@anduin.net> | 2025-01-04 16:06:13 +0100 |
commit | 428ca98515847830f0c550886ef10ddb04711fb6 (patch) | |
tree | f3c4e22b8971e8503393b4b18453cc9be9309b35 | |
parent | ac2217e09bed93516818500b6e7285774213672b (diff) | |
download | icaltool-main.tar.gz icaltool-main.tar.bz2 icaltool-main.zip |
-rw-r--r-- | README.md | 28 |
1 files changed, 20 insertions, 8 deletions
@@ -1,22 +1,34 @@ -# icaltool - simple tool for getting info from ical/ics files. +# icaltool - extract events from ical/vcal files. -`icaltool` 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. +`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 -Currently `icaltool`is extremely primitive, it takes exactly two arguments, the file to parse and the pattern to look for. The pattern consist of a key in an event, followed by a colon, and followed by a regex to match against the value of the key. like this: + 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: - # find any event with 'vacation' somewhere in it's summary fiel icaltool calendar.ics summary:vacation -The pattern is case insensitive, and supports most perl-like regexes. +Find all events in 2018 starting on the 14th of the month - # 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. Neither does the tool take timezones or other parameters into consideration. The output format is not configurable, except by changing the code and recompiling it. And there's no helpful error messages or usage info. The code calls `unwrap` everywhere, so most likely you'll just get some cryptic internal error from Rust. +* 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). @@ -24,4 +36,4 @@ The heavy lifting of parsing the ics files is done by the [ical crate](https://d 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.
\ No newline at end of file +`icaltool` is licensed as [GPLv3](https://www.gnu.org/licenses/gpl.txt), see the file LICENSE for the details. |