 All right, we're live on YouTube All right, we're live on YouTube We're live on YouTube Hopefully I have closed or stopped any streams. I heard myself We're good now. So let's switch over now All right. Hello everyone. Looks like we got a couple folks in the chat already Welcome to the deep dive and as some of you may or may not know yet This is gonna be a little bit different Different type of deep dive today. We're talking about all things Circuit Python libraries and as you can see on the screen there, we have a special guest host today Katni So let's do a brief introduction about the show just because we do have new folks that tune in sometime. So On this show, we are going to be working with or talking about in this case circuit Python related things If you don't know what circuit Python is The best place to head is circuit Python org and you can learn more there But basically this is a version of Python that runs on tiny computers called microcontrollers and What is this? Okay, interesting Maybe my hotkeys don't work for switching. That's all right. We can switch like this I actually have one right here. So we're writing Python code that runs on devices like this This one is a pi portal titano. It has a nice big Touchscreen on it, but it also has an accelerometer and a neopixel a couple other things on the back We're writing Python code that runs on little devices like this and there's all different shapes and sizes I tend to like playing with ones that have screens on them But if you do head over to circuit Python org and you go to the downloads page You can take a look at all the different devices that we can write this Python code for and you can see that there are lots of Different shapes and sizes and form factors of these things. So we're writing Python code on here to interface with other hardware Like sensors and lights and buzzers and beepers and screens and pretty much anything that you can connect You know any electrical component we're able to connect to these devices and then use Python code to control it So Catnip I think probably most folks that are watching will know who you are But just in case there are some that don't do you want to introduce yourself and tell us a little bit about Who you are and what you do for sure Um, so I'm catney. I am sponsored by Adafruit to work on circuit Python Primarily I work on the Python side which means I work on coordinating the libraries and coordinating new contributors as well and I Have Gotten into the core a little bit, but most of the time that requires a lot of help But the Python side of things not so much I've been working with Adafruit since 2017 which is also when I started with programming and electronics, so it all happened pretty quickly But since then I've picked up a lot of different Responsibilities at Adafruit but including that is Included in that rather is coordinating all of the libraries, so that's why it made a lot of sense for me to guess today Because you're talking about my world Indeed yeah, we are and definitely thank you very much for joining I think it will be great for folks to be able to hear from you while we talk about lots of this library related stuff So let's catch up and say hello to some folks in the chat over on YouTube Amtaut, Mausa, Paul, Julenek, and M4TK Let's see some on Discord as well who have jumped in Gordy G, Zarnolin, Seagrover, AspatrickW AspatrickW asked about Twitch Dream In my experience the YouTube one tends to be a little bit ahead of the Twitch one But I think it might be different for different folks Kind of an echo See hopefully it's not too bad double-check a couple of settings. I don't think there is I'm not hearing any echo But I'm also not hearing the stream AspatrickW and Mark Gambler, so hello to you folks. Thanks for joining us And like I mentioned before this will be a bit of a different episode normally on the deep dives I just jump right in and start working on something oftentimes in a circuit Python library or project But today we're gonna kind of take a step back and talk a little bit more About the meta if you will about libraries themselves what they are what we do with them why they're helpful How you can write your own all kinds of stuff like that I Let's see. We are on the one without the screen. So let's go to the screen as well I have a Couple of slides. It's nothing crazy. There's like nine slides here with some talking points that we will hit I have this as a PDF which I will try to share in the Discord if anybody wants to grab it for any reason. I think this will let me upload a PDF, right? Yeah, there we go So I put that PDF and we'll kind of bounce back and forth between that and a couple of different webpages and different stuff like this No echo on this end of the YouTube stream. Perfect. Thanks to you Grover. I appreciate the heads up Oh, and Gordy G as well says not anymore. So it looks like we got it taken care of So circuit Python libraries like cat me mentioned these are Sort of the Python level of circuit Python. So this is a great place for folks who are new But want to get involved, you know C code Which is what the core of circuit Python has written in tends to be a bit of a steeper learning curve than Python Python is actually a really great language for beginners You know in no small part because of things like circuit Python, but there are lots of other Python projects as well that tend to be Much easier for beginners to pick up than something like diving all the way into C code So this is a great place for folks that want to get started As we go through I have a couple of different links pulled up in this PDF And so I'll just show you and we'll talk about kind of the pages The first one is the libraries page here on circuit Python dot org This is where you can learn a little bit about the library Bundles and about libraries in general and this is also where you can come to download the current version of the libraries Oh, and I will mention as well for folks. This is definitely a two-way street So if you have questions for me or you have questions for cat knee or you have questions about getting involved Or anything circuit Python or rely library related Please feel free to drop them in one of the chats and we'll try to keep an eye on the chats and answer Any questions that come up? So let's head back here. This was kind of our Front page and so first up is kind of the The bit of news the the congratulations that's in order for the community. This is kind of Why it made sense. I think to do this stream right now There's a couple other things we'll talk about as well that kind of fit the timeline pretty well But just this past Thursday, we actually reached a milestone of 350 libraries Published for circuit Python. So this is between the Adafruit library bundle Which are the officially supported libraries that Adafruit pays folks to work on as well as the community Library bundle, which is where just members of the community can submit their own libraries for other people to use So with all of those added together, we just recently crossed that threshold of 350 which is amazing And definitely want to give thanks to anyone who has contributed over the years whether you Contributed to a library directly or you left a review or even if you just came into the discord and asked about something Raised an idea, you know, hey, it would be neat if that sort of thing You know, definitely appreciate everyone who's been involved at every level in helping us get to here Um And I will mention too catney anytime if anything comes to mind for you feel free to uh to jump in Well, yeah so The first thing to think about is like, why do we have so many libraries? We're up to 350 Why are these things so helpful to us? And why do we keep making more of them? The gist of it is basically because the microcontrollers that we're using uh while they are More or less basically just little computers They are little computers. They have relatively few resources compared to You know, like a desktop or a laptop computer or even something like a raspberry pi We have very small Amounts of storage. We have relatively little amounts of ram CPU power is also tends to be smaller. Although that doesn't matter as much for this purpose But basically we don't have a lot of room to work with Some of these devices have less than a meg of storage. Some of the larger ones are up to like eight or 16 megs of storage Which is a lot for a microcontroller. But if you're used to normally sized files on a pc Then you'll probably know, you know, eight or 16 megs is is really not that big So having all of these libraries allows us to have more functionality For different pieces of hardware then we could actually fit on the boards Basically the core of circuit python contains sort of all of the the essence of what we need in order to write this python code But the libraries are kind of like a layer built on top of the core that allows us to talk to different specific pieces of hardware So if you have a particular, you know accelerometer or term A temperature sensor or something like that you need to have a driver in order to be able to communicate with it to get data out of it And that's where the libraries come in and it wouldn't make sense necessarily for us to Put that code that allows that particular piece of hardware to work on every single device because lots of devices and lots of projects will never Connect up to that particular sensor. So it would just be taking up extra space that is not actually adding anything To the device or the projects that it's used on So libraries allow us to have kind of like optional pieces of code We can write libraries add them to our device as needed So you can delete all the libraries from your own device when you're not using them for a particular project And you can load up just the ones you need which allows you to You know interact with your own specific hardware, but not have so much stuff on your device It's also worth noting that we have helper libraries as well Which are not tied necessarily to a piece of hardware, but are tied to a feature or um some kind of uh wrapper library around something else and so those aren't tied to hardware, but it does make um working with circuit python Uh more fun and have additional features that aren't necessarily in the core and also again You only need to use them when you are actually using that feature Yeah, yeah, definitely true. Yep our two kind of high level Buckets if you will for the libraries are drivers and helpers And so the drivers tend to be like a specific peripheral like I was talking about And then the helpers are more general Something that will allow you to do things on any board. Um, lots of our display io libraries like that are kind of filed under the helpers Um, so that's what libraries are Let me take a quick second to catch up on the chat here And again, if anybody has questions or anything feel free to throw them into the chat So, uh, I'll also say hi to a couple of the new folks that have popped in charles berniford Uh Beata giraff, uh paul schulinich. Maybe I said hi to you before as well Uh randall bone and johnny johnny bergdahl. Thanks to all of you folks for coming and hanging out with us today I can answer a sea grover's question. Um, the difference between a driver and a library is that some libraries are drivers It's sort of a subset thing. Um drivers refer more to something that allows you to work with hardware Um, so helper libraries might not necessarily be a driver. Uh, so there is a difference, but it's sort of that drivers are A smaller part of the total libraries Yeah, great question as well see grover So on the next page here, I have information about the library bundles So the way that aita fruit distributes the libraries and the way that aita fruit encourages other folks members of the community and even other other organizations to Distribute library libraries is inside of bundles So right now there are three existing library bundles The aita fruit library bundle is the one that holds all the libraries that are officially supported by aita fruit employees And folks that aita fruit pays to work on them Within the aita fruit library bundle, we do have those two high level buckets the drivers and the helpers And I'll pull up the web page for it here as well, and I'll drop this link in the chat too I'll try to get in the habit here of dropping all the links that I load up In the chat and then another thing I'll do is maybe go back after the fact and include them in some show notes on YouTube so that folks can follow through from there as well Uh, so let's load this one. This one is the aita fruit library bundle And one thing that's nice about this is that the library bundle is actually just a git repository. So The library bundle while it does hold a bunch of other libraries Is kind of structured similarly to the libraries themselves. This is just a you know, quote-unquote ordinary Github repository that has some code in it The magic is in the sub modules. So inside of this library folders We have those two high level buckets the drivers and the helpers And inside each of those are what are called a bunch of sub modules, which are basically just Links to other repositories. So each one of these things linked here Essentially is a link out to a different library if I click on one of them It'll take me over to this other repository. This one happens to be for gps But obviously there are loads and loads of these 350 at this point And they all do different things And this is the same when you download the library bundle from circuit python.org libraries You download the bundle from here like this mpy bundle or the python source bundle Or even the examples as well. This is ultimately kind of pulling a a compiled version of this Repository, it's all zipped up together for you. You can download it and then you can copy your libraries from there So let's see. Let's head back to here Let's head back to this one And let's see. So that's the Adafruit library bundle. The the next one is the community library bundle And this is where individual members of the community can contribute their own libraries and share them with others So I'll link up this one as well. It's it's structured very similarly So the repository for it basically looks and acts the same way as The Adafruit library bundle. It's just that this one has different sub projects linked up to it And these ones are not necessarily supported by Adafruit. They are created and maintained by individuals That are members of the community. So I'll link this one in the discord as well And while we suggest using our cookie cutter to generate the base files for a library that you submit to the community bundle Anybody is welcome To submit a library So if you have a piece of hardware that Adafruit doesn't carry and you write a circuit python library for it Submitted to the community bundle There are other people who probably have that same piece of hardware and would love to be able to use it Same for helper libraries. If you write a helper library with a feature that Adafruit hasn't supported in the Adafruit bundle Submitted to the community bundle Yeah, definitely. There is lots of great stuff in here. It is similarly broken out into drivers and helpers And inside there you can see it works basically the same. It's just a list Just like the other one was Technically these are what are called git sub modules, but again, it's kind of fancy lingo It's essentially just a link to another repository. It allows you to have a main repository and then link other You know sort of subset repositories inside of it, if you will So you can see all of the different great stuff that folks members of the community just like everybody watching here today This is all stuff contributed by Individual members of the community and I think I'm not a hundred percent sure but I think one of the community libraries Was our 350th. Do you recall Kenny? If I do it was I don't remember the library But I do remember the contributor. It was tech trick. Nice. Okay. Yeah, I was thinking I was thinking that might be the case I think I saw it go by in the git timeline there the message about it So a huge huge. Thank you by the way to tech trick who has done a bunch of amazing work on the libraries lately I want to say maybe the last like I don't know four or five months or something like that is is around the time when tech trick first started Popping up into the discord and contributing and coming to the meetings and stuff and they have done So much really good work across a ton of different libraries So that's actually really cool that they Were the one to hit that 350 mark for sure and I Will have stuff come up that I need done in the libraries and tech trick jumps on it Which is amazing because we don't always have the cycles to do um non critical things to the libraries and so a lot of this stuff that would normally language is happening and it's just great to see Yeah Not only echo that let's see Catch up here on the youtube chat a little bit. Is there the bundle install used to be copy everything to your device? Yeah Devices drivers also help smooth over the differences between hardware. Yeah, that's a really good point as well In the youtube chat there beta Yeah, especially the way that we write our libraries. We tend to there's a What is it called like a style guideline? We'll pull that up here in a little while actually I think it'll be good to look at But there's a style guideline and when we create new libraries. We tend to structure them in a very You know concrete similar way that way they all function The same so for instance like if you want to make a project with an accelerometer And you know you buy your accelerometer and you use it for a while and then down the line You know you want to make a second one or something like that But your accelerometer is no longer available, right chip shortage. This is the the reality of the world right now You know probably you can just pick up a different accelerometer that is available Swap out the library and then the rest of the code tends to remain the same because we adhere Um to those guidelines when we create the libraries to keep everything similar between libraries that do Um similar things such as interfacing with an accelerometer or any other type of sensor or anything like that Let's jump back here. So the that was the community bundle That's the second one of the bundles and then the third one, which is the newest one And the one with the the least amount of things in it so far is the circuit python org library So on github, uh, they have things called Organizations, which is basically what the the eta fruit like if you want to find an eta fruit library You know you go github.com slash eta fruit and then the name of the library there So in that case eta fruit is the organization. There's also a circuit python organization Which is more community based. This was something that was scott's idea to spin up this Scott's the lead developer of circuit python. He's out right now But I think he's probably coming back in a couple of weeks or something like that But um, this was kind of his idea to put together a separate bundle that is also for community contributed libraries But it is for more like groups of people to work on. So we have a team of folks that work on display io Related libraries and there's probably four or five of us at this point And you know folks come and go as as time goes on But all of us are kind of you know interested in helping maintaining and creating Display io library. So we all kind of got together created a group inside this org And this is the bundle where all of those Libraries that are supported by again multiple people within the community the the big difference between this one and the community bundle is The fact that it's not necessarily just an individual who's publishing a library, but there are You know multiple folks who are willing to help create and share and maintain the library So that's what goes on inside this one Let me go let's see back to the pdf here See what we got on the next one installing libraries. Okay, so um, most folks who are watching are probably going to be familiar with this But I thought it would be good just to show a couple of the different options um For how you can get libraries installed Also, we do have a question in the discord there. Let's see. Is there a document that lists all of the libraries? A description of each module in a library and an example Yeah, that's Let's see the docs page. I'll pull this up too as well so we can all see it here. Let's see I think it's the closest to what you're asking for The description of each module in a library an example code on using it is contained within the documentation for that individual library And this list as far as I know links to the documentation for each library Wow, you know, I don't think I've ever seen this page this page is super handy because they're all separated into um categories and stuff and when you add a library to the aid of fruit circuit python bundle This is part of that. Uh process is adding that new library to this list Um where it goes so that we don't have to have someone else go through and try and figure out everything that's missing It's actually required as part of the um process to add a new library Yeah, nice. I kind of Mark this page because I will definitely find a use for this in the future. I'm sure It's bad about remembering Where all of these different pages are at. Yeah, so this is perfect. Yeah, you can scroll through here and see a list of all the libraries And then you can click through each one Um to read more about the description of that particular library and then we do On the topic of examples all of the aid of fruit libraries We'll have a folder inside of them called examples where we put example code. So, um, you know, the most basic ones We will always include at least one simple test But lots of the libraries have more than one example as well. They tend to try to We tend to try to show all the functionality that we can inside the library in an example So whenever new functionality gets added, we like to also Include a new example for it as well. Yeah, so great question very z Back here so installing libraries is what we're talking about and so Throughout most of circuit pythons history at least to my knowledge Which actually i'll fill in a little bit of the backstory as well. Uh, cat and you mentioned starting with aid of fruit around 2017 I am newer to aid of fruit. I started contributing As a community member probably in 2019 early 2020 where my first few can contributions to libraries and then I've just been working as a member of the community since then Made a couple of learn guides and different things like that here and there that I was contracted for But then starting at the beginning of this year 2022 I came on more, um, you know, concretely to the circuit python team So i'm working on the team part time now, uh, and I work every monday. Um, I work all day on circuit python related stuff Um, so that's kind of like my, you know, uh, 50 000 foot brief history of my Involvement in the project and to the best of my knowledge, um, the majority of the time that the project has been out and available This was this top bullet point here was the way that you would install libraries So you would go to circuit python.org Uh, you would click libraries up here or else, you know, just type in slash libraries in the address bar Scroll down a bit and then you get to, uh, the list of all the bundles And so usually you want to just grab the mpy bundle But if, uh, you actually want to see the python code or anything you can download the python source bundle If you want the examples separately, you can download a zip of those as well And you can also access the community bundle from this page also So you would download that, uh, and then you would open it up. It's just a normal zip file. I'll open it up here real fast and then see real quick originally, um, the only access to the bundle was through github And it would build in each release that we would do And so the assets under the release is where you would download your version of the bundle that you wanted And that was all manual and and when we've really first started just like somebody mentioned on youtube, um It was you could just copy the whole bundle over And that quickly became a major issue where we were running out of memory because we just kept adding so many libraries And so much hardware support and so that's when it turned into we had to explain Please only copy the libraries you need and then eventually we we got circuit python.org going and got it in a much more, uh Readable and um more easily downloadable format Interesting. Yeah, that was before my time. I don't I knew that they were published on the release pages But I don't recall a time before like when that was the only place to grab it. So that's interesting history Um, so this is when you download the zip I downloaded the mpy zip and I've unzipped it here and what you find inside of it are three Folders the examples folder which has all the examples for all the different libraries The lib folder which this is where the libraries themselves live And then a requirements folder Which you can tend to ignore for most intents and purposes. This is more for the infrastructure side of things But if you look inside of there, it's got the requirements dot text file, which is a commonly distributed file for Software projects. That's a um for python projects specifically. That's a file typically folks use with pip pip the python package installation utility Inside a lib though, this is where the actual libraries are at and you would just find the one that you wanted So, you know, if we had a funhouse device or actually, let's say if we had a pyportal device since we do actually have a Pyportal here And we wanted to load up the pyportal library on it. We would come inside of here. We would copy it I actually have two circuit python devices connected to my computer right now I think the pyportal was the first one, which I guess is probably on top. Let's see We can always check here boot out. Yep. Pyportal. So this one is the pyportal And then you would go inside the lib folder on your drive and then you would paste it in here In this case, I do already have a copy of it. I'll delete it for now, though And we'll just paste a new one And then it's as simple as that right just loading a loading a library is just copy paste, which is um Really really amazing honestly. I had a little bit of experience in the arduino world before I got into circuit python Um And it's you know, it's not like super challenging But it is more involved to include a library in arduino Then it is circuit python the fact that you can just copy paste these and it shows up as a thumb drive. This is like One of the most amazing things frankly about circuit python. It makes it so much easier to get new folks involved Inside of arduino, you kind of have to load up a url And then you kind of have to hunt through a list inside the software and choose which things you want Again, it's it's not the end of the world. It's not super hard But you know copy paste it's tough to get any easier than copy paste Um, I will point out while we're here. Uh, some libraries are called Is it I think packages packages are the ones that are multiple files. So like this library here portal base Or pi portal the one that I copied over. This is multiple files. So inside you can see There's multiple different mpy files Whereas some of the smaller libraries are just a single file. So they don't have a folder. They just have a single mpy file And you want to make sure that you copy the entire folder when it is a folder And you have to keep its contents within it because The code is expecting it to be in that folder and is expecting to look at it in that folder structure And your code won't run if it's looking for something and you've spread out those files in the lib folder or something like that Yep, definitely true. I will mention as well a gotcha that sometimes folks run into is um In let's say in the library bundle after you download it. Uh, so I'll load that back up real quick here They'll go to find something like let's say you wanted to find the neopixel library This is the one where I've seen this happen accidentally a few times They'll go like inside their os here and they'll search for something like neopixel and they'll find uh neopixel.mpy But uh, if you're eagle-eyed what you'll notice is there's actually a couple Neopixel.mpy some of there's one that is the actual neopixel library the the sort of main regular Regular neopixel library. There's also one inside of I think it's uh seesaw is where it's at. I'm not a hundred percent sure though But there's one that's made for use with a different piece of hardware So, you know, the the gotcha tip here is like if you're going to use your operating system to search The bundle for the library just double check which file you're looking at You know, you can look at uh properties. Maybe you would tell us this you can see This one is directly inside of lib. Whereas this one over here Is actually going to be inside of a different library ita fruit seesaw So a couple of times we've had folks come over to the discord and they say like hey I loaded up my neopixel library and I'm trying to run the code and it's doing this weird thing where it's not working Um, and this turned out to be the issue is they had the seesaw one accidentally because they just searched like this Um, that's a quick tip. Yeah, that's a tough one to troubleshoot too because it's Like the least expected situation So it it's not the first thing that comes to mind, you know The first thing that comes to mind is did you you know copy an older version of it or is it actually copied or not? But imagining that someone copied the wrong version of it is Unusual so that one's a tough one Yes, yeah, definitely. Uh, and I see a couple of folks Asking about any plans to have a dependency tool So you my friend are in luck ronan over there in the youtube chat Because that is yes, there are plans and in fact the plans have already come to fruition and that is our next topic that we'll get to in just a moment Um, and I will catch up. Let me just make sure if there's any other Questions that we missed here Argued sometimes easier to use arduino. Ah, that's fair. That's fair I will I will mention too. Uh, I have way way way less experience with arduino than I do circuit python Uh, for whatever reason the well not for whatever reason. Truthfully the reason is the the quick iteration. Um There's something like almost addictive about being able to just edit your codepie and save it And then it just runs um as a person who's worked in software for years and years and years going on a decade as um software being my primary career The ability to save a file and instantly see it run and start getting feedback from it is um Just really really amazing. It's one of the things that drew me to circuit python very very heavily Um, and so for that reason, I don't have nearly as much experience with arduino Uh, change your file manager. So I did switch that over to list Let's see here near a dock. I will mention as well near a dock in the chat. Uh, shout out to near a dock in hug report Near a dock helps tons and tons of folks on the discord Uh, we have a help with circuit python, uh channel over on the discord right now We're in the live broadcast chat, but there's a help with circuit python Uh, where we have circuit python helpers who are around at all, you know different times of the day different days of the week There's uh multiple different folks there Um where you can go and get help if you're having trouble, you know with your project Or you're trying to use a library and it's not working or you know, you run into a problem like I was talking about before You think you got everything copied over and it's not working. You're getting a strange error Um, you can ask in that help with channel, uh, and I will say a huge thanks to near a dock because I see near a dock Helping people out in that channel a whole lot Um, let me catch up as well here. It's the next thing. Yep. Uh, johnny mentioned next thing And michael mentioned yet having I think copied the wrong Neo pixel file if you grew up on c or c plus plus then arduino is easy I could see that I will mention um a little bit more of my history My history doesn't involve any c or c plus plus Uh, I started I mean the very very first thing I did when I was a child was actually q basic Um, but I didn't do very much of it just enough to get hooked to kind of know that programming is what I wanted to do as a As a job hopefully um, but the vast majority of my experience is in java and specifically android Um more lately I do a lot more work in python and I happen to like python a lot more Uh, but I never did really have the background in c or c plus plus, so I could see that being Um, a big help to folks if you have that background arduino probably feels a lot more natural Uh, okay, so our next one copy pasting the libraries super simple super easy But what if you want something different? Um for folks that are interested in python or uh, no j s There are tools called pip pip. I think this is like Actually, I don't know if this is an acronym or what python packaging Utility, I'm not sure if that stands for anything, but I know the name of it is pip And then in p.m. I do know that is an acronym and it's node package manager These are cli command line tools that allow you to manage Dependencies to manage libraries essentially to install remove update, you know search for Different libraries um straight from your terminal, so you can find libraries on the internet, you know, you can go and search google or You know search github or something like that if you're looking for libraries But you can also do this from the command line in you know, normal python c python Which is the python that runs on desktop computers. You can use pip Or in the node j s land you can use npm And so we do have a tool somebody I think it was ronan over in the youtube chat Just asked a minute ago about a plans for a dependency tool and the name of that tool is Circup and it does already exist and it is amazing Uh, so let's copy this one and I'll drop it in the chat It a data set turns out pip is uh pip installs packages. It's a recursive acronym. Oh, okay pip installs packages nice I'll link to let's go to the github for circup as well. I didn't have that one pulled up, but I'll Head there real fast github circup So this was circup was I think originally was it created by uh, nicholas in toll Yes, nicholas toller v And so this is the same person who created Mu in mu the editor that we tend to point folks towards especially new folks for working on circuit python So they have created lots of great stuff for the circuit python and micro python ecosystem I think nicholas also did a lot of work on the um Original micro bit, uh, which is actually the first device where I learned about uh micro python Which eventually led to me getting involved in circuit python. So I'm lots of great contributions. Nice I'll share this link as well circup And so circup is exactly that. This is a command line Um dependency management tool So this makes it super easy to install and remove and update libraries on your device Um, so this is the repository This is where you could come if you want to look at the code to it or contribute new features to it If you just want to use it, you don't necessarily need to come here Although you can click the installation link here to get instructions on how to install it But once you get it installed, you know, unless you want to contribute to it You don't necessarily need to go to the github page for it Um, we do have a learn guide for it. Um, so I don't think we have talked about it too much but um Adafruit as a company is Kind of split into two high level You know sides if you will the the shop side, which is where you can go and buy You know microcontrollers and sensors and you know any kind of led widget you could imagine Uh beepers and buzzers and all kinds of interesting stuff even at an led with a skull Instead of the nice round thing which i'm Definitely eyeballing some of those And then the learn system which is basically a massive library Not to probably I probably should use a different term to not confuse things a a massive grouping of project tutorials and product tutorials Inside the learn system you can find guides that go over You know almost anything tons and tons of different projects Every new device that gets released gets a learn guide every new sensor Gets a learn guide that shows you how to use it that shows you what all the pins are all of that sort of stuff So tons of great stuff in the learn system. I'll link that as well for folks probably are familiar With this but I want to keep linking things and I'll put them in the description as well at the end So that way folks who are watching this in the future who maybe aren't members of the community yet Will be able to get all of the same stuff here And this is a huge part of what makes Adafruit Adafruit We don't sell you something and then leave you on your own You know, you you purchase something from Adafruit and there's almost certainly a guide of some kind available to get you started with that item So if it's new to you, we're not leaving you out to dry We provide you with you know assistance and and so on Not just on the discord but with guides in the learn system Yeah, lots of great stuff and new stuff being added all the time There's even a segment on asking engineer, which is a weekly show on wednesdays Where they go over all the new guides for the week and it's like almost every week that goes by There's at least one or two sometimes even more new guides going up. So new stuff all the time Let me catch up on the youtube chat here. Let's see The use circuit python and arduino about the same amount. It depends on the project I love the simplicity of python in a real-time computer. Yeah, michael says that over on youtube Integrated glow in the dark leds. There probably are some of those I would guess Let's see or like a web page that creates a zip for you from codepy and has a list of libraries Yeah, we should show that as well. I hadn't thought about that, but the project bundler Yes, let's take a quick detour here and we're this I will mention as well. This is like loosely planned I have the slides that we're going through here, but we're you know, definitely willing to entertain Um little rabbit holes here and there. We don't want to go too far off the beaten path But we do want to show people all sorts of interesting and neat stuff So if we just find a project, let's say This one was showed on show and tell this week, which looked really cool to me this little Sort of hand joystick controller that lis made lis is one of the newest members to the eta fruit team And so This is the guide that shows you how to make this project. This one happens to have 3d printed parts It has a circuit. So you have to connect up a couple of different things together There's a in this case a speaker Looks like a feather probably nrf 52 840 because it has bluetooth built in and then a couple of switches in this case So, you know, you can see we get the circuit diagram here We got the 3d printed parts in this case It's for the case and a little mounting bracket inside of it And then on the library and code side of things what you'll find in all of the learn guides Uh, so let's see this is the page that's going to show you how to set up circuit python on your device So like if you bought a brand new feather and it's not set up yet This is the page you can follow to get circuit python installed on it And then this page is the code for this actual project and on the code for the project There is this link right here download project bundle And this is a relatively new feature. I think, uh, maybe six months or something like that about is when this came about I'm not 100 sure on the timeline But this is a super handy feature. This actually also reduces the need for you to go and grab the bundle separately and load your libraries Or use circuit, which is what we'll get back to here in a moment This is another way you can actually get your stuff loaded up. You press this download project bundle That's going to download you a zip file with everything you need For this particular project. So if we head back here, we'll be able to find that zip And open it up and then inside of it What we'll have is the code for the project and a copy of all the libraries that that project needs So I unzip it go inside of it Sometimes we are supporting two major versions right now We happen to be on just one major version circuit python 7 But when uh, for instance circuit python 8 starts coming out We will there will be a period of time a couple of months or something like that where we will have some support for circuit python 7 And we'll start supporting circuit python 8 and then you would see both of them listed here If the version of np y changed in between I think is when we make the second one So in this case, we just have one. So we go right inside 7.x Here's the code pie. So again, this is the code for the actual project And then there's a lib folder right here that has pre loaded all of the libraries you need So you could just copy all these libraries from here over to your device again, you know inside circuit pi lib Load up your code pie as well from that zip and then you're good to go. You have this whole project loaded up Um, you don't have to do anything more than that. So thank you. Who was at the mention that was that near doc? So yeah, thank you near doc for mentioning that. It's definitely a good thing to show folks Uh, yeah, zarnalyn good point as well Uh, if you if anybody is looking at guides and you have if you run across something that seems, you know Out of place or is out of date or something if it gives you an instruction that is No longer correct for whatever reason there is a feedback link here So if you click this feedback and corrections, it'll give you a little form where you can basically submit a contact You can let us know what you found And you make sure to do it from the page that you're on and then it will populate into the folks who have learn guide Basically like editor access admin access to be able to edit the pages They have a page where they can go and see all of these feedbacks And what page they were submitted from and then of course go and fix whatever the issue is and update the guide Bundle fly yep So that bundle fly I think is the name of the tool that creates these bundles here and there's a I don't have a freaking easy way to bring it up But if you search around for ater fruit blend bundle fly there's a really cute Sort of fly mascot that I think is really awesome That's one of the neat things I that I like about ater fruit is a bunch of these different little cute icons that represent different things the um I mean, there's all kinds of different ones now blinka being the main one which is on the screen right there Um the circuit python snake, but there's actually a ton of other ones adobot minerva Um the bundle fly the badger one. I thought was really cute Yeah, that was on me nice Uh, let's see here 3% of the time soldered the header pins the wrong way Get the desoldering gun project bundle is uh still internal to ater fruit. Yeah, there's the fly Thank you, catney you're welcome Great to have a tool Yeah, I don't know too much about the code behind it that maybe I do know learn The learn system the actual code behind the learn system was built custom for ater fruit And it is one of the few things that is not fully open source is the code behind the learn system And I don't know where bundle fly fits into that which side of the fence it's on See here. Oh, there's a we have one sticker or whatever those are called in the discord even so we can send it straight in there nice Um, okay, so let's head back and talk about circuit up a little bit more So this is really nice being able to download the project bundle. This is a great way to do things um If you are kind of like quote-unquote power user if you're you know Contributing to circuit python all the time if you're constantly Installing and removing different versions of libraries and testing out different things Um, then you will probably find this tool to be very handy Especially if you are the type of person that likes a terminal interface You know terminal interfaces are not for everybody lots of folks You know if you just look at the terminal their eyes gloss over and it's kind of like it seems harder than it is Um, honestly once you start using it. It's it's actually quite easy You know, you're just typing a command one at a time and then it's going to do its thing for you Or it's going to tell you you know why it didn't work or whatever It can be a bit cryptic depending on what commands you're using But it's really not that bad. So I would encourage folks anybody here if you're like, you know on the fence about like, you know Wanting to use command line tools. I would encourage you to give it a try It is it's a super nifty thing If you can get the basics of using the command line down and kind of get past the idea of not You know clicking and using the mouse and stuff like that to interact Um, so circup is a command line tool like this. So you open a terminal you run a command Um, and you can run commands to install remove update Check versions do a couple other things. So I figured I would show a quick demo of it on the fly right here So we can see how easy it is. So I'll go to bundle Let's close this one. Maybe yeah, let's close this one. Um, and I don't know. Let's say we want to install Um We have open here Actually, let's see. Do we have anything? Let's say let's go ahead and we'll do the pi portal one again Let's say we wanted to Install that pi portal library. So I'll I'll even go and delete it that way. We're starting from an empty slate so to speak I'll delete it from here and let's say we wanted to get it installed using circup. Uh, super easy all we do Uh, actually, you know, I think circup, uh, maybe it's going to be confused because I have multiple Um Devices I'm not actually sure. Is there a way you can target? Uh, circup install This is the command you would run. Anyway, whether or not it works for me right now Might be due to me having multiple devices ate a fruit Pie portal, uh, and I usually honestly I usually copy paste this a quick little trick tip for folks that are watching if you Um are using a particular library. So again, I'll I'll say I'll keep using the pie portal example Um, if we find the pie portal sub module and we look inside the examples directory Um, one of the nice things about circup is that it uses the same names that you import Let's see here my blind worst part portal. Let's Did I skip it under drivers? Well, if there's portal base by badger Ah, okay. Yep. I just missed it the first time But for instance, if we look inside one of the examples the simple test example There's going to be an import at the top of the file here This one says from a to fruit pie portal import And then this happens to be importing a class called pie portal. You can actually just copy paste this right here I do this all the time when I'm installing with circup. So I'll copy paste The name of whatever's being imported And then you can just go and run from a terminal Circup install and then you can paste it paste it right in there Um, and I think uh, yeah, actually it went ahead and did it Or maybe not done already No, yeah, I did it looks like it did it So I was worried maybe having two devices. It might not know which one to go to but it looks like it got it Um, I don't know which one it actually did install on but you can see, you know You run the command circup space install and then the name of your library Again, you can copy paste that from your import line It's going to go and fetch the latest version of the bundle. So the bundle tends to get updated almost every day There's a new version of at least one library There are some days, especially weekends and stuff occasionally where no libraries will be updated But generally almost every day there's at least one change to a library somewhere And the bundle gets automatically generated each night whenever there has been a change So if a library changed today then overnight that night, there will be a new version of the bundle that gets generated automatically Circup will download the latest one for you Um, it will look at all the requirements. So we wanted to install a pi portal But pi portal actually depends on all of these other libraries display text esp 32 spy bitmap font All of these other libraries are actually libraries that eta fruit pi portal library makes use of And so circup will install all of them for you it goes through it finds all the requirements and it installs each one of them It's going through the list here. You can see I already had a bunch of them installed But the pi portal one which I didn't have installed because I deleted it right before we started it installed that one for us And for each of the rest of these If it if I didn't already have it then it would have installed those as well So this is a super easy tool for loading stuff. Uh, circup show. This is another good tip. Let's run that one circup show We'll list out the libraries in the bundle so you can search through the list here if you want Um, there is circup update circup update Um, yeah, I'll run this one. We could always control see it if we need to circup update This helps you keep the libraries up to date. So just like I was talking about before, you know We're constantly updating the libraries adding new features fixing bugs doing that sort of stuff Um, and so we're releasing new ones fairly frequently for for any given library You know, maybe once every few weeks or months or something like that is when a new version will come out You know, if it's a brand new library and lots of development is being done Then it may be up to like, you know, every few days. There's going to be a new version of it Um, and it's best to keep your versions updated because the uh, the updated one The most recent one is the one that we kind of maintain There's sometimes known issues with the older ones. Uh, and so folks will come, you know Again to that help with channel to say hey, I'm trying to run this library Um, and I'm getting this error message from it and it turns out, you know, like yep It was a it was a little bug, but it's already been taken care of you just need to go and update your library In order to get the newest one And not to mention when circuit python updates sometimes it changes How certain things function and that alters how libraries need to work And so sometimes updates go along with updates to circuit python as well Uh, so those are fixes that come in that resolve You know, uh conflict with an older version of the library and a newer version of circuit python So it's always good to stay updated Yep, definitely So we see here I ran circuit update and it found six libraries six modules on my device Which need to be updated and then it gives me a chance to either update yes or no each one of them So I'll do yes on this one and then we'll basically just go through the list here There is also a flag. I think uh dash dash all, uh, which I think zarnolin Thank you for dropping that in the chat as well You can do circuit update and then dash dash all and it will just automatically do all of these If you don't necessarily want to click through the list oftentimes I just run the all Because I always want to have the most up-to-date versions I'm always copying like test versions from pull requests and stuff to my device So I always have You know weird who knows what is going on in any particular library on one of my devices So I'm always just running circuit update all to get the latest versions Um, let's see here. We've got lots of love for circuit in the chat. Yep I am definitely a huge fan of circuit as well. Oh, that's a neat trick I like this trick. Thank you Todd bot. I'll show this one Circuit with circuit show you can also combine it with grep if you're on Linux or I think mac probably has grep as well. I don't know as much about windows I assume there's some kind of grep on windows But you could run circuit show and then pipe and then grep in the name of a library Or you know a word that you think is in the name of a library and it will actually find it for you So if you know that this is the type of sensor you have lis 3dh But you don't know the name of the library for sure You're not sure if it's like adafruit underscore lis 3dh or not You can always do show and then grep and find whatever the term that you do know in order to look for it Let's see question for catney in the chat from dexter. How many guides do you write in a week? So I just pulled it up. It's We have a graph in the admin panel for learn that shows the number per month And it has been anywhere from three or two up to nine So I guess I would say per week anywhere from one to Two or three Depending on the week Yeah, it ebbs and flows with new hardware and stuff like that as well Exactly And and I will mention as well for folks that might not know catney works on a lot of the guides for the new hardware So like if a new sensor is coming out or a new feather, you know, a new main device microcontroller, whatever it is Like we mentioned before there's going to be a guide created for that and catney does a lot of work on those guides So she is probably making more guides than most of the people who do author them And liz has actually started doing some new product guides for breakouts So she will also be helping out with that. Nice And let's see ask patrick w dropped an even better hint in the chat Which is you don't actually even need to use grep, which this is new to me I didn't know you could do this but you can go circuit show And then like lis 3 for instance And it will actually find it for you. So in this case, there's actually a couple of different lis 3s The 3 3 1 the 3dh, which is the one we were looking at and the 3 mdl Um And this is actually really cool because this means it doesn't matter if there is a grep or what the grep on windows is Because you can actually just do this straight from circuit by itself circuit space show Space and then your search term whatever you whatever part of the library name you think you know So thank you ask patrick w for mentioning that that is new to me and that is amazing I Love the factory. Hello from colorado Let's see Select string. I'm not familiar with select string in windows. You can install grep. Okay Guys are super useful. Definitely agree with that Is typing and doc markup required or recommended for the community bundle contributions is a question from seagrover Uh Do you want to take a stab at that or I can answer? So you're referring to um the type hints. I assume that we're doing on all of the um On all the circuit our aid of fruit circuit python libraries I think so and uh things like doc strings as well that go into the Sphinx documentation pages so It's not required because obviously how you want to maintain your own library is up to you But part of the reason why we updated our cookie cutter to have a community bundle Version is so that you could still generate a library. That's very much like an aid of fruit circuit python library in in form and function and um, I believe Uh, you can set up read the docs on your own and use things to publish to your own read the docs in which case you would definitely want um Doc strings and markup and so on in there because it things builds out of your code it builds out of your doc strings So none of that is required again because it's it's a community bundle It's meant to be for the community by the community and we don't impart rules on it per se But we do make it easy To be able to produce a library similar to an aid of fruit circuit python library And I recommend documenting your code no matter what um And documenting it in a similar way to the aid of fruit stuff provides A good, you know set of information for folks who are coming new to the library Yeah, definitely and I can confirm too individuals can set up read the docs I have my own read the docs accounts and just like cat new was saying If you do run cookie cutter, which we'll take a look at a little while later But if you set your library up in the same way that the official ones are created You can reuse tons of great automation and infrastructure that will Automatically build your docs out of your code just like she was saying and Publish it right up to read the docs live So it takes a bunch of the manual steps out of the works and you can do all of that stuff very easily Let's see Format doesn't match. Yeah, so this format in py format doesn't match if you see that that means that you have A different version of circuit python than the version that that particular mpy file is expecting so It's not with every major release, but with some of the major releases of circuit python the Kind of like version of the mpy compiling Gets changed and then the old mpy files no longer work with that newer version of circuit python so That error that you have there basically means that Either your version of circuit python is too new for a library that you're trying to use Or vice versa your circuit python version is too old for the particular Library that you're trying to use that particular mpy file So you have a couple options. You could either update one or the other Or you could go back and get an older version if you really wanted to You could go find the older version and run with that instead of the newest one, but it's definitely based to update You'll get an error like that in your In the serial console as well If you if you log into the serial console and you're trying to run An mpy that doesn't match the version of circuit python the error is very similar and that's exactly what it means So if you ever run into that Take a look at what version of circuit python you're using and what version of the library You think you're using and update one of the other is tim said A couple folks on youtube have confirmed for us on windows You can it looks like somebody did successfully use grep and then there is also a pipe more I guess on windows for doing piping as well. Let's get tip for folks that are on windows For sure. Yeah, you're welcome. See grover. See I think Here but beyond libraries. Have you considered hosting a linked collection of community circuit python full projects? That's a good question. I would say The closest thing that we have today to that is probably this awesome circuit python Awesome circuit python. This is basically a curated list of Cool stuff that involves circuit python. It could be a project. It could be a library. It could be Books codes frameworks newsletters art social media all of these different things Get listed inside awesome And so I think this is not I don't know for sure, but I want to say that this idea of awesome Something is not something that started with circuit python. Do you know if that's right? It is absolutely not something that started with circuit python and in fact To be able to have that awesome tag and have an actual legitimate awesome repository you have to fit a certain set of criteria And based on the original Whoever it is that put it together. I'm not sure about that but It it actually required quite a bit of work to get that accepted as as a as an awesome repo and Have our awesome circuit python Like it is now Nice. Yeah, there's tons of great stuff in here every now and then I'll come to this repo and just start clicking through And like every time I start clicking through here. I find something that I didn't know about before so There are so many cool things inside of here So this would be one place that you could link projects like community created projects The other one which I'll mention is the weekly newsletter every week on uh, Tuesday There is the python on hardware newsletter that gets mailed out to a mailing list You can sign up at adafruitdaily.com if you want to sign up for that And in that newsletter, there's a section called news from around the web, which is where It lists out just projects from all over all over the community projects submitted via twitter Via discord in the show and tell room Via email you can email in your projects all these different ways you can reach out And have your own projects or projects that you found out in the community submitted The newsletter of course is weekly so it's not one master list You know one big list there is a repository where all of it's stored inside of there And you can actually click through them, but they're kind of separated up by each week um and a huge shout out to ann Who not only put together the original awesome circuit python, but puts together the newsletter every week Yeah, definitely Is there a way to know which version of circuit python a particular library is compatible with? I don't know for sure I mean there's definitely a way to know if it's not compatible because it will print that error message that you showed A little while back. I think that was you who pasted in there gordy But I don't know if there is a good way to actually check which version it needs so we very rarely And and basically almost never it's only happened once Uh published libraries that are not compatible with the current stable version Of circuit python and if there is a unstable version of circuit python that doesn't match There would be two folders in that bundle zip Um that you download and it would show You know, this is compatible with circuit python 7x and the other folder would say something like this is, you know circuit python 8x If there is a reason for there to be a difference There was one library once that was written that was compatible only with the unstable version I think what we ended up doing was actually sort of backporting it to make it Uh compatible with the stable version because we don't have a mechanism To have libraries that are not compatible with current current versions So you can pretty much be safe if you're downloading the circuit python that the bundle folder has the number on it You can pretty much guarantee that those libraries are compatible with the version of circuit python that you're using as long as you're up to date Yep And ask patrick w also mentioned in the chat, uh, if it basically if in doubt update, uh, which is I would basically mimic that that, um Advice, uh, so if you go to circuit python.org and whatever particular device you have if you get the latest stable version Which is the top one linked right here If you just always keep your device on the latest stable version And you always grab the newest bundle or you run that circuit update command Um, you should be guaranteed to always have libraries that are working with your device If you're ever on the latest stable version and you're installing from circuit or you're installing out of the bundle Um, and it's not working for you Then definitely that's something that you could report because that's definitely the intention is the latest versions of the libraries Will always be built inside the bundle and on the release pages They'll always be built with the mpy that is meant for the latest stable version And uh, be aware that very new products may not have um a stable version It'll only be the unstable version and that is just that is what the latest circuit python is for that board But that's only for super new hardware And I I think that error might have been telling you that the pre the version you had previously installed Is the one that's out of date if you get it to install the new one it should be good But if it's not again, I would say let us know maybe over in the help with or in the circuit python dev If you could point us to uh, which device you're using which version you have maybe just paste your boot out dot text That's usually the easiest thing to do um, and then uh, tell us how you got the library if you installed it with circuit Or if you got out of a bundle just link us to where you got it from Uh, because if it is actually not working with the latest one, then we definitely want to look into that and get it fixed up Swedish version nice Yeah, I do like grabbing the different uh, the different languages sometimes I grab pirate a lot But I do Swedish sometimes, uh, I've had russian install on my device for a little while because it's one of the bigger ones Um, just happens to be that the language is bigger See All this fails after updating the latest table. You can remove all libs and use circuit to reinstall them Oh, that's a good point as well zarnolin. Good tip Uh, that's definitely a good thing if you're ever having a weird issue with your library where it seems like it's not working Um, I would definitely recommend go to your circuit pie Drive go to the lib folder and delete the old one So like if you're having trouble with you know, the logging library go in here and just delete this Delete it. It's gone now go to the bundle and get the new one or use circuit and install the new one Um, especially if you're mixing the mpy files and the regular, uh py files It it sometimes it will leave extra copies of one or the other and it it takes the pie The dot py files are kind of like higher priority So, uh, if you have both then it will use the dot py one So if you are in py ones are the latest ones, but your dot py ones are older And sometimes you have trouble you're actually using an older version of the library Even though you do have the newer one on your device So if you just delete it and reinstall it, um, then that takes that whole You know that whole, um Possibility off the table you never have that problem if you just delete and reinstall And to throw another wrench into this um, if you put a library in root of circuit pi So just on the circuit pi drive not in the lib folder. It looks there first That was put in place for testing purposes So if you are modifying a library or you're working with it, you can put it in root and you know, that's the one it's using Uh, but if you have an older version in circuit pi then you do in circuit pi dot lib Um, it will try to use the older version So one easy way to deal with that is just to simply always put all your libraries in the lib folder Then you won't run into that issue yep And Dexter asks, why do you have both pi and m pi installed? That would be if you're modifying one library that has other dependencies and so you are You know, you have the dependencies logged or in there as m pi files But there's one you want to work on you would need the pi file for it. So that's one example of What you why you might have both? Dot pi and dot m pi. Yep. Yeah, oftentimes like end users who are just making projects Generally, you know, the main bundle the first bundle that's linked on the page as well as the first thing that Circuit will install for you is the mpy version Usually the folks that end up having the dot py versions are folks who are trying to develop Either test out like pull requests for the library or Develop new features for the library or maybe they're having some problem with the library that they're trying to troubleshoot You can load the python version the dot py version And you can add print statements if you need to try to see like, you know Where things are getting to where things are going wrong if you're having trouble So usually that's when folks end up having the dot py versions Yeah So next up we talked about mpy a couple of times and this slide Calls out more specifically what mpy is. So when we say the mpy version of the library We're talking about the version of the library that's been compiled with this tool that's called mpy cross mpy dash cross is the name of this tool and this is also a command line tool So it's similar to circuit, you know, you open your terminal you run a command This one is not installing libraries, but it's compiling python files into mpy files And there's a couple reasons we do this the main one is kind of like back to uh, I think it was Slide one slide three here where we're talking about why do we have all these libraries because we have limited resources on the microcontrollers Um, you know, again, there's not a whole lot of space. There's not a whole lot of ram compared to traditional computers You know, if we can squeeze these libraries into smaller files, they take up less of the storage space They take up less of the ram when you import them and use them and both of those things are very very good When we have such small devices, right small amounts of storage and ram I'll show you, uh, so let's link here to mpy cross if you're interested in mpy cross it is published on pi pi so you can install it with pip Um, it also I think is linked as a sub module inside the core repo You can build it inside of there if you want to build your own binary to run it on your system And i'll show you real quick how this works. It's super straightforward. I actually have this other library Opened up right here This happens to be a library that I was working on recently for a pull request. This is a vc zero seven zero six I think it's a camera if I recall correctly But the actual specific library doesn't matter too much what i'm going to show you is how you Compile it and it's actually really straightforward. You just run once you get mpy cross installed You can just run that command mpy cross dash o for the name of the output file So in this case, usually what we do is we just use the same name as the library This one is called eta fruit underscore vc zero seven zero six dot pi So we just use the same name but dot mpy instead of dot pi And then that other argument that last argument there is the name of your input file So if we run this command, that's all we have to do If I let this refresh over here, then you can see right away. We have this mpy file that showed up And if we go and look at this what we'll see The python version is a nine point four kilobytes and the compiled mpy version is 2.3 kilobytes. So like less than a third The amount of space that's going to save your storage space and your ram when you go to use this library So it's really really great to be able to compress this down smaller um So naradok pointed out that the one on pi pi is a micro python version and it doesn't work with circuit python Thank you for so definitely build Out of the circuit python core if you do want this tool That will get you the version that works with circuit python. Yeah, thanks. Thank you for the heads up I didn't realize that that's definitely a good point though. I apologize for pointing folks to that wrong place But yeah in the circuit python core, I think you can run the the command like make space mpy cross And it has all the like build files and stuff in there. It will build the circuit python version I actually didn't realize they were different. That's good to know Uh, let's see here PY file, so I showed how to how to compile it with mpi But I also wanted to point out like how we actually do this at scale across all the libraries, right? Because You know, like we talked about before we have 350 libraries Um, it would not be very very easy if somebody had to like open up all of the 350 libraries and run this command on them So you can do individual files like this Especially if you're writing your own library or even if you want to mpy cross just your project code You can do it like this the way that we do it in all of the uh, Adafruit libraries though is we actually use uh, github actions, which is a A feature of github that allows, uh, automated stuff to run whenever There are pushes or new commits added to the repository. So inside of The workflows folder dot github and then workflows. This is where you put your your github actions configurations We have a particular task called build assets. This is in the release actions So this one runs anytime that a new release of a library is created We have this build assets task and it will actually run This circuit python build bundles and it will pass a couple of arguments in Circuit python build bundles actually goes inside of circuit python build tools. This is another Adafruit library. There's a or this one is a repository. It's not a library meant to be used on devices But it's a repository that holds infrastructure Helpers command line tools and different modules and functions that do different things Inside of here though, it is ultimately just calling that mpy cross command with the dash o the same way that we did it This is all just happening automatically though on a virtual machine that github Spons up for us whenever that release happens It it runs all these tasks and it automatically creates the mpy file And then what it will do is it will just attach it to the to the Release page. So if we go find Just a library. It doesn't even really matter which one it is But if we look at a library and we go to the releases page here Under the release there will be assets and then right here. There is a copy of the mpy zip The py zip if you want the plain text version And then there's also a separate one for the examples and a couple of other infrastructure pieces like a json file That has some information about this library And a z tool z build tools version and things like this So it uploads a couple of these things including the mpy version So it automatically builds it and it uploads it right to this page And then this also kind of is what triggers that nightly build of the bundle So whenever the whenever adabot runs overnight She will notice that this library has been updated And you know it will trigger it to build the new version of the bundle And release that overnight so that that way the next you know starting the next day folks when they download that bundle will be getting the latest new version Let's see here. I was in the pdf instead Yeah, I think that's it for mpy files, you know for all intents and purposes They work the same as dot py files when you want to load them on your device you just copy them into that lib folder Just like you would any other library and if you do use circup it will automatically install the mpy ones My guess is there's probably a command like an argument to do the py ones. I don't know for sure But I suspect that's probably the case A quick difference is that you can't actually read an mpy file Yeah, um It's it's compiled. So if you Are looking for a want to look at the code or a particular feature of that library You'll need to look at the dot py version Yeah, yeah, really good point if you do open up the mpy as text You just get all this gibberish stuff that doesn't really doesn't really tell you much Whereas the py file that's plain text you can just open that right inside of a text editor I want to use adab necessarily but And this is all just plain text python code regular old plain python All right. So next up we have I think frozen. Yeah frozen libraries. So This is actually one of the things that I it took me a little while to understand the difference between these two things So I thought that was a good reason to include this slide and kind of tell folks about it So we have compiled libraries mpy versions of the libraries We also have what are called frozen libraries libraries that are frozen in to circuit python builds So these are libraries that are actually included in the the circuit python image that's loaded on a board and these actually get Put into that circuit python build automatically Copy this link as well And this is when There are boards that when you use libraries for them Results in a memory allocation error, which means it runs out of memory The frozen library is if I understand it correctly don't um get loaded into ram um And so for example circuit playground express is a very popular board And there is a circuit playground library that has all the features of The circuit playground express and the blue fruit in it However, if you try to use the circuit playground library, uh directly onto the board It will run out of memory pretty much automatically and so we froze into the circuit playground express build The circuit playground library and all of its um dependencies And that way it's it's twofold one It's a great experience because folks can plug in that board and begin coding immediately with the circuit playground library And not have to load anything um But the the real reason for it was that it just doesn't work if it's loaded directly on the board for the blue Fruit for example all of those fit just fine. So there's no there's nothing frozen into blue fruit But specifically for circuit playground. That's an example of a board that has all of the libraries Uh necessary for the circuit playground library frozen in Yep And this link that I dropped in this is inside of the core repo the actual circuit python core repo So this is when when you load a circuit python uf2 file um This is where it came from it got built out of this repo And so that particular place that I linked to is inside this frozen folder And this one is also one of those get sub module things So all of these things listed here are all get sub modules, you know, just different repositories linked in These are all the libraries that are frozen into any particular build But it's important to note. These are not frozen into all the builds So just like catney was talking about a minute ago, um the circuit playground libraries Those are frozen into the circuit playground express but not like the circuit playground blue fruit for instance And then of course definitely not for like a feather or a metro or any other kind of device Um, so this is where the frozen libraries live. They get copied from here when you make a build But I did also want to point out where they actually do get attached to a particular build So we're diving a little bit deeper here But if we look inside the core and we go find a specific device like let's say the circuit playground makes a good example So you go into your port you go into Boards and then you find your particular board. So if we want the circuit playground express There's actually a couple of different variations of this one Which is again, you know due to that same issue of limited space Some of these other libraries required for like the cricket and for display io are much bigger And so there's different builds in order to accommodate, you know, using those features Inside of this make file There's one of these make files for every single board that circuit python supports Enlisted at the bottom of this file is all of the frozen libraries So you can always look here to see which libraries are actually frozen in to a particular Device so this is a great place to look if you want to know, you know, what batteries are included So to speak for any given device Let's catch up here if mpy are incompatible between micro python and circuit python Perhaps it should be cpy cross In a dot cpy file possibly I don't know when or when or where or who that made that decision truthfully I actually didn't realize until just now that they were different I'm grateful for near doc pointing that out. Otherwise, I would have been Continuing to point folks in the wrong place Uh in that docks area where all the libs are there's a page that lists the board Oh, nice. I did not know. Oh support matrix. Okay. I didn't know that this was listed in the support matrix Let's pull this up real fast. Thanks for linking this by the way as Arnalyn I'll show folks this page. So yeah, support matrix. This does show you All the different modules that are available for a given board. So like if we go to circuit playground express for instance Um, you know, again, we see the different builds the cricket version the display i o version Uh, and then the regular version without any of those and you can see all the things listed here Although I do think uh, these ones are built in modules. Yeah, those are all built in modules. There is no Uh documentation that lists the frozen modules. Yeah That I'm aware of. Yeah, the make this is the only place. I know to look for it is the make files This one will show you the built-in module. So all of these modules are They're not libraries. They are built into circuit python. They are Modules inside circuit python, but they can still be included or not included on any particular build So some of the larger ones like display i o for instance Get turned off on some of the smallest builds some of the builds that go on the devices with the least amount of Ram and storage We turn off all kinds of stuff. Um keypad for example is not turned on for circuit playground express either um, and it's basically What what we end up doing is when we add a new feature to circuit python We build circuit python for what we consider to be the smallest boards And the largest translation because that is basically the situation where we need the most space and when it Basically it does what's called overflowing um, the build is too big to fit on the board and so then we will go back and say, okay, what is crucial What do we really need? What can we turn off? um To basically make a build that's that's functional for each board And so sometimes we'll turn off, you know, any number of things to make a particular build um possible For uh a given board definitely Yeah, especially the smallest ones the m zeroes like a samd 21s especially Those tend to be kind of the smallest devices that have the least amount of space and ram so Trinket and gemma for example because there's not even an express chip on there. Yeah Yeah, those ones are like under a meg Of storage, I think if I recall correctly So you you really have to be selective about what gets included or not Some of the newer stuff like the samd 51s or even like nrf 52 8 40s or especially the rp 20 40s Which is kind of the newest main chip There's tends to be much more resources on those more storage more ram But it doesn't tend to be as critical to try to cut stuff out of them um And then the last thing I wanted to mention though is like if you want to if you have a particular project where your project does use Uh specific libraries and you want to save space like this you can actually freeze them in yourself So you could go get the um circuit python Core repository you could come to that make file for the device you're using and you could actually add your own stuff in here If that library is already inside the frozen folder, then you don't need to do anything besides add it to the make file here And then make a build But if it's not in the frozen folder already then you need to copy it into there either add it as a sub module Or even copy paste it if you just want to do a quick one-off build On your on your local copy there, and then you can add it inside the make file after that and make a new build with it Uh contributing, uh, so for folks that want to get involved with helping us develop libraries testing out new features of libraries Um, this is what this page is all about. So, uh, again, you know, there's a very helpful learn guide for this that I'll link Build the one box. I need to remember somebody one day showed me the right way to make it not one box But I don't I think it's like wrap it in single brackets or square brackets or something Ask patrick any common issues you've seen or suggestions for people that want to make a new library So I don't know about common issues per se, uh, especially with, um, cookie cutter now being Viable for both, uh, Adafruit circuit python libraries and community libraries. It it gives already a very good template And there's a lot of to-dos in it that show you what needs to be updated inside that template And Once we got that in place. I think it became a lot easier for folks to contribute, uh, because It it creates, you know, like I said a template that that you can use to then generate your new library um Suggestions, I would say like start with the most obvious feature So if it's an accelerometer start with acceleration And just get it working get data and once you've got data you can you know that you've got it sorted out how you read that register Um, how that register affects the data and what needs to happen for data to be pulled from that, you know from that chip and and go from there, um The you're going to get if it's if it's for hardware you're going to get deeply involved in what's called data sheets And uh data sheets have all the infer- well If they're good data sheets, they have all the information you need to write a library if it's not a great data sheet of which there are many Um, you may not have very much information at all. And so you'll be trying to figure things out on your own. Um I don't recommend starting with anything that has a really sparse data sheet if it needs one um as for helper libraries and so on um the way that I learned and the way that I wrote the circuit playground library was to actually write code in in code.py that did what I wanted to do in the library and then Move it into the library and sort of for lack of a better word library of fire Um, which means adding the you know the actual syntax For it to work inside of a library and I would get that function working in the library Test it out and then add it and then the next thing I would do is pick the next feature that I wanted to add I would get that going in code.py And and repeat so helper libraries you can often start in code.py and make sure that your code works And then get it working in the library and perhaps um, you know simplify it or or turn it into a couple of different functions If that makes sense And so on and so forth. Um, and that is true what what zarneland said, uh, you may have to translate data sheets There are definitely data sheets that are not in your native language Yeah, definitely and I will uh give my my stamp of approval as well on starting your library in code.py So for folks that have watched the deep dive before or if you watch my streams on saturday mornings I also stream a lot of times what I end up working on our display i o helper libraries And that is the exact way that I start them. I will start writing my code in code.py first Um, you know get things working how I want and then kind of refactor it over into its own file in a library Yeah, and there I will mention also a quick sneak preview. I guess of the of the last slide here There is some information on creating libraries on the last one. So we will get to a little bit more as well Um, I'll pull up this learn guide page though. So this is for folks who want to contribute to existing libraries Um, this is this one is less about making new ones and more about Contributing to the ones that already exist, but we'll talk about creating them on the next page as well So just like with everything um, there is a learn guide for it. So this learn guide here is how to contribute uh with Contribute to circuit python with git and github. This one is written kind of in the context of contributing to the core Partially, but the process is pretty much the same for contributing to libraries. So uh, this guy is It's written. It's written to contribute to the library. Oh, I got you. Okay. I'm just yeah No, no, no, it it will apply to the core as well. Uh, however, the the actual examples are, um, applied to a library Nice, okay And I I reference this guide all the time. There's lots of stuff this one in the another guide that we'll look at in just a minute the uh, the sharing Sharing your library guide I reference like constantly while i'm working on new libraries Um, this one will show you how to get set up with github How to do things like, you know, add your files into your repository commit Push them and then make pull requests, right? This is the process that you go through when you want to You know, essentially offer up a new change to a library To give you a quick sort of breakdown timeline of how that works So like let's say you want to add a new feature to a particular library You're going to go to github. You're going to clone that library down to your computer That's basically just downloading a copy of it But downloading it in a special way where you're going to be able to push it back up to github You want to make a fork of it? I probably should have mentioned first make a fork of it is going to be Basically making a copy of that library under your own Github account So all of the libraries all the eta fruit ones are hosted inside of the eta fruit account If you're making your own Update to a library then you'll fork it which is basically going to make a copy under your own account So like for me, I would fork a library and then it would make a copy under github.com slash foamy guy So you make a fork then you clone it that's going to download it to your local computer You make your changes to it so code up whatever new feature you want or code up a bug fix or anything like that And then you're going to commit it and all these steps are laid out And it shows you how to do them on all these different pages here But you you commit it and then you push it that's going to get it up back into github But it will be under your own account So that's going to push your updated version into your copy and then from there you do what's called making a pull request You go back to the eta fruit version of that repository and you create a pull request that says hey I created this new feature and I want to you know suggest that we add it to the main library So you create that pull request And then that kicks off the review process some of the circuit python librarians Which is the review team. They will come by they'll see your pull request They'll look at the code changes. They'll test it out. They'll decide, you know, if there's anything that needs to be changed from it You know, they'll work through it with you through that review process Let you know if there's anything that you need to change before it's ready or anything like that And then finally once everything is looking good and it's been tested and everything is good to go It will get merged in and so at that point it's basically adding You know your changed version to the main real, you know, central eta fruit version of that repository So that merge will then bring your changed code Into the official library so that everyone else gets it whenever they download that eta fruit library I will add one caveat There for the libraries that are frozen into of various circuit python builds We're very careful about adding significant amounts of code because it does increase the size of the circuit python build And sometimes makes it too big for a given board So if you are concerned about that one thing you can do is file an issue on github and ask You know, I want to make this change. Is this a good, you know Change to submit and then one of us will be able to reply to you and tell you like You know, maybe not because this is a frozen library Or say maybe so because It's you know, it's not and it's it's an excellent change and so on and so forth. Um, but don't feel Never feel bad if it turns out it's a frozen library and we can't actually accept the change because it becomes too big We often suggest making helper libraries That contain new features or advanced libraries that contain new features that can be added To boards that things aren't frozen into definitely a couple of questions that came through on the YouTube side axl asked If you get an error like in a trace back So you're running your code and it it raises an exception It crashes and you look in the serial console to see what the error was Inside that trace back it will say something like, you know line number of 130 is where the problem occurred And then it will tell you what type what type of problem it was And so the question was basically if you're using the mpy version of those libraries Will that line number be accurate since the mpy version is compiled all those lines are not technically In there we saw I opened it up in the text and it was all kind of gobbledygook stuff Um, but to the best of my knowledge the answer is yes that line number I have no idea how it works, but somehow it is able to find The correct actual python line number So even if you're using the mpy file if you go and look at the plain text the dot py file The line number should match up in the trace back It should point you to the correct line inside the python file even though it's actually using the compressed one Or a compiled one I should say Zarnalyn on discord asks can you have other dot py Dot py files in the root that you import in your code so that you don't have a big monolithic file? And yes, definitely you can so you can You can refactor your own code into separate py files Sometimes people will even put like all of their main code in a separate file And then inside code py it will just basically have like one line that says import this other file Some people like that workflow. You can do that You can have a higher level thing where there's some projects where it's like a project switcher There's one of these I think for mag tag in the learn guide system if folks want to find it in there where You you kind of keep different projects all in their own python files and then inside code py It has some logic that has a couple of buttons or something like that that allows you to select Which project you want to run and the way that that works is basically exactly like what you're talking about Those projects are in their own files and then inside a code py it imports them from there, which causes it to get executed Oh, yeah, great question Secret stop pi is another good example of keeping stuff out of your code pie, but still being able to use it in your code Howlet pi i'm not familiar with or localization really Ask patrick links some good reading for mpy files. Okay So let's see getting back to here. Yeah, this is a great place to go If you do want to get started contributing to libraries if you want to make changes and stuff like that Also, definitely encourage you to to join us on the discord lots of the folks in the chat here Obviously are already on the discord, but for folks that are watching along and don't know There's also a circuit python dev channel Which is where we Talk about all things related to development both the core of circuit python and the library So if you want to get involved you can head there and go to the circuit python dev room And just hang out there read what people are working on, you know ask questions put what you're working on All of that kind of stuff you can do Let's see here Okay, so we talked about the process for contributing the you know part of that process is the review process Um, and I have a separate link here, which is actually just a sub page of this first guide But I figured it'd be good to link to it directly as well. So this page tells you about the review process Move embeds I'll do that and then I'll show you an actual live example of this I was just working on a library this week and it has some reviews on it So I'll pull that up as well and we'll take a quick look at it But this is the page that's talking about giving a review So this is actually another way that you can help get involved if you if you're not quite ready To start making your own code Um, this is something that you can do even before you start You know actually writing python code and contributing to libraries is you can review You can go and look at the open prs I'll point out a good place to find those is on circuit python.org Under contributing right here Here is a list of all the open pull requests So you can click the links on this page in order to go into the pull requests And then you can actually leave the reviews in here So this one happens to be a draft But this is what a pull request looks like on github and there's a place to leave comments down here And this is what this is what reviewing is you basically come to this pr page You put um, you know, you try out whatever it is you look at the changes, you know, look at the code here You download this this particular branch this proposed change download it run it on your device test it out Look at the code changes, you know find typos even documentation things like that all all of that stuff is Just as important and just as helpful as writing actual code. So you look through here and then if everything looks good There's this review changes right here, which has an approve inside of it You can leave an approve you can put a comment if you want Or if you find something where you think maybe it should be changed You could do a request changes. So you do request changes you type in you say, hey, you know I noticed a typo right here on this particular line I think we should change this word to something else or whatever and you could leave that as a comment here Then the person who made the pull request will get a notification that says, you know, somebody reviewed your changes And they left you a requested change for something else that you should do Um, yeah, Todd bot. I definitely second what Todd bot says, which is testing prs on the hardware is always very much Welcome and appreciated for sure That's that's one of the easiest things you can do as like a community member to start getting involved Is just load up these pull requests and if you have the hardware for it, you know download it and run it on your device Um, not only is it helping us out by reviewing the pull requests, but it's helping you out because you kind of learn Honestly, that's how I learned a lot of what I have Amassed about circuit python is doing testing like that You know people either bring problems into the help with room or people Um, you know submit pull requests like we're talking about and I will go and test out those things and try to work through the problems with them And um, this is a great way to learn. Um, You know learn all the different things that you need to know to get into this stuff That's reviewing and I'll pull up this one. This is one that I just worked on recently if anyone is interested in a specific example This is that vc 0706 the library that we were looking at earlier And this was a pull request to add typing information, which is one of the More recent sort of efforts we have across the libraries Is adding typing information to all of them. So this is one that I filled in I created the pull request I went through that whole process that I talked about before forking and and committing and Making the pull requests and all that stuff and then tech trick who we mentioned before as well Who's been doing lots of great work across a bunch of libraries? Was kind enough to review this for me So he found a couple of things that I didn't do correctly the first time Which is awesome, you know more folks looking at this means more chances that we're going to catch those errors those bugs before they get published So tech trick looked this over found a couple of places where I should have done stuff differently left some comments You know those requested changes about it like hey, this one could be a different type That sort of stuff and then I went through found all of their requested changes And then made them pushed them asked them again, you know, hey when you have a chance Can you look over this again? And he did so, you know, he came back This was even earlier today and came back and approved it So now these changes look good. They're ready to be merged or if you know we want to get more reviewers We can have more reviewers look it over as well Good first issues I'll point out as well. This is a great place for folks that do want to get started This is kind of once you're past The reviewing stage and you actually want to get started writing your own code and submitting changes This is kind of the next level up basically And this is the the good first issues. And so this is again on circuit python.org contributing And then this is over on the open issues tab and then there's a drop down right here That has a couple of different labels or categories of issues And I went directly to label good first issue In my address up here, but you can of course just pick whichever one you want out of this drop down Good first issue is where we put all the ones that are kind of the most basic These are good for folks who are just beginning to get involved in circuit python You don't necessarily need a huge You know a huge amount of experience with python or circuit python These are things that are relatively easy to do And of course, we're always willing to help folks in all the various different places You know either on github or in the discord if folks want to tackle these things And you need to know more in order to do it You can always reach out in those places and we're happy to help Lots of the good first issues that exist right now are these typing annotation ones like I was just talking about Or was it hacktoberfest we we created all of these issues for The type annotations across all the libraries we created like two or three hundred of these open issues We've actually gotten a fair number of them knocked out and tectric again I will say huge huge thanks and hug report to tectric He has done a bunch of these things. I think we're down. I think we have like a hundred or so done The number is not listed on this page. I saw it somewhere the other day though, but we're Narrowing in we certainly still have a lot to do but we have knocked out a huge chunk of them But this is a great place to start. I also recently published a video on youtube that shows the process of adding these typepins to the library So if you're interested in getting involved in this way, you can check out that youtube video that I added types to that vc 0706 library in the video and showed you you know going through it and how I how I found the types how I Typed them in what syntax to use all of that kind of stuff And another thing is we try to make the good first issues As thorough as possible so that you don't have to really understand much to be able to actually Complete it including. I just created one that has exactly what the fix is in it Um because I didn't have time to complete the fix, but I think it's on matrix or I don't remember um It was a documentation issue, uh, where sphinx was not Um, oh it's right above it. It's in macro pad nice That's it right there and it has the fix in it um And basically says if that's not clear here's how to do it So that good first issue is a good example of one that goes through and actually explain Then all the typing annotation ones are pretty thorough as well where they explain exactly what needs to be done um And that way, you know, you don't have to exactly figure anything out you can just go in and and do what's explained and Complete the fix Yep Yeah, so if anybody out there is new and wants to get involved This is a good A good one to start off with trying tackle if folks are interested in that and again If you need help you can reach out on the discord or or leave a comment back on that Issue there and we're always always going to be happy to help folks out Um, which gets us to the last couple things that I had pulled up to talk about which is creating and sharing your own libraries So we talked about contributing to existing libraries. Um, this is more about creating your own new library So if you have an idea for a library and you want to create it and submit it either to like the community bundle Or if it's for a piece of eta fruit hardware, it could get submitted to the eta fruit bundle Um, this is the stuff that is going to help you do that. So Uh, first thing I have is a link to again yet another learn guide. There's a learn guide for everything Uh, this one is about creating and sharing a circuit python library And again, it's got a bunch of these different pages that walk you through the the entire process It'll help you get everything you need installed. It will tell you exactly what commands to run exactly how to do everything Explain in detail what each step is going to do and and um, you know, how they all work together to end up with a nice Library at the end of it, which you can then push on to github And then the process of actually adding it to the bundle is actually just creating a port request So the exact same way that you submit a change Uh, for a particular library, uh, which is creating a port request You do the same thing if you want to add your library to the bundle Um, this is a great guide again. I am constantly coming back to this guide and referencing different stuff in it um A couple of the things that this guide talks about are some of the sort of ancillary tools that we use In all of the eta fruit libraries Things that get run automatically by the github actions. Um oftentimes this is referred to as ci continuous integration I think is that Acronym, this is basically those tasks that run automatically whenever you make a commit or whenever you make a release Those are all powered by github actions And we use a couple of different tools for all of our libraries to keep them, uh, all similar and um You know up to like up to date and just like the same across the board as much as they can be so We have it run, uh, both pilot, uh, which is a utility that kind of Looks for python code that is not as good as it could be There are certain best practices where like you can code it this way, but it's actually, you know, it's better to Code it this other way Uh pilot basically is an enforcer tool that goes through and um and does that I think the name lint Is like shaking the lint out of something or you know turning your pocket inside out to get the lint out of it Um, I think that's kind of where the name comes from Um and so pilot gets run and if if pilot reports any problems with your library Then you you know you go through and you look at each problem and you fix it sometimes it'll just be like Hey, uh, this variable could have a better name or you know, there could be uh You should use parentheses here or you shouldn't use parentheses here or something like that So pilot will do those checks and then there's also the black, uh, code formatting So this is a python code formatting tool You run this tool against a python file And it will go through the file and basically reformat it to a standardized format It will add new lines wherever it needs them Uh, it will break things into multiple lines if it needs. Um, there's you know a bunch of different rules again best practices so to speak The folks who created this project decided, you know, this is the way that you can write your python code to have it Come out the most manageable basically and so this enforces all of those rules And these are two of the things that run On all of our libraries and uh, what we do is we actually use this other utility called pre-commit, which Allows it to run all these things at once. So Pilant and black are the individual checks, but then pre-commit kind of compiles a bunch of those checks into one command And runs them all at once and then spits out the output for you So I could actually very very quickly. I could show you pre-commit pre Also note that black doesn't do functional changes Um, it's only formatting changes and at times Uh, Pilant will actually require functional changes. Yep. Yeah, good point. Yeah, ideally. Yeah when black runs The code will change, but everything will function the same whereas pilant like, you know Pilant might tell you to change a variable name, for instance, and of course you would need to change that variable everywhere where it appears And so you can see here we run pre-commit and it runs all the checks We have a couple of different ones including the black and the pilant like I talk about We also have a couple more in there like reuse is checking for licenses There's one that checks to make sure that there's a empty line at the end of all the files All that different stuff happens inside the pre-commit checks And then the the last thing I had pulled up to talk about here was the the cookie cutter, which I think we've mentioned a few times But for folks that don't know cookie cutter is a uh, it's it's an external project So Adafruit did not create cookie cutter. This was created by a person out there in the world They created this project called cookie cutter and what it allows you to do is basically Templatize your own project. So you create a set of templates That include all of the basic things you want in your own projects And then you can run a command and it basically gives you a bunch a series of questions Like yes or no, do you want to include this thing? You know, what you know, what name do you want your project to be? What's the name of the author all of that sort of stuff? It goes through a list of all these questions And then at the end once you have answered everything It will actually spit you out a Built library. So obviously it's not going to have the code in it. You still need to write the code yourself But all of the sort of meta files the the stuff that runs github workflows The the license files the hooks the tests the examples directory that getignore files All of the sort of meta stuff that we include that's not necessarily like specifically code This will actually create all of it for you So this is a super good way if you do want to create your own library And you want to take advantage of all the infrastructure stuff that's set up like the github actions The docs building that gets pushed up to read the docs all that sort of stuff If you build your library with this cookie cutter tool You'll get all of that stuff for free essentially you answer all the right questions during the prompts And then you don't have to worry about going out and actually finding all of these different things and copying it in And your library will be set up the exact same way as all the ones that we build and put in the the Adafruit library bundle as well And I'll show you quickly I think we can even run one real quick. So I'll And again, I reference this page all the time. So I don't actually have this command memorized, but I know where to find it Which is on Creating a library this page actually talks about cookie cutter and all the different files it creates So if you're interested in all those specific files, there's a big list of them here You can look through this page also has the command on here Down here. Here's how you get it installed. Here's how you run it. This is another command line tool So you just copy it out of here or maybe this is easier Run it in a terminal. Uh, I will just doesn't really matter which terminal we run it in Go up to here We'll paste it to run and so it just asked me all these questions So the first one it's like, hey, we downloaded this before But there might be an updated version. Is it okay to go ahead and download it again? Yep Let's do yes that way. It's always good to use the most up-to-date version First question, which bundle are you targeting Adafruit bundle community bundle or circuit python org bundle? So let's say I'm making my own new library That I'm going to submit to the community bundle. So I just choose two the number two for the community bundle GitHub user. So I'm making my own personal library. My github username is foamy guy So I'm going to fill that in author name. I'm going to put my name Company, I'll just put foamy guy usually for the company as well for Adafruit Of course, this would say like Adafruit industries here the library name. Let's say a deep dive Example library example library You put whatever the name is here You use the shortest name and it will kind of append a couple or prepend I should say a couple of things to it if you want it to library description So you type in a brief description An example of using cookie cutter Keywords these are things that will help the library come up in github searches So I'll just do something some basic ones like example and library maybe a cookie cutter If you're writing a library for a specific driver or a specific type of thing, you know You can include like accelerometer or anything like that in here just to make it easier to find the library Prefix this question all the Adafruit libraries. We prefix all of them with Adafruit underscore circuit python underscore So that prefix is on the name of all the official Adafruit libraries And so if you were building for the Adafruit bundle, then that's what you would put here And it even actually prompts you automatically this tool is Smart enough to adjust the future questions and the default values based on the previous one So the fact that we chose community here Determines what some of the default values for the rest of these will be if we had chose Adafruit Then the default values actually get built in for us. So for prefix for my own library I'll just put foamy guy Kind of you know mimic that same idea of prefixing it with the entity that created it If it's an Adafruit library and it's for a specific product, you would include the product ID here This one's just an example and let's say it's going to be a helper library used on many different devices So there is no one specific product So we'll just blank on that one It doesn't require bus device. So if it uses i2c or spy for communication, then it will require a bus device So let's say yes Same thing for register if it's going to use i2c or spy, then it's probably going to need register We'll put yes for that any other requirements So this is where you would list other libraries that are required by yours You remember back to when I showed a circup installing pi portal it installed Or it noticed a bunch of those other requirements that it prompted us about This is where those essentially get entered So if you need other libraries for this one to work you list them here for now, I'll leave it blank Do we want to release it on pi pi? I'm going to say yes Do we want to make sphinx documentation for it? I'm going to say yes again But to catney's point earlier, this is optional if you're making your own library And you don't necessarily care about deploying it with pi pi or you don't necessarily want to Make your own documentation pages and put them on read the docs Then you can keep the defaults of no here as well So you have lots of opportunity to kind of customize And then at this point it will create basically this library for us So if we go back into my folder where I ran that And we find deep dive we have here foamy guys circuit python deep dive example library So it created all of this for us and you can see there's a bunch of files in here License files readme files requirements setup pi It ignore you know pilot rc read the docs yaml Get hub for the workflow action stuff examples folder licenses folder all of this stuff got created Automatically by this cookie cutter tool So this is whenever we sit down to start a new library. This is how we do it We run this tool we answer all the prompts we get that Outputted You know sort of starter library and then we fill in the code and push it up to get hub and go from there Let's see here. I'll catch up a little bit Cookie cutter roller. Oh, yeah, those cookies are awesome looking I will note too that the cookie cutter repository Has the the readme Covers I believe More towards the ate a fruit bundle But it looks like it's got pretty much everything you just went through so it might actually have Prompts available for all the bundles um So if you're unsure what a particular prompt means check the readme on the repository for cookie cutter ate a fruit circuit python And it it has a quick explanation for each one of the prompts. Yep, and that's in this Creating and sharing a library. I think or is there a separate one for cookie cutter? Oh, I think it's in there as well. Um, but it's in the readme for the repository as well I see what you're saying. Yeah cookie cutter Cookie cutter find this one on github as well. This is also just a repository hosted on github In the readme here is where it explains some of that stuff. So yeah, here's all the all the prompts in order tells you exactly what each one is So this is a good place to reference as well um An icon for cookie cutter we should we we could probably make a little character for cookie cutter. That'd be kind of nice um, but I think That is everything I wanted to cover. So we have a couple of minutes I think we'll try to cut it around six. So we have about four or five minutes if anybody has any other questions Um, drop them in the chat now catney if there's anything else you want to tell the folks about Now is the time. Maybe I guess we should mention picon. Um, oh, yes So, uh, picon 2022 is coming up. Uh, it's being hosted in salt lake city, utah um, it's in two weeks from yesterday and Three of the aid of fruit folks will be there. Um, jeff melissa and myself And we will be hosting open spaces. We will be hosting two days of sprints And I'm giving a talk for the education summit on circuit python Learning with circuit python and I'll also be hosting a mini sprint for the education summit as well, which is pretty much just Having folks get comfortable using Circuit python. It's not about development. Um, the sprints after the conference are more about development and coding Um, the open spaces again are during the conference itself And those are um, I will have a bunch of uh circuit python hardware with me and we'll be able to show folks How to get started using circuit python on the circuit playground blue fruit With a ton of examples and a ton of extra hardware to hook up so that when folks get through the basic examples They've still got plenty to do Um, other than that we will be around So if anyone is attending picon, please let us know on uh, discord is probably ideal in the circuit python dev channel Or the help with circuit python channel either one works And uh, make sure that we get a chance to meet up Yeah, definitely. I think it sounds like a lot of fun I will not be there this year But it does sound like a lot of fun And I know there's lots of folks who that is their first experience getting involved in the community I've heard from a couple of different folks where their first, um Their first experience in circuit python was working in these sprints at pikons in years past So this is a great a great place to um And get your feet wet and get involved with folks with with the folks who are the most knowledgeable about it around to help you out We've actually recruited at least one person from the development sprints um, so that's you know, that's where they got involved and um Just ran with it from there and then uh ended up joining us Um, eventually uh as a paid intern um So yeah, definitely. Um, if you're there find me and uh, I'll have tons of circuit python stuff to play with um and uh, my plan is more to jam out on hallway track, which is Uh, mostly hanging out and getting to know folks um Throughout the conference and then hosting the sprints Nice. All right. So, uh, we didn't get any other questions. So I think uh, we are about ready to wrap up So thank you to everyone who watched Um anybody who wants to get involved with any of the stuff we worked on. Please come over to the discord That's the the easiest place to start getting involved. Thank you to everyone who has contributed everything and Um, yeah, this has been the the deep dive about libraries. Uh, if you're interested in Um, the development side of actually watching someone code libraries I will say normally that's what i'm doing in this deep dive time slot today was kind of the the odd stream out If you will we we wanted to talk about libraries and have cat me here and have this discussion Uh, but ordinarily in this time slot deep dive Um, since I've been doing it at least it's me coding. Uh, generally coding library stuff So if you're interested in seeing the uh, seeing work on that then come back next week at this time Uh, and I will mention also that I do stream on saturday mornings as well at 10 a.m central time, which is 16 hours from right now I keep telling myself i'm gonna get a countdown thing that I can just pull up quickly But I still haven't done it yet But uh, no matter which time zone you're in 16 hours from right now If you come back to this live broadcast chat, I will drop a link, uh, and I'll be working on some kind of Circuit Python library tomorrow Uh, so yeah, thank you, uh ask patrick w and uh, everybody else who watched Thank you everyone