DEV Community

stereobooster
stereobooster

Posted on

What do you use for Python development?

Let's say I want to dive into Python development. What tools do you use? I use JS and there are some tools I got used to. For example, in JS, my standard toolbox:

  • Opinionated code formatter: Prettier
  • Linter: eslint + cra-config
  • IDE: code
  • Type checker: TypeScript
  • Package manager: yarn

Is there something similar in Python? Or something beyond that? Which interpreter do you use standard Python or Anaconda or ...?

Top comments (6)

Collapse
 
codemouse92 profile image
Jason C. McDonald • Edited

For Python:

  • Code formatter: Black: It doesn't bother you with all the settings, like PyLint does, but assumes you want to comply with the majority of the PEP-8 official style guide. Which is usually a good idea.

  • Linter: flake8: A combination of three linters (PyFlakes, pycodestyle, and McCabe). You can add many more besides.

  • Type checker: mypy: yes, this exists for Python 3, if you want to use type annotation (optional).

  • Package manager: pip: It works. Just keep it simple.

Also, be sure you're using virtual environments! venv is probably more than suitable. (Here's a guide.)

As to IDE, I prefer Visual Studio Code with the official Python extension, but PyCharm CE is good too.

P.S. I recommend you keep both the latest versions of Python (a.k.a. CPython) and Pypy around. The former always has the latest features, but the latter is comparable to native languages thanks to bootstrapping and its JIT compiler. Also, stick with Python 3.

Collapse
 
ilosamart profile image
Fábio Tramasoli

First of all: welcome to python! :)

My setup for python development is:

  • Opinionated code formatter: PyCharm's
  • Linter: pylint
  • IDE: PyCharm Community by Jetbrains
  • Type checker: Pycharm's
  • Package manager: pip

Just for clarification, Anaconda is like a distribution of python and R on steroids, comes with a lot of packages for data science and machine learning and has a particular environment management tool called "conda" which covers a lot more aspects of development process than "pip".

Finally, things you should be acquainted in the python development process:

Hope I did help you get started! Happy coding!

Collapse
 
rhymes profile image
rhymes

linter: flake8 plus various plugins
formatter: black
IDE: sublime text or visual studio code
type checker: none, but you can take a look at mypy
package manager: I used to use pipenv but i've switch to poetry

As for the interpreter goes I use standard Python, the version in C you can find at python.org/

I install it through pyenv so I can easily switch between different versions in different projects

Collapse
 
janmpeterka profile image
Jan Peterka • Edited

Mostly repeating others, but here is my toolbelt:

code formatter: black. Just love how strict it is.
linter: flake8, as most.
pipenv as a combination of venv and pip with easy usage (I used to use both separately, and then found this great tool).
bandit for finding common security problems easily.

I mostly write small projects, so sublime text 3 (with plugins making it almost an IDE) is optimal for me, but I've been looking at PyCharm recently.

then, some tools which are not python exclusive, but worth a mention:
pre-commit running black, flake and bandit and pytest on commit/push.
sublime merge for git (I prefer visual usage over cli when possible, and sublime merge is blazing fast and has same controls as st3).
f-man is minimalist dual-pane file manager, based on st3 philosophy.

Collapse
 
zchtodd profile image
zchtodd • Edited

Hey, great question. Here are my favorites:

  • I use a program called black for my formatting
  • There are quite a few Python linters, but the flake8 linter is my favorite.
  • I'm a Vim diehard.
  • Type checking has become more of a thing with Python in the past few years, although I haven't jumped into that yet. Type hints are an official part of the language now, but they are mostly used to help IDEs, and can't cause compilation issues. There is an exciting new project called mypy that aims to add type checking for Python.
  • Pip is really the mainstream option for Python package management. I would recommend something like pyenv, however, to keep your Python installations separated by project.
  • I use the standard Python interpreter (CPython), although there are a lot of them out there with different purposes. I have used pypy in the past, which is a very exciting project that adds a Just In Time compiler to Python.
Collapse
 
sajjadkhan12 profile image
Sajjadkhan12

pycharm is is the best ide for python