# How To Make Project Docs in Kedro With Pydocs and `kedro build-docs`

## Метаданные

- **Канал:** DataEngineerOne
- **YouTube:** https://www.youtube.com/watch?v=FesD37s4MFo

## Содержание

### [0:00](https://www.youtube.com/watch?v=FesD37s4MFo) Segment 1 (00:00 - 05:00)

what's up data pipeliners it's data engineer one here today we're going to be talking about building documentation for your catro project so cheddar comes with a fantastic utility built into the catcher command line interface which allows you to build documentation pertaining to your catcher project this is super useful when you want to share your project with your colleagues co-workers or other people in your company or around the world the kendrick documentation relies on the sphinx framework and python docs and so let's go ahead and take a look what exactly are python docs and how can we use them to build out our quetro documentation i have here on the left a great article from data camp talking about doc strings in python this was actually linked inside of the kedra read the docs if you want to know a little bit more detail i highly recommend you take a look at that link i'll leave the link in the description below but for now we're just going to take a look at our iris data set pipeline and so looking underneath our node for data engineering split node you're going to notice that there is a large block of text that is right here this block of text is the python documentation this documentation in particular will show up for this function so it's actually very cool if i were to for example open up a jupiter notebook right here so i'm just going to go and start a ketchup jupiter notebook i can access this documentation in two ways inside of jupiter notebook if i type in help and i put split data as the function into the help function as a parameter i actually can get back exactly this documentation right here node for splitting the classical iris data set into training and test etc which also shows off the signature as well and so this is really nice because without having to look at the code itself i can figure out what are the parameters that this function takes what are the types of the parameters and what is the return value plus what does the function do at all jupiter notebook also comes with some nice features if you just type in split data or whatever function name by itself open up the parentheses close the parenthesis and then press shift tab you actually get a similar interface that just pops up here and so that's all well and good but what does this have to do with our kedrow documentation well it's actually these python documentation strings that are fed directly into kedro build docs so let's go ahead and close this jupiter notebook and i'm going to go ahead and run the function kedrow build docs and what this is going to do is it's going to traverse our entire pipeline looking through every single module and pulling out the signatures and pie doc strings for every single function and pipeline and so here we're doing the build docs it's running through sphinx and it's going to be outputting the documentation into the build docs folder here so it's underneath docs build and then we have the html and if we just open up this index right here i'm just going to drag it over we can see the entire documentation for this project and in particular the one that we were looking for was underneath the pipelines data engineering and nodes module and here we have exactly our split data string and so we see the function here as well as the parameters that are in place and the python documentation now in this case it didn't pick up the type signatures from the function signature itself but you could also add in those parameters here and there you go i've modified the python docstring to include these special keywords this keyword refers to any parameter that is passed into the function and in this case i'm being specific around the data parameter and not only this but i've added a little bit of extra documentation

### [5:00](https://www.youtube.com/watch?v=FesD37s4MFo&t=300s) Segment 2 (05:00 - 06:00)

referring to what this parameter does then i added this extra line type data panda's data frame and so i'm saying that the type of the data parameter is a pandas data frame so this is what's going to be returned and of course this is available here in the type string but this is repeated in the python docs string in this case and when i run build the docs you can see here the parameters now show up as part of the documentation talking about the data parameter the type of the data parameter and what it is looking for in terms of a valid parameter argument and so you can go through and take a look at all the functions that are currently existing in your pipeline you can add in these documentation strings and easily build out these catro docs and of course there's theming that can be done there's a lot of options that sphinx comes with so there's many things that are available to you but thanks to the standardized nature of ketro we are able to create documentation very quickly and easily with the built-in tooling that is there for us so thank you for joining me today in this very quick video i hope you guys learned something if you guys have any questions make sure to stop by the ketchup community or leave a comment below and if you guys enjoy this content make sure that you button that like subscribe and ring that thing if you want to know when we are pipelining and i'll see you guys in the next one take care bye nice

---
*Источник: https://ekstraktznaniy.ru/video/38942*