https://github.com/4catalyzer/python
4Catalyzer Python Style Guide
https://github.com/4catalyzer/python
Last synced: about 1 month ago
JSON representation
4Catalyzer Python Style Guide
- Host: GitHub
- URL: https://github.com/4catalyzer/python
- Owner: 4Catalyzer
- License: mit
- Created: 2017-05-27T01:18:21.000Z (almost 8 years ago)
- Default Branch: master
- Last Pushed: 2023-12-01T11:29:11.000Z (over 1 year ago)
- Last Synced: 2024-11-01T01:16:32.433Z (7 months ago)
- Language: Python
- Size: 27.3 KB
- Stars: 3
- Watchers: 9
- Forks: 1
- Open Issues: 5
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Python
We rely on [Fourmat](https://github.com/4Catalyzer/fourmat) to automatically format and lint code according to our style guidelines. Below are additional guidelines that are not taken care of by Fourmat.
## Data types
Prefer immutable data types over their mutable equivalents. Specifically, prefer `tuple` and `frozenset` over `list` and `set` respectively when the relevant collections will not be mutated. However, it is acceptable to use `list` over `tuple` for collections that semantically constitute homogeneous lists rather than heterogeneous tuples, though `tuple` may still be better when the list is short.
## Preferred tools
- For data frame manipulation, use [pandas](https://pandas.pydata.org/).
- For building command line interfaces, prefer [Click](http://click.pocoo.org/).
- For testing, use [pytest](https://pytest.org/).
- Prefer [fixtures](https://docs.pytest.org/en/latest/fixture.html) over explicit setup and teardown.