Documenting Your Python Package
People, who would like to use your package or contribute to it, need to know how to actually use your package and where they can ask for advice.
That’s why it’s always a good idea to document your project.
In this video you’ll learn how to add a README.md
to your project and how to include it in your setup.py
.
00:00
No matter how simple your project may be, it’s always a good idea to document it to let others know how to use it. At a minimum, you should include a README
file, but you may need to look into Read the Docs or GitHub if the complexity of the project requires more than a single page. For this example, go to your top level directory and create a new file and call that README.md
.
00:26
The .md
extension refers to Markdown, which is a quick way to write HTML and supported on quite a few sites to include structure to text. You told setup.py
in the last video that the long_description
was README
and the content_type
was Markdown, so it’ll know how to handle it.
00:46 I’ve gone ahead and copied the documentation from the original project, and I’m just going to paste it here. So, scroll up, make sure everything looks right, and that should be fine.
00:59 Documentation’s a piece of cake when it’s already written, but expect to spend quite a bit of time properly documenting your project. So, that’s it! In the next video, you’re going to see a little bit more in-depth way to handle versioning for your projects.
Bartosz Zaczyński RP Team on Jan. 3, 2022
@torrepreciado You can find it here in the GitHub repository.
Become a Member to join the conversation.
torrepreciado on Dec. 24, 2021
Hi. Could you please post the README.md file you used below?