Lots of conventions are borrowed from the excellent Code Guide by @mdo for developing flexible, durable, and sustainable HTML and CSS.

Use soft-tabs set to two spaces.

Trim trailing white space on save.

Add new line at end of files.

Set encoding to UTF-8.

Nested elements should be indented once (two spaces).

The project is using the .editorconfig file and it is recommended that you will install a EditorConfig plugin for your favorite editor.

Separate top-level functions and class definitions with two blank lines.

Function definitions inside a class are separated by a single blank line.

Add _db suffix to variables for single entities. For example: user_db = User.query().get()

Add _dbs suffix to variables for list of entities. For example: user_dbs = User.query().fetch()

Add _qry suffix to variables for queries. For example: user_qry = User.query()

Specify the UTF-8 encoding in every file: # coding: utf-8.

Use trailing commas in multi-line array lists.

Use single quotes ', but avoid escaping.

Every import should be on separate line.

Imports should be grouped in the following order:

  1. standard library imports
  2. related third party imports
  3. local application/library specific imports

You should put a blank line between each group of imports.

Always use double quotes, never single quotes, on HTML attributes.

Always use single quotes, never double quotes, on Jinja2 snippets.

Keep classes lowercase and use dashes (not underscores or camelCase).

Variable and function names should be lowercase, with words separated by underscores as necessary to improve readability.

Class names should normally use the CapWords convention.

79 characters per line (if you have a marker at 80 do not hit it)

Use fenced code blocks (like GitHub) by wrapping your code with ``` and preferable followed by the language for proper highlighting.

print 'Hello, world!'

Always have one empty line before and after code blocks