the main difference is that Google Python Style comes with more details about how to write code, for example how to write your docstrings or when to use aliases for a variable, this are not specified in the PEP8

Answer from kederrac on Stack Overflow
🌐
Codacy
blog.codacy.com › 3-popular-python-style-guides
3 Python style guides that will improve your coding standards
April 2, 2026 - However, PEP 8 is a generic Python guideline rather than strict rules that you should follow since it allows different approaches to achieve similar goals. So you’ll need to make sure that everyone in your team follows the same approach in ...
Discussions

Code style guide recommendation
When picking what standard to use in any project, you should try the options in the following order: The standard already in use on the project The standard required by the company you're doing the project for The standard for the language you're writing in Anything you want, just be consistent At your stage, you're probably not joining an existing project or doing the work for a company, so the first two options don't fit. Option 3 is pick the standard for the language you're using - for Python that's PEP-8 so you should use PEP-8. Note that you should very rarely if ever end up on option 4, most languages will have a suggested style guide so it's very much a last resort. More on reddit.com
🌐 r/learnpython
9
4
December 8, 2024
Google's official python tutorial violates PEP8, recommends python 2.4-2.6, and my university just assigned it to us.
Python2 is officially being unsupported in 27 months More on reddit.com
🌐 r/Python
240
607
January 3, 2018
TIL about "Google Python Style Guide"
It'd be great if any of Google's python API libraries vaguely followed this style guide, it's actually pretty good! More on reddit.com
🌐 r/Python
56
330
November 27, 2015
What's the difference between pep8 and google style? Could give some demo? thanks
What's the difference between pep8 and google style? Could give some demo? thanks#142 · Copy link · Labels · question · axiaoxin · opened · on May 15, 2015 · Issue body actions · :) No one assigned · question · No type · No projects · No milestone · More on github.com
🌐 github.com
1
May 15, 2015
🌐
LinuxTut
linuxtut.com › en › f43ced224483ea1f62f4
[Python coding standard] PEP 8 vs Google Style
August 23, 2020 - A well-known Python coding standard ... summarized how Google Style differs from PEP 8. From the conclusion, it was almost the same as PEP 8, so I omitted the common rules (especially blank lines and blanks)....
🌐
Google
google.github.io › styleguide › pyguide.html
Google Python Style Guide
Python is the main dynamic language used at Google. This style guide is a list of dos and don’ts for Python programs.
🌐
YouTube
youtube.com › codecreate
google python style guide vs pep8 - YouTube
Download this code from https://codegive.com When it comes to writing clean, readable, and consistent Python code, developers often turn to style guides for ...
Published: December 24, 2023
Views: 18
🌐
Medium
wyounas.medium.com › style-guides-and-googles-python-code-2e3f6b35403d
Style guides and Google’s Python code | by Waqas Younas | Medium
October 13, 2018 - I had to look at a few Google Ad libraries to learn about a couple things, and I came across this library: https://github.com/googleads/googleads-ssr-generator. I downloaded the code and opened it up in the source-code editor. The main file looks simple in that it’s roughly 230 lines with most of the code defined in methods. I, however, was not able to run the code on a Mac given the instructions in the README file. What surprised me most is the fact that the code is not PEP-8 (Python’s official style guide)-compliant.
🌐
Quora
quora.com › Which-style-guide-is-most-used-in-Python-PEP-Google
Which style guide is most used in Python (PEP, Google)? - Quora
Answer: PEP 8 -- Style Guide for Python Code goes beyond “most used” — it is the definitive, official style guide. Some organizations, like Google, have their own in-house syle guides. That’s fine if you’re writing code for them (or submitting code to one of their open source projects).
Find elsewhere
🌐
Luminous Men
luminousmen.com › post › the-ultimate-python-style-guidelines
The ultimate Python style guidelines
July 25, 2024 - I like PEP8, I believe there has been much effort and thinking put into it. On the other hand, PEP8 can be considered a generic Python guideline rather than strict rules as it allows different approaches to achieve similar goals.
🌐
Reddit
reddit.com › r/python › google's official python tutorial violates pep8, recommends python 2.4-2.6, and my university just assigned it to us.
r/Python on Reddit: Google's official python tutorial violates PEP8, recommends python 2.4-2.6, and my university just assigned it to us.
January 3, 2018 - --- If you have questions or are new to Python use r/LearnPython ... Archived post. New comments cannot be posted and votes cannot be cast. Share ... If I recall correctly Google in general doesn't follow PEP8, most notably they use two spaces for indentation instead of 4, and this tutorial is targeted to Google employees, so this makes sense. ... In fact, google publishes their own style guide.
🌐
Bigchaindb
docs.bigchaindb.com › en › latest › contributing › cross-project-policies › python-style-guide.html
Python Style Guide — BigchainDB 2.2.2 documentation
The hooks we use can be found in the .pre-commit-config.yaml file. PEP8 says some things about docstrings, but not what to put in them or how to structure them. PEP257 was one proposal for docstring conventions, but we prefer Google-style docstrings instead: they’re easier to read and the ...
🌐
iO Flood
ioflood.com › blog › pep8
PEP8 Python Style Guide
November 21, 2023 - For instance, Google’s guide recommends a maximum line length of 80 characters (compared to PEP8’s 79), and it prefers using single quotes for strings unless a string contains a single quote character. To illustrate these differences, let’s look at a comparison table: Here’s an example of code that follows Google’s Python Style ...
🌐
Reddit
reddit.com › r/python › til about "google python style guide"
r/Python on Reddit: TIL about "Google Python Style Guide"
November 27, 2015 - As far as I remember, it's pretty much the same as PEP8. ... I use numpydoc for documentation, especially when working with robots or other hardware. It's much more powerful than googledoc.
🌐
Website-files
assets-global.website-files.com › 66f3da902ceaa8d3b810b189 › 681ae3a74d1fff829473bb7b_lufox.pdf pdf
Python style guide google
Define how Google approaches using (and not using) different elements of the Python language within their code. This section provides guidance on structuring code to ensure consistency and maintainability. * **Python Style Rules**: Focus on formatting, stylistic practices, and best practices for coding.
🌐
Infermatic.ai
infermatic.ai › home › ask svak
How does the PEP 8 coding standard differ from the Google Style Guide? - Infermatic
January 24, 2025 - Need answers on AI, ML, or LLMs? Ask your questions on Infermatic.ai and receive clear, expert explanations tailored to your needs.
🌐
GitHub
github.com › google › yapf › issues › 142
What's the difference between pep8 and google style? Could give some demo? thanks · Issue #142 · google/yapf
May 15, 2015 - What's the difference between pep8 and google style? Could give some demo? thanks#142 · Copy link · Labels · question · axiaoxin · opened · on May 15, 2015 · Issue body actions · :) No one assigned · question · No type · No projects · No milestone ·
Author: google
🌐
Uni-freiburg
proglang.informatik.uni-freiburg.de › teaching › info1 › 2019 › guide › styleguide.html
Python Style Guide — Info I Guide (WS 2019)
Entsprechendes gilt für Variablennamen (siehe [PEP8]). Am Anfang jeder Python-Datei steht ein Doc-String der kurz den Inhalt der Datei bescheibt. Dies ist auch der geeignete Ort, um Metadaten (z.B. Informationen zum Autor, Lizenz, etc.) zu listen. Jede definierte Funktion wird mit einem Doc-String versehen werden. Im Rahmen der Vorlesung verwenden wir dazu ein Schema in Anlehnung an PEP 257 [PEP257] und dem Google Python Style Guide [GPSG]. Siehe hierzu Doc-Strings.
🌐
CodeRivers
coderivers.org › blog › google-python-style-guide
Google Python Style Guide: A Comprehensive Guide - CodeRivers
January 23, 2025 - The Google Python Style Guide provides a set of dos and don'ts for writing clean, consistent, and maintainable Python code at Google. While PEP 8 is the foundational Python style guide, Google's guide extends it with stricter rules and additional guidance for large-scale codebases.
Top answer
1 of 3
22

