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
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.
🌐
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.
Find elsewhere
🌐
Pybites
pybit.es › articles › naming_conventions
Python Naming Conventions – Pybites
January 1, 2017 - 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 (also applicable to Methods and Instance Variables):
🌐
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.
🌐
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.")
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...
🌐
Bvandewe
bvandewe.github.io › pyneuro › references › source_code_naming_convention
Naming Conventions - Neuroglia Python Framework
3 weeks ago - Naming conventions reinforce clean architecture boundaries - you can immediately tell if a component violates layer dependencies. Less time spent deciphering unclear names means more time focused on business logic and feature development. The framework strictly follows PEP 8 and Python naming conventions as the foundation:
🌐
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.
🌐
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.
🌐
Medium
medium.com › @tuenguyends › python-naming-rules-and-conventions-fe18086cca16
Python’s naming rules and conventions | by Tue Nguyen | Medium
January 12, 2025 - ... 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.
🌐
Hejoseph
hejoseph.com › naming conventions
Naming Conventions | Tech Journey
July 31, 2025 - 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:
🌐
Business Compass LLC
knowledge.businesscompassllc.com › home › python naming conventions: a complete guide to writing professional code
Python Naming Conventions: A Complete Guide to Writing Professional Code - Business Compass LLC
March 25, 2025 - This convention uses lowercase letters with underscores separating words, creating readable and consistent code that aligns with PEP 8 naming conventions. When implementing snake_case, keep these rules in mind: Variables: user_name, total_count, ...