Skip to main content

check-duplicate-functions

Detect duplicate function names in Python files using AST parsing.

Features

  • Detects duplicate function names (module-level and in classes)
  • AST-based; handles async functions and type annotations
  • Excludes special methods (__init__, __str__, etc.)
  • No external dependencies

Requirements

  • Python 3.8+
  • Standard library only

Installation

pip install check-duplicate-functions

Usage

check-duplicate-functions <python_file_path>

Examples

check-duplicate-functions my_script.py
check-duplicate-functions src/utils.py

Output

  • No duplicates: Exits with code 0 (no output)
  • Duplicates found: Prints each duplicate name and line numbers, e.g.
    [DUPLICATE] 'my_function' appears on lines: 10, 25, 42
  • Errors: Prints message and exits with code 1

Exit codes

  • 0 — Success
  • 1 — Error (bad args, file not found, syntax error, etc.)

Author

Pandiyaraj Karuppasamy

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

check_duplicate_functions-1.0.2.tar.gz (6.9 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

check_duplicate_functions-1.0.2-py3-none-any.whl (7.2 kB view details)

Uploaded Python 3

File details

Details for the file check_duplicate_functions-1.0.2.tar.gz.

File metadata

File hashes

Hashes for check_duplicate_functions-1.0.2.tar.gz
Algorithm Hash digest
SHA256 e67c8f576c16d2f5ac81c3914bfb23ed02a3410d234ba3d091353f8e9b6c3c7e
MD5 7f32297da8b043c6481c66fd4d6ee7de
BLAKE2b-256 451abb9933f8b6fb519e501042873f3a89204b778d553a4fa965be2438aa2e3e

See more details on using hashes here.

File details

Details for the file check_duplicate_functions-1.0.2-py3-none-any.whl.

File metadata

File hashes

Hashes for check_duplicate_functions-1.0.2-py3-none-any.whl
Algorithm Hash digest
SHA256 ae86452fdb95b2a9ee88972bcaeb9599dbfdeda1be8edad856eca085391227a9
MD5 cc575468c297ac1d9f1142d64440301c
BLAKE2b-256 4e2d87eb349042b38996684fc156dd54725b0d85a5d8c6a5c13a6f2245342a0f

See more details on using hashes here.

Release history Release notifications | RSS feed

This release

1.0.2 This release

2 files

1.0.1

2 files

1.0.0

2 files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page