 Here we go. Thank you Niko for joining. Thank you very much. Yeah, hello and welcome to my talk. So why I do this talk is basically I wrote an open source library which I thought only I need and then now I look at it a few years later and it has 120,000 downloads and per month so I would like to take you on a journey with me to explore a bit how could that have happened. So and yeah this is a library specifically working in Python, working on online calendars. Yeah for the structure of the talk, whenever you have a question there are the show notes and you can write your question in the notes. Maybe I can address them while I'm talking, maybe I can do this in the end when we have time for questions and answers. The slides are also online. You can find the link in the show notes so that you can, let's see it's over there for you, so that you can click through the slides, go up and down and click on some links there if you don't want to listen to me and yeah you can basically follow your own rhythm. Yeah I'll start with talking about the history of the library and then go into the different factors that I see as a success factors for your open source project and to name that I'm just an open source developer who does hobby projects. I'm not part of any big company or any organization and still I could do something that people use and so can you. Yeah a little bit about myself, I've got a website, okay but I'm living in the Eco Village TP Valley right now, I live in New York with my family together in the United Kingdom in Wales and when I'm coding that looks like that. I sit in front of my burner, get my knees warmed and have my smartphone on between my knees while I make some porridge and some tea and yeah basically I'm offline maybe once or twice a week I push my code and listen to some emails from issues and that's basically it. Yeah so you can become a full developer of libraries and everything, you don't need to have a computer or something like this or a stable internet connection, though that helps. Yeah now about the the library, so a few years back we were in Brandenburg, we just created a network of different pecker and maker spaces in this rural area of Germany where nothing much is going on in the digital world and we were faced with this question of how can we tell people when something happens somewhere else so that they can go from one village to another from one place to another and attend a so we wanted to have a joint calendar and all these maker spaces they already had calendars where they put in there the few events that they made and they shared them in an open format, the i-calendar format. WordPress at that time provided a solution so that we could join different calendars and put a website up with one calendar but I wanted to go a bit further and make that easier for everyone just without hosting and also highly configurable so that other places can show calendars in different ways without needing to set up the WordPress again and I created the open-bap calendar project so you could have static site find an ICS and calendar link online somewhere and display your calendar on your page. Now that's they already started facing the issue having the online calendars, the ICS files, how do I display these events? And the code for that became increasingly complex so that I decided to carve that little thing out and put it into a known library and when I look at it now it has like 120,000 downloads per month and I don't know even who uses it but seemingly it's useful for people and yeah I want to explore with you how this could have happened. So I think one of the factors for the usefulness of the library is that I have the use case myself so when I started I just had these calendar files they take one calendar and I get all the events out of it for the time spent of two years and put it up on the website yeah so problem solved for me everything's fine I carved this little question out and put it into a library of between start and end which events do take place yeah and it has an easy interface just one function and I put that out into the world also I added a license to it I wanted to make it open source and I choose chose the LGTL license that is because I'm again just a hobby developer and I do like it if I share my code and I get something back that I can just click merge and so I like the copy left aspect of the GPL that I do not need any contributor license agreements and that also people who use that library they can be sure if there's a merge request and they use that that they also have the right to use it and they don't need to make anything else more sure yeah and I didn't use the GPL because I just wanted to try out the LGTL that's my reason behind that and with that I had a use case a very like small one a very rough one and I had the license to it suddenly became a common use case and now people are can use it in this two functions there so at the date for getting the events of the date a month a day maybe and the between functions still for a time range in which you can receive events and another important thing is the interoperable base so when you host your i calendar your your online calendar somewhere and you download it you have this file and the i calendar module was a long around for a long time already to read these files and use them in python as an object structure yeah and these these functions they basically take this object structure and give back this object structure so there is nothing new that people need to know it's yeah basically everything is known plus a little function that you need to read up on so I think this one makes it quite easy for people to actually use the library one of another factor is the documentation first yeah so I do like documentation a while ago I read this blog post about write your readme file first yeah and I would stress the point that this is quite something nice because when I write my readme file first I think about how do I feel comfortable with using my library what would I like it to be and on the other hand if I write the code first and then the readme then it's more like how all these technical specialities all these technical technical little things they come creeping through as parameters or as heavy thoughts in my head of how I need to pass that onto the user but actually I don't have to yeah and with that also it becomes clear for other people what my library should do and what it shouldn't so when the readme file says this is what the library should do people come back and tell you hey it doesn't do what it should here that's the example yeah but if I just have a sparse readme and no real documentation the people will be wondering like there's a mistake is it my mistake is that the mistake of the library should I maybe write a wrapper around the library so I can fix this use case something like that here but if the readme file just states a bit boldly yeah that's what I can do and it doesn't do it it actually is a good thing because people come back and tell you that and yeah what I did also with the documentation is a just a few answers on stack overflow of hey you could use that library by the way and no people start to find it and use it and another factor of of I think what what contributed at least for me to this library is the feedback before yeah I had this this I this open web calendar and I had my library in it yeah and I would get feedback only from the users of the open web calendar library which isn't much yeah maybe all this event was displayed a bit falsely yeah but now this library is used in many many many other places and I get weird weird calendar files that people think should work yeah and we can like smooth out the edges of this library and it will let also improve the main software that I wrote so actually sharing these little pieces of my code for other people improves my main software this is one of the learnings that I had in that place here and I get a much higher quality in the end yeah and then there is the tests that I do like I call it test second because I do read me first yeah other people call it test first and yeah I do write this library in a test driven way because I like green dots yeah no all it falsely has other advantages that are not just visual um for example the knowledge is lost over time so this library is around for a few years now and I do not want to sit in front of the library and ask myself this line of code should I change it or maybe should I leave it why did I put it in there yeah I know that when the tests are green I did a good job yeah and um and now when the tests are green it allows me to say I also did a good refactoring yeah there was a time when my initial way of dealing with the calendar standard uh was not not enough to to reflect the complexity what is going on so I needed to do a major refactoring of all the code and the test helped me tremendously without them I would have probably broken half of what other people would have expected right so with that um with the tests you get a long-term maintainability also and and that's probably the the place where you where you choose yeah if you have your software project you may have this really just small one function that's useful for you that might be useful for other people if you like cut that out put it into a library like this one you may find that the input and the output is quite known it's like a unit from the unit tests yeah so we have the calendar files we have the times at which we want to know which events take place and there's a third thing we do have the events because we can look at another calendar that works properly and with that the whole function is 100 testable and we can get a really really high test coverage for our code so that enables us with another uh with something else that follows out of that um cause when we have these tests and people start to create pull requests after a year or two um we can actually deal with them fast yeah we can get the example we can write a test and so on and when people want to look around for solutions yeah they look at the library and if they see there is no release and they'll commit within the last five years um they'll think like i do at times um if i use that library and i run into a problem i guess nobody will fix my problem and i'll be left alone yeah so they look around for other other solutions but if the last commit is from one month ago or maybe half a year ago um for quite stable ones then you would think yeah i can use that one so having these tests in place also allows you to actually have a faster feedback and more feedback and i'm really excited about pie test i want to show you why yeah so if you look at the way that we do deal with issues in this in this library because it can be tested pretty well we find an issue we get the example file be write the tests and then implement the change and the test may look really easy like this three line i am basically it's a function that takes the list of the calendars that we have in the second line it gets all the events from the calendar named issue one at a certain date and then it makes sure in line three that there's only one event and you may think that this function only runs once uh no it doesn't pie test allows us to run this function several times in several different environments so for example we want to test it on the calendar that we got issue one but i also tested on the calendar with all the events in a in a different order so that i make sure that the result does not depend on the order of the events because they can be ordered like they want to be at least um in the standard and also a third time because python has its own its old time zone implementation called fits or party set and this is quite uh old now and shouldn't be used anymore you should migrate to the newer one which is called uh uh zone info which is available from python 3.7 and upwards so uh titus allows us to run all the tests on the old time zone implementation and on the new time zone implementation and with that with this parametrization of tests that titus makes so easy you can make sure that the module works on the latest versions and on the on the older versions yeah so that's about the tests i like green dots too yeah i can multiply the tests with three or four if i want to so i gotta get more tests yeah and one point that i would like to say is um i'd like to put the complexity last and we have this open specification for the i-calendar format which is called rfc 5545 and it includes events and time zones it includes journal entries alarms to dos and free busy times and many many more features but if we can hide some of the complexity from people then they are quite grateful yeah just just looking just looking at the events here we have an example if you open such a file it begins with an event then we have a start time in line three it is in a certain time zone which is duty at this place in line four we say oh this event repeats each monday yeah in line five we say um oh but the second one doesn't happen by the way um and in line six we say we reschedule the whole thing to the 26th of march yeah and then the event ends so if you can hide this complexity away and we just say give us the past calendar here is uh the output the list of events that take place when you want to know it um then that's quite a contribution and we already reduce some complexity we do not need to import much much more like alarms and so on and another thing is i guess the relationship of the ecosystems um one is for example we have the i-calendar as a base that's already quite known and we just plug something on top and basically give the same stuff back so people are not uh they don't need to learn so much yeah um and that's easily achieved i think with shipping your small functions over to other people and the second one is the i-cal events library it does about the same as the recurring events library to also download stuff and uh yeah again i didn't find that uh in the right time or i didn't like the documentation of it that's why i wrote my own stuff um there's the third the icsp library that's if you just want to give you a value events but you don't want to read them you can do that easily with that one there's the open web calendar which is again like where this library was created from one example of a application that sits on top and the xwr time zone library and this was created because major players like google they are so big they say yeah i don't need to work with the standard so much um i i add this uh little attribute called xwr time zone into the calendar and that kind of completely changes um how the events are being evaluated and then other people do a lot of guess work of what could that have meant or not and this library follows the same idea as i just showed in my talk the factors it has the use case for that library um to take a non-standard calendar and produce a standard calendar so that we can query the events at certain times it has an open license that is open source and we wrote the documentation first we wrote a lot of tests the complexity again is hidden or it's like reduced because now people know i just need to deal with standard calendars and it's again a carved out little piece that could have been in the recurring ekelevance library but instead there's another piece yeah and we already got uh the feedback like one pull request that went to this library uh to fix uh one one yeah one broken evaluation yeah the ecosystems relationships are the same yeah for this um i would like to end my talk um i hope i have inspired you or if you are if you're writing your own source code also in your hobby time you can think about huh this little function maybe i can just ship it off as a different uh library on on some uh platform and then people can use that independently of what i do you get a lot of engagement you may get a lot of engagement with it you may get uh improvements because it is used in places that you couldn't have thought of yeah and uh yeah that's basically my motivation so even if you are just on a smartphone uh you can do something that uh people want to use and want to want to develop with you so um thank you for your attention and i'm happy to hear some questions also uh want to thank for uh like the presentation engines this is a website the first age aside for being here and the many different ways in which this is made possible um also just developing on the smartphone yeah so i leave the the