PEP 8 is pretty much "the root" of all common style guides.

Google's Python style guide has some parts that are quite well thought of, but others are idiosyncratic (the two-space indents instead of the popular four-space ones, and the CamelCase style for functions and methods instead of the camel_case style, are pretty major idiosyncrasies).

On to your specific questions:

1.- What is the most widely used column width? (the eternal question) I'm currently sticking to 80 columns (and it's a pain!)

80 columns is most popular

2.- What quotes to use? (I've seen everything and PEP 8 does not mention anything clear) I'm using single quotes for everything but docstrings, which use triple double quotes.

I prefer the style you're using, but even Google was not able to reach a consensus about this:-(

3.- Where do I put my imports? I'm putting them at file header in this order.

import sys import -rest of python modules needed-

import whatever import -rest of application modules-

Yes, excellent choice, and popular too.

4.- Can I use "import whatever.function as blah"? I saw some documents that disregard doing this.

I strongly recommend you always import modules -- not specific names from inside a module. This is not just style -- there are strong advantages e.g. in testability in doing that. The as clause is fine, to shorten a module's name or avoid clashes.

5.- Tabs or spaces for indenting? Currently using 4 spaces tabs.

Overwhelmingly most popular.

6.- Variable naming style? I'm using lowercase for everything but classes, which I put in camelCase.

Almost everybody names classes with uppercase initial and constants with all-uppercase.

2 of 3
2

1.- Most everyone has a 16:9 or 16:10 monitor now days. Even if they don't have a wide-screen they have lots of pixels, 80 cols isn't a big practical deal breaker like it was when everyone was hacking at the command line in a remote terminal window on a 4:3 monitor at 320 X 240. I usually end the line when it gets too long, which is subjective. I am at 2048 X 1152 on a 23" Monitor X 2.

2.- Single quotes by default so you don't have to escape Double quotes, Double quotes when you need to embed single quotes, and Triple quotes for strings with embedded newlines.

3.- Put them at the top of the file, sometimes you put them in the main function if they aren't needed globally to the module.

4.- It is a common idiom to rename some modules. A good example is the following.

try:
    # for Python 2.6.x
    import json
except ImportError:
    # for previous Pythons
    try:
        import simplejson as json
    except ImportError:
        sys.exit('easy_install simplejson')

but the preferred way to import just a class or function is from module import xxx with the optional as yyy if needed

5.- Always use SPACES! 2 or 4 as long as no TABS

6.- Classes should up UpperCaseCamelStyle, variables are lowercase sometimes lowerCamelCase or sometimes all_lowecase_separated_by_underscores, as are function names. "Constants" should be ALL_UPPER_CASE_SEPARATED_BY_UNDERSCORES

When in doubt refer to the PEP 8, the Python source, existing conventions in a code base. But the most import thing is to be internally consistent as possible. All Python code should look like it was written by the same person when ever possible.