I think naming an interface with an I prefix is perfectly acceptable.

e.g.:

  • IFoo
  • IPublishable

A few years back I used Zope Interfaces. I noticed most codebases used this convention. Our team did too.

We preferred IFoo vs. FooInterface or IFooInterface

Answer from Shekhar on Stack Overflow
🌐
GitHub
github.com › python › typeshed › issues › 4174
Protocol naming convention · Issue #4174 · python/typeshed
June 4, 2020 - Some possible conventions for a "read" protocol: ... I have no strong preferences, but I think the naming to reflect that a class is a protocol. Therefore I'd suggest we should use either, some, or all of the above. The second name (HasRead) clearly implies the existence of a field read, but would exclude protocols with multiple fields, such as this from stdlib/3.9/zoneinfo/__init__.pyi:
Author   srittau
🌐
Python
peps.python.org › pep-0008
PEP 8 – Style Guide for Python Code | peps.python.org
In Python, this style is generally deemed unnecessary because attribute and method names are prefixed with an object, and function names are prefixed with a module name. In addition, the following special forms using leading or trailing underscores are recognized (these can generally be combined with any case convention):
🌐
Python
peps.python.org › pep-0544
PEP 544 – Protocols: Structural subtyping (static duck typing) | peps.python.org
March 5, 2017 - The problem with this is instance checks could be unreliable, except for situations where there is a common signature convention such as Iterable. For example: class P(Protocol): def common_method_name(self, x: int) -> int: ... class X: <a bunch of methods> def common_method_name(self) -> None: ...
🌐
Python
typing.python.org › en › latest › spec › protocol.html
Protocols — typing documentation
Recursive protocols are also supported. Forward references to the protocol class names can be given as strings.
🌐
Mypy
mypy.readthedocs.io › en › stable › protocols.html
Protocols and structural subtyping - mypy 1.19.1 documentation
The collections.abc, typing and other stdlib modules define various protocol classes that correspond to common Python protocols, such as Iterable[T]. If a class defines a suitable __iter__ method, mypy understands that it implements the iterable protocol and is compatible with Iterable[T]. ...
🌐
Namingconvention
namingconvention.org › python
Python · Naming Convention
The style guide for Python is based on Guido’s naming convention recommendations.
🌐
Pybites
pybit.es › articles › naming_conventions
Python Naming Conventions – Pybites
That was when I discovered the PEP8 Style Guide on python.org. If you have any doubts as to how your code should be laid out, reference this baby and you’ll be on your way. What does it say about naming conventions? Quite a bit actually! For the pupose of this post there, here’s what it says about Function names ...
Find elsewhere
🌐
GeeksforGeeks
geeksforgeeks.org › python › python-naming-conventions
Python Naming Conventions - GeeksforGeeks
July 23, 2025 - A descriptive name that accurately reflects the purpose of a variable or function reduces the likelihood of misunderstandings or unintentional misuse. In conclusion, By emphasizing readability, supporting collaborative development, aiding error prevention, and enabling seamless tool integration, these conventions serve as a guiding principle for Python developers.
🌐
Readthedocs
python-consistency.readthedocs.io › en › latest › conventions.html
Naming Conventions — python-consistency documentation
If you have a method that is simply a def is_foo(self):, it is a property with that name. ... Unless you need to distinguish between iterators and lists, you should avoid the prefix iter_. Furthermore, if your code of returning a list is simply list(iter), avoid that method at all. But if you have a list, return it. A list is iterable after all. Avoid many methods for working on strings and bytes and file-like objects · Having four methods for working on a set of different inputs really does not look very nice. Python 3.4 introduced the notion of single-dispatch generic functions (see PEP-443), so we should use those.
🌐
GeeksforGeeks
geeksforgeeks.org › python › python-conventions-and-pep8
Python - Conventions and PEP8 - GeeksforGeeks
May 10, 2020 - This includes rules for naming conventions, indentations, comments, statements, programming practices, etc. Following these set of rules ensures the code readability as well as easy maintenance. As code is not always maintained by the developer, therefore the next person must understand your code accurately, as “Code is read much more often than written”. PEP-8 is an acronym for Python Enhancement Protocol 8, which is a set of guidelines published for the Python programming language.
🌐
Real Python
realpython.com › python-protocol
Python Protocols: Leveraging Structural Subtyping – Real Python
July 25, 2024 - Checking types explicitly isn’t a popular practice in Python. Instead, the language favors duck typing, where you use the objects without considering their types but only the expected operations. Here’s where structural subtyping comes in handy. For example, you can reimplement the animal classes without setting a formal relationship between them: ... class Dog: def __init__(self, name): self.name = name def eat(self): print(f"{self.name} is eating.") def drink(self): print(f"{self.name} is drinking.") def make_sound(self): print(f"{self.name} is barking.") class Cat: def __init__(self, name): self.name = name def eat(self): print(f"{self.name} is eating.") def drink(self): print(f"{self.name} is drinking.") def make_sound(self): print(f"{self.name} is meowing.")
🌐
Calmops
calmops.com › programming › python › python-naming-conventions-pep8
Python Naming Conventions and PEP 8: Writing Pythonic Code - Calmops
March 6, 2025 - ✅ Consistency - Everyone’s ... naming styles for different constructs: Variable names should use snake_case: lowercase letters with underscores separating words....
Top answer
1 of 2
324

