ics-query 0.2.0a0__tar.gz → 0.3.0b0__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (49) hide show
  1. {ics_query-0.2.0a0 → ics_query-0.3.0b0}/.github/ISSUE_TEMPLATE/bug_report.md +2 -8
  2. {ics_query-0.2.0a0 → ics_query-0.3.0b0}/PKG-INFO +159 -51
  3. {ics_query-0.2.0a0 → ics_query-0.3.0b0}/README.md +155 -48
  4. {ics_query-0.2.0a0 → ics_query-0.3.0b0}/ics_query/__init__.py +3 -2
  5. {ics_query-0.2.0a0 → ics_query-0.3.0b0}/ics_query/_version.py +2 -2
  6. {ics_query-0.2.0a0 → ics_query-0.3.0b0}/ics_query/cli.py +191 -23
  7. ics_query-0.3.0b0/ics_query/query.py +54 -0
  8. ics_query-0.3.0b0/ics_query/tests/runs/all --tz Singapore one-event.ics -.run +9 -0
  9. ics_query-0.3.0b0/ics_query/tests/runs/all three-events.ics -.run +33 -0
  10. ics_query-0.3.0b0/ics_query/tests/runs/at 2024-08-20 Berlin-Los-Angeles.ics -.run +23 -0
  11. ics_query-0.3.0b0/ics_query/tests/runs/calendars/Berlin-Los-Angeles.ics +381 -0
  12. ics_query-0.3.0b0/ics_query/tests/runs/calendars/simple-journal.ics +15 -0
  13. ics_query-0.3.0b0/ics_query/tests/runs/calendars/simple-todo.ics +15 -0
  14. ics_query-0.3.0b0/ics_query/tests/runs/calendars/three-events.ics +37 -0
  15. ics_query-0.3.0b0/ics_query/tests/runs/first -c VJOURNAL -c VEVENT one-event.ics -.run +9 -0
  16. ics_query-0.3.0b0/ics_query/tests/runs/first -c VJOURNAL simple-journal.ics -.run +12 -0
  17. ics_query-0.3.0b0/ics_query/tests/runs/first -c VTODO -c VJOURNAL simple-todo.ics -.run +10 -0
  18. ics_query-0.3.0b0/ics_query/tests/runs/first -c VTODO simple-todo.ics -.run +10 -0
  19. ics_query-0.3.0b0/ics_query/tests/runs/first empty-file.ics -.run +0 -0
  20. {ics_query-0.2.0a0 → ics_query-0.3.0b0}/ics_query/tests/test_command_line.py +11 -0
  21. {ics_query-0.2.0a0 → ics_query-0.3.0b0}/ics_query/version.py +19 -0
  22. {ics_query-0.2.0a0 → ics_query-0.3.0b0}/pyproject.toml +2 -2
  23. {ics_query-0.2.0a0 → ics_query-0.3.0b0}/.github/FUNDING.yml +0 -0
  24. {ics_query-0.2.0a0 → ics_query-0.3.0b0}/.github/dependabot.yml +0 -0
  25. {ics_query-0.2.0a0 → ics_query-0.3.0b0}/.github/workflows/tests.yml +0 -0
  26. {ics_query-0.2.0a0 → ics_query-0.3.0b0}/.gitignore +0 -0
  27. {ics_query-0.2.0a0 → ics_query-0.3.0b0}/LICENSE +0 -0
  28. {ics_query-0.2.0a0 → ics_query-0.3.0b0}/ics-query +0 -0
  29. {ics_query-0.2.0a0 → ics_query-0.3.0b0}/ics_query/__main__.py +0 -0
  30. {ics_query-0.2.0a0 → ics_query-0.3.0b0}/ics_query/parse.py +0 -0
  31. {ics_query-0.2.0a0 → ics_query-0.3.0b0}/ics_query/tests/__init__.py +0 -0
  32. {ics_query-0.2.0a0 → ics_query-0.3.0b0}/ics_query/tests/conftest.py +0 -0
  33. {ics_query-0.2.0a0 → ics_query-0.3.0b0}/ics_query/tests/runs/at 2019-03-04 multiple-calendars.ics -.run +0 -0
  34. {ics_query-0.2.0a0 → ics_query-0.3.0b0}/ics_query/tests/runs/at 2019-03-04 one-event-twice.ics -.run +0 -0
  35. {ics_query-0.2.0a0 → ics_query-0.3.0b0}/ics_query/tests/runs/at 2019-03-04 one-event.ics -.run +0 -0
  36. {ics_query-0.2.0a0 → ics_query-0.3.0b0}/ics_query/tests/runs/at 2019-03-07 multiple-calendars.ics -.run +0 -0
  37. {ics_query-0.2.0a0 → ics_query-0.3.0b0}/ics_query/tests/runs/between 20240823 4d recurring-work-events.ics -.run +0 -0
  38. {ics_query-0.2.0a0 → ics_query-0.3.0b0}/ics_query/tests/runs/calendars/empty-calendar.ics +0 -0
  39. {ics_query-0.2.0a0 → ics_query-0.3.0b0}/ics_query/tests/runs/calendars/empty-file.ics +0 -0
  40. {ics_query-0.2.0a0 → ics_query-0.3.0b0}/ics_query/tests/runs/calendars/multiple-calendars.ics +0 -0
  41. {ics_query-0.2.0a0 → ics_query-0.3.0b0}/ics_query/tests/runs/calendars/one-event-twice.ics +0 -0
  42. {ics_query-0.2.0a0 → ics_query-0.3.0b0}/ics_query/tests/runs/calendars/one-event.ics +0 -0
  43. {ics_query-0.2.0a0 → ics_query-0.3.0b0}/ics_query/tests/runs/calendars/recurring-work-events.ics +0 -0
  44. /ics_query-0.2.0a0/ics_query/tests/runs/first empty-calendar.ics -.run → /ics_query-0.3.0b0/ics_query/tests/runs/first -c VJOURNAL one-event.ics -.run +0 -0
  45. /ics_query-0.2.0a0/ics_query/tests/runs/first empty-file.ics -.run → /ics_query-0.3.0b0/ics_query/tests/runs/first empty-calendar.ics -.run +0 -0
  46. {ics_query-0.2.0a0 → ics_query-0.3.0b0}/ics_query/tests/runs/first recurring-work-events.ics -.run +0 -0
  47. {ics_query-0.2.0a0 → ics_query-0.3.0b0}/ics_query/tests/test_parse_date.py +0 -0
  48. {ics_query-0.2.0a0 → ics_query-0.3.0b0}/ics_query/tests/test_parse_timedelta.py +0 -0
  49. {ics_query-0.2.0a0 → ics_query-0.3.0b0}/tox.ini +0 -0
@@ -27,15 +27,9 @@ assignees: ''
27
27
 
28
28
  **Version:**
29
29
  <!-- Which Version do you use? -->
30
- v0.0.1
31
30
 
32
- <!-- Sometimes, the problems are in other packages. You can provide an overview
33
- by running this command and passing the output:
34
-
35
- pip list
36
- -->
37
31
  ```shell
38
- pip list
32
+ $ ics-query --version
39
33
  ```
40
34
 
41
35
  ## Additional context
@@ -45,5 +39,5 @@ pip list
45
39
  <!-- If possible, suggest a way of solving this or just let this text down there remain as it is. -->
46
40
 
47
41
  - [ ] add an ICS file in `ics_query/tests/runs/calendars`
48
- - [ ] add a test in `ics_query/tests/runs directory`
42
+ - [ ] add a test in `ics_query/tests/runs`
49
43
  - [ ] fix the bug and ensure the test code passes
@@ -1,10 +1,10 @@
1
1
  Metadata-Version: 2.3
2
2
  Name: ics-query
3
- Version: 0.2.0a0
3
+ Version: 0.3.0b0
4
4
  Summary: Find out what happens in ICS calendar files - query and filter RFC 5545 compatible .ics files for events, journals, TODOs and more.
5
5
  Project-URL: Homepage, https://github.com/niccokunzmann/ics-query/
6
6
  Project-URL: Repository, https://github.com/niccokunzmann/ics-query/
7
- Project-URL: source_archive, https://github.com/niccokunzmann/ics-query/archive/c7eeb503fae7da069308a27a37232be96851c3e5.zip
7
+ Project-URL: source_archive, https://github.com/niccokunzmann/ics-query/archive/8a23bc5bc6e89064a99de1e57afdcd94c180181c.zip
8
8
  Project-URL: Issues, https://github.com/niccokunzmann/ics-query/issues
9
9
  Project-URL: Documentation, https://github.com/niccokunzmann/ics-query/
10
10
  Project-URL: Changelog, https://github.com/niccokunzmann/ics-query/#changelog
@@ -686,7 +686,7 @@ License: GNU GENERAL PUBLIC LICENSE
686
686
  <https://www.gnu.org/licenses/why-not-lgpl.html>.
687
687
  License-File: LICENSE
688
688
  Keywords: calendar,command line,icalendar,ics,rfc5545,scheduling
689
- Classifier: Development Status :: 3 - Alpha
689
+ Classifier: Development Status :: 4 - Beta
690
690
  Classifier: Intended Audience :: Developers
691
691
  Classifier: License :: OSI Approved :: GNU General Public License v3 or later (GPLv3+)
692
692
  Classifier: Operating System :: OS Independent
@@ -699,6 +699,7 @@ Requires-Python: >=3.9
699
699
  Requires-Dist: click
700
700
  Requires-Dist: icalendar
701
701
  Requires-Dist: recurring-ical-events<4,>=3.2.0
702
+ Requires-Dist: x-wr-timezone
702
703
  Provides-Extra: test
703
704
  Requires-Dist: pytest; extra == 'test'
704
705
  Description-Content-Type: text/markdown
@@ -767,15 +768,33 @@ BEGIN:VEVENT
767
768
  ...
768
769
  ```
769
770
 
771
+ #### Piping calendars
772
+
773
+ You can pipe one or more calendars into the input.
774
+
775
+ ```shell
776
+ cat calendar.ics | ics-query first -
777
+ ```
778
+
770
779
  ### Events at Certain Times
771
780
 
772
781
  You can query which events happen at certain times:
773
782
 
774
783
  ```shell
775
- ics-query at <date-time> calendar.ics -
784
+ ics-query at TIME calendar.ics -
776
785
  ```
777
786
 
778
- `<date-time>` can be built up: It can be a year, a month, a day, an hour, a minute or a second.
787
+ The format of TIME:
788
+
789
+ | TIME | description |
790
+ | ------- | ----------- |
791
+ | `2019` | the whole year 2019 |
792
+ | `2019-08` | August 2019 |
793
+ | `2019-08-12` | 12th of August 2019 |
794
+ | `2019-08-12T17` | 17:00-18:00 at the 12th of August 2019 |
795
+ | `2019-08-12T17:20` | 17:20-17:21 at the 12th of August 2019 |
796
+ | `2019-08-12T17:20:00` | 17:20 at the 12th of August 2019 |
797
+
779
798
 
780
799
  Please see the command documentation for more help:
781
800
 
@@ -784,13 +803,31 @@ ics-query at --help
784
803
  ics-query --help
785
804
  ```
786
805
 
806
+ You can get all **events** that happen at a certain **day**.
807
+
808
+ ```shell
809
+ ics-query at --components VEVENT 2029-12-24 calendar.ics
810
+ ```
811
+
812
+ You can get all **events** that happen **today**.
813
+
814
+ ```shell
815
+ ics-query at --components VEVENT `date +%Y-%m-%d` calendar.ics
816
+ ```
817
+
818
+ You can get all **TODO**s that happen at in certain **month**.
819
+
820
+ ```shell
821
+ ics-query at --components VTODO 2029-12-24 calendar.ics
822
+ ```
823
+
787
824
  ### Events within a Time Span
788
825
 
789
826
  You can query which events happen between certain times:
790
827
 
791
828
  ```shell
792
- ics-query between <start> <end> calendar.ics -
793
- ics-query between <start> <duration> calendar.ics -
829
+ ics-query between START END calendar.ics -
830
+ ics-query between START DURATION calendar.ics -
794
831
  ```
795
832
 
796
833
  Please see the command documentation for more help:
@@ -800,100 +837,130 @@ ics-query between --help
800
837
  ics-query --help
801
838
  ```
802
839
 
840
+ The format of START and END with examples:
841
+
842
+ | START or END | Description |
843
+ | ------- | ----------- |
844
+ | `2019` | the whole year 2019 |
845
+ | `2019-08` | August 2019 |
846
+ | `2019-08-12` | 12th of August 2019 |
847
+ | `2019-08-12T17` | 17:00-18:00 at the 12th of August 2019 |
848
+ | `2019-08-12T17:20` | 17:20-17:21 at the 12th of August 2019 |
849
+ | `2019-08-12T17:20:00` | 17:20 at the 12th of August 2019 |
850
+
851
+ Instead of an absolute time, you can specify a duration after the START.
852
+ The `+` is optional.
853
+
854
+ | DURATION | Description |
855
+ | ------- | ----------- |
856
+ | `+1d` | one more day |
857
+ | `+1h` | one more hour |
858
+ | `+1m` | one more minute |
859
+ | `+1s` | one more second |
860
+ | `+3600s` | one more hour or 3600 seconds |
861
+ | `+5d10h` | five more days and 10 more hours |
862
+
803
863
  ### Time Span Examples
804
864
 
805
- This example returns the events within the next week:
865
+ This example returns the occurrences within the **next week**:
806
866
 
807
867
  ```shell
808
868
  ics-query between `date +%Y%m%d` +7d calendar.ics -
809
869
  ```
810
870
 
811
- This example saves the events from the 1st of May 2024 to the 10th of June in
871
+ This example saves the **events** from the **1st of May 2024 to the 10th of June** in
812
872
  events.ics:
813
873
 
814
874
  ```shell
815
- ics-query between 2024-5-1 2024-6-10 calendar.ics events.ics
875
+ ics-query between --component VEVENT 2024-5-1 2024-6-10 calendar.ics events.ics
816
876
  ```
817
877
 
818
- In this example, you can check what is happening on New Years Eve 2025 around
878
+ In this example, you can check what is happening on **New Years Eve 2025** around
819
879
  midnight:
820
880
 
821
881
  ```shell
822
882
  ics-query between 2025-12-31T21:00 +6h calendar.ics events.ics
823
883
  ```
824
884
 
825
- ## Vision
826
-
827
- This section shows where we would like to get to.
828
-
829
- ### `ics-query at` - occurrences at certain times
885
+ ### `ics-query all` - the whole calendar
830
886
 
831
- You can get all **events** that happen at a certain **day**.
887
+ You can get everything that is happening in a calendar but that can be a lot!
832
888
 
833
889
  ```shell
834
- ics-query --components VEVENT at 2029-12-24 calendar.ics
890
+ ics-query all calendar.ics
835
891
  ```
836
892
 
837
- You can get all **events** that happen **today**.
893
+ ### Filtering Components
838
894
 
839
- ```shell
840
- ics-query --components VEVENT at `date +%Y-%m-%d` calendar.ics
841
- ```
895
+ We support different component types: VEVENT, VJOURNAL and VTODO.
896
+ By default, we include all types in the result.
842
897
 
843
- You can get all **TODO**s that happen at in certain **month**.
898
+ You can specify which components you would like to get using the
899
+ `--component` or `-c` parameter.
844
900
 
845
901
  ```shell
846
- ics-query --components VTODO at 2029-12-24 calendar.ics
902
+ -c VEVENT # only events
903
+ -c VTODO # only TODOs
904
+ -c VJOURNAL # only journal entries
905
+ -c VEVENT -v VTODO # only events and journal entries
847
906
  ```
848
907
 
849
- ### `ics-query at` - time ranges
908
+ This example returns the first event of a calendar.
850
909
 
851
- ### `ics-query --output=count` - count occurrences
910
+ ```shell
911
+ ics-query first -c VEVENT calendar.ics -
912
+ ```
852
913
 
853
- ### `ics-query --output=ics` - use ics as output (default)
914
+ This is also available as `ICS_QUERY_COMPONENT` variable.
854
915
 
855
- ### `ics-query --select-index` - reduce output size
916
+ ```shell
917
+ export ICS_QUERY_COMPONENT=VEVENT
918
+ # from now on, you will get only events
919
+ ics-query first calendar.ics
920
+ ```
856
921
 
857
- Examples: `0,2,4` `0-10`
922
+ ### Timezones
858
923
 
859
- ### `ics-query all` - the whole calendar
924
+ You can set the timezone of the query, otherwise the event's local timezone is used and you
925
+ might miss events in your own timezone.
860
926
 
861
- ### `ics-query between` - time ranges
927
+ The first event at New Year 2000 in the **event's local time**:
862
928
 
863
929
  ```shell
864
- ics-query between dt dt
865
- ics-query between dt duration
930
+ ics-query at 2000-01-01 calendar.ics
866
931
  ```
867
932
 
868
- ### `ics-query --select-component` - filter for components
933
+ The first event at New Year 2000 in **your local time**:
869
934
 
870
- ### `ics-query --select-uid` - filter by uid
935
+ ```shell
936
+ ics-query at --tz=localtime 2000-01-01 calendar.ics
937
+ ```
871
938
 
872
- ## How to edit an event
939
+ The first event at New Year 2000 in **UTC**:
873
940
 
874
- To edit a component like an event, you can append it to the calendar and increase the sequence number.
941
+ ```shell
942
+ ics-query at --tz=UTC 2000-01-01 calendar.ics
943
+ ```
875
944
 
876
- Example:
945
+ The first event at New Year 2000 in **Berlin time**:
877
946
 
878
- 1. get the first event `--select-index=0` TODO: recurring-ical-events: set recurrence-id, sequence number
879
- 2. change the summary
880
- 3. increase sequence number
881
- 4. add the event to the end of the calendar file
882
- 5. show that the occurrence has changed
947
+ ```shell
948
+ ics-query at --tz=Europe/Berlin 2000-01-01 calendar.ics
949
+ ```
883
950
 
884
- ## Piping calendars
951
+ You can also use the `ICS_QUERY_TZ` variable.
885
952
 
886
953
  ```shell
887
- cat calendar.ics | ics-query --output=count --filter-component=VEVENT all > calendar-event-count.int
954
+ export ICS_QUERY_TZ=localtime
955
+ # from now on, we use your local time
956
+ ics-query at 2000-01-01 calendar.ics
888
957
  ```
889
958
 
890
- ## Notifications
959
+ For all avaiable timezones see:
891
960
 
892
- Examples:
893
-
894
- - There are x todos in the next hour
895
- - There are x events today
896
- - Please write a journal entry!
961
+ ```shell
962
+ ics-query --available-timezones
963
+ ```
897
964
 
898
965
  ## Version Fixing
899
966
 
@@ -971,6 +1038,15 @@ To release new versions,
971
1038
 
972
1039
  ## Changelog
973
1040
 
1041
+ - v0.3.0b
1042
+
1043
+ - Add `--tz` timezone parameter
1044
+ - Add `ics-query all` to get all occurrences
1045
+
1046
+ - v0.2.1a
1047
+
1048
+ - Add `--component` to filter component types VEVENT, VJOURNAL and VTODO
1049
+
974
1050
  - v0.2.0a
975
1051
 
976
1052
  - Add `ics-query first <calendar> <output>` for earliest occurrences
@@ -994,3 +1070,35 @@ To release new versions,
994
1070
  ## Related Work
995
1071
 
996
1072
  - [icalBuddy](https://hasseg.org/icalBuddy/)
1073
+
1074
+ ## Vision
1075
+
1076
+ This section shows where we would like to get to.
1077
+
1078
+ ### `ics-query --select-index` - reduce output size
1079
+
1080
+ Examples: `0,2,4` `0-10`
1081
+
1082
+
1083
+ ### `ics-query --select-uid` - filter by uid
1084
+
1085
+ ### How to edit an event
1086
+
1087
+ To edit a component like an event, you can append it to the calendar and increase the sequence number.
1088
+
1089
+ Example:
1090
+
1091
+ 1. get the event `--select-index=0`
1092
+ 2. change the summary
1093
+ 3. increase sequence number
1094
+ 4. add the event to the end of the calendar file
1095
+ 5. show that the occurrence has changed
1096
+
1097
+
1098
+ ### Notifications
1099
+
1100
+ Examples:
1101
+
1102
+ - There are x todos in the next hour
1103
+ - There are x events today
1104
+ - Please write a journal entry!
@@ -62,15 +62,33 @@ BEGIN:VEVENT
62
62
  ...
63
63
  ```
64
64
 
65
+ #### Piping calendars
66
+
67
+ You can pipe one or more calendars into the input.
68
+
69
+ ```shell
70
+ cat calendar.ics | ics-query first -
71
+ ```
72
+
65
73
  ### Events at Certain Times
66
74
 
67
75
  You can query which events happen at certain times:
68
76
 
69
77
  ```shell
70
- ics-query at <date-time> calendar.ics -
78
+ ics-query at TIME calendar.ics -
71
79
  ```
72
80
 
73
- `<date-time>` can be built up: It can be a year, a month, a day, an hour, a minute or a second.
81
+ The format of TIME:
82
+
83
+ | TIME | description |
84
+ | ------- | ----------- |
85
+ | `2019` | the whole year 2019 |
86
+ | `2019-08` | August 2019 |
87
+ | `2019-08-12` | 12th of August 2019 |
88
+ | `2019-08-12T17` | 17:00-18:00 at the 12th of August 2019 |
89
+ | `2019-08-12T17:20` | 17:20-17:21 at the 12th of August 2019 |
90
+ | `2019-08-12T17:20:00` | 17:20 at the 12th of August 2019 |
91
+
74
92
 
75
93
  Please see the command documentation for more help:
76
94
 
@@ -79,13 +97,31 @@ ics-query at --help
79
97
  ics-query --help
80
98
  ```
81
99
 
100
+ You can get all **events** that happen at a certain **day**.
101
+
102
+ ```shell
103
+ ics-query at --components VEVENT 2029-12-24 calendar.ics
104
+ ```
105
+
106
+ You can get all **events** that happen **today**.
107
+
108
+ ```shell
109
+ ics-query at --components VEVENT `date +%Y-%m-%d` calendar.ics
110
+ ```
111
+
112
+ You can get all **TODO**s that happen at in certain **month**.
113
+
114
+ ```shell
115
+ ics-query at --components VTODO 2029-12-24 calendar.ics
116
+ ```
117
+
82
118
  ### Events within a Time Span
83
119
 
84
120
  You can query which events happen between certain times:
85
121
 
86
122
  ```shell
87
- ics-query between <start> <end> calendar.ics -
88
- ics-query between <start> <duration> calendar.ics -
123
+ ics-query between START END calendar.ics -
124
+ ics-query between START DURATION calendar.ics -
89
125
  ```
90
126
 
91
127
  Please see the command documentation for more help:
@@ -95,100 +131,130 @@ ics-query between --help
95
131
  ics-query --help
96
132
  ```
97
133
 
134
+ The format of START and END with examples:
135
+
136
+ | START or END | Description |
137
+ | ------- | ----------- |
138
+ | `2019` | the whole year 2019 |
139
+ | `2019-08` | August 2019 |
140
+ | `2019-08-12` | 12th of August 2019 |
141
+ | `2019-08-12T17` | 17:00-18:00 at the 12th of August 2019 |
142
+ | `2019-08-12T17:20` | 17:20-17:21 at the 12th of August 2019 |
143
+ | `2019-08-12T17:20:00` | 17:20 at the 12th of August 2019 |
144
+
145
+ Instead of an absolute time, you can specify a duration after the START.
146
+ The `+` is optional.
147
+
148
+ | DURATION | Description |
149
+ | ------- | ----------- |
150
+ | `+1d` | one more day |
151
+ | `+1h` | one more hour |
152
+ | `+1m` | one more minute |
153
+ | `+1s` | one more second |
154
+ | `+3600s` | one more hour or 3600 seconds |
155
+ | `+5d10h` | five more days and 10 more hours |
156
+
98
157
  ### Time Span Examples
