Programming/Python

From Dev Wiki
< Programming
Revision as of 07:52, 21 February 2023 by Brodriguez (talk | contribs) (Correct word)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigation Jump to search
Note: Common File Extensions: .py


Python is a high-level, object-oriented programming language.

The language has "dynamic semantics" and thus encourages rapid application development. It also heavily emphasizes code readability, which results in a language that emphasizes whitespace with very simple (but powerful) syntax.


Setup


Syntax


Testing


Managing Packages


Related Packages and Libraries

See also Django Packages and Libraries .


Dependency & Environment Management

ToDo: Document and research actual differences and benefits/drawbacks between these two.

PipEnv - Project dependency manager for Python projects.

[Poetry] - Project dependency manager for Python projects.


Unit Testing

Pytest - Recommended tool to run Python tests.

pytest                          # Base Pytest package.
pytest-asyncio                  # Additional Pytest logic for asyncio support.
pytest-django                   # Additional Pytest logic for Django support.
pytest-subtests                 # Additional Pytest logic for improved subtest support.
pytest-xdist                    # Additional Pytest features, such as multithreading and looping.


CodeCoverage

coverage                        # Output for checking testing coverage data.


Web Development

Flask - Good for quick projects, but if building a fully qualified site, consider Django instead.

Flask                           # A lightweight web framework.


Django - A Python-based web framework, equivalent to Php's Laravel.

django                          # A Python-based web framework.


Syntax Checking

AutoPep8

autopep8                                   # Auto-formats files for pep8 recommendations. Exceptions in `setup.cfg`.


Flake8

flake8                                     # Wrapper for autopep8 that allows extra configuration, etc.


Black

black                                      # An opinionated code formater.


Pylint

pylint                                     # Linter for Python syntax. Must be run in console via "pylint" command.
pylint-django                              # Improves code analysis for Django projects.
pylint-plugin-utils                        # Additional pylint functionality for things like Django and Celery.


Utility & Other

Faker

Faker                           # Easy generation of random values for various common data types.