# Code style in Python modules?

**URL:** https://discourse.slicer.org/t/code-style-in-python-modules/28529
**Category:** Development
**Tags:** python, extensions
**Created:** [March 22, 2023, 9:07pm UTC](https://discourse.slicer.org/t/code-style-in-python-modules/28529 "2023-03-22T21:07:13Z")
**Posts on this page:** 2
**Page:** 1

<div class="post-metadata">

### Author: ![dzenanz](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/dzenanz/32/1992_2.png) [@dzenanz](https://discourse.slicer.org/u/dzenanz)
#### Post date: [March 22, 2023, 9:07pm UTC](https://discourse.slicer.org/t/code-style-in-python-modules/28529/1 "2023-03-22T21:07:13Z")

</div>

Is there some preferred style for Python code in extensions? What tools (e.g. `black`) can enforce it?

---

<div class="post-metadata">

### Author: ![pieper](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/pieper/32/8_2.png) [@pieper](https://discourse.slicer.org/u/pieper)
#### Post date: [March 22, 2023, 9:18pm UTC](https://discourse.slicer.org/t/code-style-in-python-modules/28529/2 "2023-03-22T21:18:41Z")

</div>

So far we have this: [Style Guide — 3D Slicer documentation](https://slicer.readthedocs.io/en/5.0/developer_guide/style_guide.html#python)

It would be best for extensions to follow the same rules as the core.