Quoting https://www.python.org/dev/peps/pep-0008/#package-and-module-names:

Modules should have short, all-lowercase names. Underscores can be used in the module name if it improves readability. Python packages should also have short, all-lowercase names, although the use of underscores is discouraged.

For classes:

Class names should normally use the CapWords convention.

And function and (local) variable names should be:

lowercase, with words separated by underscores as necessary to improve readability

See this answer for the difference between a module, class and package:

  • A Python module is simply a Python source file, which can expose classes, functions and global variables.
  • A Python package is simply a directory of Python module(s).

So PEP 8 tells you that:

  • modules (filenames) should have short, all-lowercase names, and they can contain underscores;
  • packages (directories) should have short, all-lowercase names, preferably without underscores;
  • classes should use the CapWords convention.

PEP 8 tells that names should be short; this answer gives a good overview of what to take into account when creating variable names, which also apply to other names (for classes, packages, etc.):

  • variable names are not full descriptors;
  • put details in comments;
  • too specific name might mean too specific code;
  • keep short scopes for quick lookup;
  • spend time thinking about readability.

To finish, a good overview of the naming conventions is given in the Google Python Style Guide.

2 of 2
94

Here is a link for different types of Python name conventions:

Type Public Internal
Packages lower_with_under
Modules lower_with_under _lower_with_under
Classes CapWords _CapWords
Exceptions CapWords
Functions lower_with_under() _lower_with_under()
Global/Class Constants CAPS_WITH_UNDER _CAPS_WITH_UNDER
Global/Class Variables lower_with_under _lower_with_under
Instance Variables lower_with_under _lower_with_under
Method Names lower_with_under() _lower_with_under()
Function/Method Parameters lower_with_under
Local Variables lower_with_under

The style guide for Python is based on Guido’s naming convention recommendations.

🌐
Readthedocs
visualgit.readthedocs.io › en › latest › pages › naming_convention.html
Python Naming Conventions — CodingConvention 0 documentation
Docs » · Python Naming Conventions · Edit on GitHub · Python Naming Conventions¶ · 1. General¶ · Avoid using names that are too general or too wordy. Strike a good balance between the two · Bad: data_structure, my_list, info_map, dictionary_for_the_purpose_of_storing_data_represen...
🌐
Medium
medium.com › @tuenguyends › python-naming-rules-and-conventions-fe18086cca16
Python’s naming rules and conventions | by Tue Nguyen | Medium
April 15, 2022 - ... A name only consists of characters from three groups: digits (0-9), letters (a-z and A-Z), and underscores (_) ... A name cannot coincide with one of Python’s reserved words.
🌐
Medium
medium.com › @rowainaabdelnasser › python-naming-conventions-10-essential-guidelines-for-clean-and-readable-code-fe80d2057bc9
Python Naming Conventions: 10 Essential Guidelines for Clean and Readable Code | by Rowaina Abdelnasser | Medium
December 8, 2024 - By convention, constant names are written in uppercase letters with underscores separating words. Defining constants at the module level allows them to be easily accessed and used throughout the project.
🌐
Real Python
realpython.com › python-pep8
How to Write Beautiful Python Code With PEP 8 – Real Python
January 12, 2025 - What are some key naming conventions in PEP 8?Show/Hide · PEP 8 suggests using lowercase with underscores for functions and variables (snake case), camel case for classes, and uppercase with underscores for constants.
🌐
Hejoseph
hejoseph.com › naming conventions
Naming Conventions | Tech Journey
February 12, 2024 - Python follows the PEP 8 style guide for naming conventions. This guide helps improve code readability and maintainability across files, classes, methods, and variables. Below are best practices for naming in Python: