Improve search
We could improve search in khal by adding some elements like date range, location etc.
I made a PR #938 with search by daterange withe the same syntax than khal new.
But I have another idea for add date and others element in search. It could be easy and simple to add keyword with double column. for example, search events with dentist before 2020.01.24 :
khal search before::2020.01.24 dentist
Other example, search appointment with friends between 2019.06.04 and 2019.07.23 :
khal search before::2019.07.23 after::2019.06.04 Friends
It could be easy to add some search element like location::, summary::, etc.
With this method, search can be improve in khal and ikhal.
List and search are both commands to select and project data. The defacto language for that is SQL.
Ad hoc languages means you have to learn this special language, and they are usually bad (incomplete). In your above example how do you escape keywords, say, someone have a meeting named "before::"? What if you want two distinct intervals (grouping)? What if you want conditionals? What if you want to do an approximate string search (Birthday%)? Sorting? etc.
Another option (with all that entails including security issues) is to embrace that we are using python and expose and API and let user write some Python code to extract the data of interest. For example, user supplied predicate (lambda) that used to filter all calendar entries.
You could dump all the data as json and use jq to query it. Externalize the problem. SQLite might be another option.
The defacto language for that is SQL.
Implementing an SQL interpreter (especially if you want to keep the option of simple searching) is not simple.
say, someone have a meeting named "before::"?
Then they make do. If we were feeling really fancy then the :: could be made configurable.
What if you want two distinct intervals (grouping)? What if you want conditionals? What if you want to do an approximate string search (Birthday%)? Sorting? etc.
That sounds mostly overkill.
Another option (with all that entails including security issues) is to embrace that we are using python and expose and API and let user write some Python code to extract the data of interest. For example, user supplied predicate (lambda) that used to filter all calendar entries.
If a user wants to do this, they can add it to the code. I don't think anyone is likely to do this.
You could dump all the data as json and use jq to query it. Externalize the problem. SQLite might be another option.
See #1037. Optimising the (existing) sqlite database is also an option.
The defacto language for that is SQL.
Implementing an SQL interpreter (especially if you want to keep the option of simple searching) is not simple.
Agree and this is why everyone writes their own language and now stuck with making that language full featured forever. Some of the nosql databases added sql. All tickets systems including github have their own (incomplete) query language.
say, someone have a meeting named "before::"?
Then they make do. If we were feeling really fancy then the
::could be made configurable.
When the data is valuable then being able to (non-interactive) command and query becomes valuable (#587, #603, #1000). There is already list and search which just query on two different fields.
What if you want two distinct intervals (grouping)? What if you want conditionals? What if you want to do an approximate string search (Birthday%)? Sorting? etc.
That sounds mostly overkill.
I am on vacation next week, so I would like to cancel all meetings but leave things like birthdays alone. In a business environment cancel means that I will not attend, but others may. If it's my event I may (or many not) want to delete the event. In a separate report, I would like to know of all events except for meetings for the next week so I can ensure that is taken care for (birthdays, take out trash, water plants etc).
The other use that is super common in a business setting is to schedule a meeting with n people, when n it's greater than a few you really need a list of candidate slots ordered by least conflicts usually there are essential people and there are non-essential people for a given meeting so sort sort conflict(essential), conflict(non-essential). The existing options either have to browse through every calendar to find a free spot, or just scheduled then move the meeting till the list of conflicts is acceptable.
In my wife's consulting business it would helpful if the khal could find available 1 hour slots, say, between Monday through friday between 9 and 12 or and 13 and 17 where available means no other event scheduled including whole day vacation events.
Another option (with all that entails including security issues) is to embrace that we are using python and expose and API and let user write some Python code to extract the data of interest. For example, user supplied predicate (lambda) that used to filter all calendar entries.
If a user wants to do this, they can add it to the code. I don't think anyone is likely to do this.
You could dump all the data as json and use jq to query it. Externalize the problem. SQLite might be another option.
See #1037. Optimising the (existing) sqlite database is also an option.