99
158
 
100
- This example returns the events within the next week:
159
+ This example returns the occurrences within the **next week**:
101
160
 
102
161
  ```shell
103
162
  ics-query between `date +%Y%m%d` +7d calendar.ics -
104
163
  ```
105
164
 
106
- This example saves the events from the 1st of May 2024 to the 10th of June in
165
+ This example saves the **events** from the **1st of May 2024 to the 10th of June** in
107
166
  events.ics:
108
167
 
109
168
  ```shell
110
- ics-query between 2024-5-1 2024-6-10 calendar.ics events.ics
169
+ ics-query between --component VEVENT 2024-5-1 2024-6-10 calendar.ics events.ics
111
170
  ```
112
171
 
113
- In this example, you can check what is happening on New Years Eve 2025 around
172
+ In this example, you can check what is happening on **New Years Eve 2025** around
114
173
  midnight:
115
174
 
116
175
  ```shell
117
176
  ics-query between 2025-12-31T21:00 +6h calendar.ics events.ics
118
177
  ```
119
178
 
120
- ## Vision
121
-
122
- This section shows where we would like to get to.
123
-
124
- ### `ics-query at` - occurrences at certain times
179
+ ### `ics-query all` - the whole calendar
125
180
 
126
- You can get all **events** that happen at a certain **day**.
181
+ You can get everything that is happening in a calendar but that can be a lot!
127
182
 
128
183
  ```shell
129
- ics-query --components VEVENT at 2029-12-24 calendar.ics
184
+ ics-query all calendar.ics
130
185
  ```
131
186
 
132
- You can get all **events** that happen **today**.
187
+ ### Filtering Components
133
188
 
134
- ```shell
135
- ics-query --components VEVENT at `date +%Y-%m-%d` calendar.ics
136
- ```
189
+ We support different component types: VEVENT, VJOURNAL and VTODO.
190
+ By default, we include all types in the result.
137
191
 
138
- You can get all **TODO**s that happen at in certain **month**.
192
+ You can specify which components you would like to get using the
193
+ `--component` or `-c` parameter.
139
194
 
140
195
  ```shell
141
- ics-query --components VTODO at 2029-12-24 calendar.ics
196
+ -c VEVENT # only events
197
+ -c VTODO # only TODOs
198
+ -c VJOURNAL # only journal entries
199
+ -c VEVENT -v VTODO # only events and journal entries
142
200
  ```
143
201
 
144
- ### `ics-query at` - time ranges
202
+ This example returns the first event of a calendar.
145
203
 
146
- ### `ics-query --output=count` - count occurrences
204
+ ```shell
205
+ ics-query first -c VEVENT calendar.ics -
206
+ ```
147
207
 
148
- ### `ics-query --output=ics` - use ics as output (default)
208
+ This is also available as `ICS_QUERY_COMPONENT` variable.
149
209
 
150
- ### `ics-query --select-index` - reduce output size
210
+ ```shell
211
+ export ICS_QUERY_COMPONENT=VEVENT
212
+ # from now on, you will get only events
213
+ ics-query first calendar.ics
214
+ ```
151
215
 
152
- Examples: `0,2,4` `0-10`
216
+ ### Timezones
153
217
 
154
- ### `ics-query all` - the whole calendar
218
+ You can set the timezone of the query, otherwise the event's local timezone is used and you
219
+ might miss events in your own timezone.
155
220
 
156
- ### `ics-query between` - time ranges
221
+ The first event at New Year 2000 in the **event's local time**:
157
222
 
158
223
  ```shell
159
- ics-query between dt dt
160
- ics-query between dt duration
224
+ ics-query at 2000-01-01 calendar.ics
161
225
  ```
162
226
 
163
- ### `ics-query --select-component` - filter for components
227
+ The first event at New Year 2000 in **your local time**:
164
228
 
165
- ### `ics-query --select-uid` - filter by uid
229
+ ```shell
230
+ ics-query at --tz=localtime 2000-01-01 calendar.ics
231
+ ```
166
232
 
167
- ## How to edit an event
233
+ The first event at New Year 2000 in **UTC**:
168
234
 
169
- To edit a component like an event, you can append it to the calendar and increase the sequence number.
235
+ ```shell
236
+ ics-query at --tz=UTC 2000-01-01 calendar.ics
237
+ ```
170
238
 
171
- Example:
239
+ The first event at New Year 2000 in **Berlin time**:
172
240
 
173
- 1. get the first event `--select-index=0` TODO: recurring-ical-events: set recurrence-id, sequence number
174
- 2. change the summary
175
- 3. increase sequence number
176
- 4. add the event to the end of the calendar file
177
- 5. show that the occurrence has changed
241
+ ```shell
242
+ ics-query at --tz=Europe/Berlin 2000-01-01 calendar.ics
243
+ ```
178
244
 
179
- ## Piping calendars
245
+ You can also use the `ICS_QUERY_TZ` variable.
180
246
 
181
247
  ```shell
182
- cat calendar.ics | ics-query --output=count --filter-component=VEVENT all > calendar-event-count.int
248
+ export ICS_QUERY_TZ=localtime
249
+ # from now on, we use your local time
250
+ ics-query at 2000-01-01 calendar.ics
183
251
  ```
184
252
 
185
- ## Notifications
253
+ For all avaiable timezones see:
186
254
 
187
- Examples:
188
-
189
- - There are x todos in the next hour
190
- - There are x events today
191
- - Please write a journal entry!
255
+ ```shell
256
+ ics-query --available-timezones
257
+ ```
192
258
 
193
259
  ## Version Fixing
194
260
 
@@ -266,6 +332,15 @@ To release new versions,
266
332
 
267
333
  ## Changelog
268
334
 
335
+ - v0.3.0b
336
+
337
+ - Add `--tz` timezone parameter
338
+ - Add `ics-query all` to get all occurrences
339
+
340
+ - v0.2.1a
341
+
342
+ - Add `--component` to filter component types VEVENT, VJOURNAL and VTODO
343
+
269
344
  - v0.2.0a
270
345
 
271
346
  - Add `ics-query first <calendar> <output>` for earliest occurrences
@@ -289,3 +364,35 @@ To release new versions,
289
364
  ## Related Work
290
365
 
291
366
  - [icalBuddy](https://hasseg.org/icalBuddy/)
367
+
368
+ ## Vision
369
+
370
+ This section shows where we would like to get to.
371
+
372
+ ### `ics-query --select-index` - reduce output size
373
+
374
+ Examples: `0,2,4` `0-10`
375
+
376
+
377
+ ### `ics-query --select-uid` - filter by uid
378
+
379
+ ### How to edit an event
380
+
381
+ To edit a component like an event, you can append it to the calendar and increase the sequence number.
382
+
383
+ Example:
384
+
385
+ 1. get the event `--select-index=0`
386
+ 2. change the summary
387
+ 3. increase sequence number
388
+ 4. add the event to the end of the calendar file
389
+ 5. show that the occurrence has changed
390
+
391
+
392
+ ### Notifications
393
+
394
+ Examples:
395
+
396
+ - There are x todos in the next hour
397
+ - There are x events today
398
+ - Please write a journal entry!
@@ -1,11 +1,12 @@
1
- from .cli import main
1
+ from .cli import cli, main
2
2
  from .version import __version__, __version_tuple__, version, version_tuple
3
3
 
4
4
  __all__ = [
5
- "main",
5
+ "cli",
6
6
  "app",
7
7
  "__version__",
8
8
  "version",
9
9
  "__version_tuple__",
10
10
  "version_tuple",
11
+ "main",
11
12
  ]
@@ -12,5 +12,5 @@ __version__: str
12
12
  __version_tuple__: VERSION_TUPLE
13
13
  version_tuple: VERSION_TUPLE
14
14
 
15
- __version__ = version = '0.2.0a0'
16
- __version_tuple__ = version_tuple = (0, 2, 0)
15
+ __version__ = version = '0.3.0b0'
16
+ __version_tuple__ = version_tuple = (0, 3, 0)