Skip to content
| Marketplace
Sign in
Visual Studio Code>Other>Copy Python Qualified PathNew to Visual Studio Code? Get it now.
Copy Python Qualified Path

Copy Python Qualified Path

kadir

|
22 installs
| (0) | Free
Adds right-click option to copy full Python qualified path like module.Class.method
Installation
Launch VS Code Quick Open (Ctrl+P), paste the following command, and press enter.
Copied to clipboard
More Info

🐍 Copy Python Qualified Path

A Visual Studio Code extension that adds a right-click menu option to copy the fully-qualified Python path of a class or method — just like PyCharm.

🔗 From this:

# File: src/utils/mymodule.py

class MyClass:
    def get_numbers(self):
        pass

📋 To this copied string:

src.utils.mymodule.MyClass.get_numbers

✨ Features

  • ✅ Adds Copy Qualified Path to the right-click context menu.
  • ✅ Automatically detects the Python module path based on your project structure.
  • ✅ Works with both classes and functions.
  • ✅ Detects the enclosing class of a method automatically.

🛠️ Installation

From Marketplace

Coming soon: Marketplace Link

Local .vsix file

code --install-extension copy-python-qualified-path-0.0.1.vsix

🚀 Usage

  1. Open any .py file in your project.
  2. Right-click on a class or method name.
  3. Select Copy Qualified Path.
  4. The path will be copied in the format:
    your.module.path.ClassName.method_name
    

⚙️ How It Works

  • Determines the Python module path by resolving the file's location relative to the project root (.git, .vscode, pyproject.toml, etc.).
  • Parses the current line to extract class or method definitions.
  • If only a method is selected, attempts to find the enclosing class upward in the file.

🧪 Example Output

File Path Selection Copied Path
project/api/user/views.py UserView.get project.api.user.views.UserView.get
core/database/init.py setup_db() core.database.init.setup_db

🙋 FAQ

Q: Does it support nested classes?
A: Currently, it supports single-level classes. Nested class support is coming soon.

Q: How is the module root detected?
A: It walks up the directory tree looking for .git, .vscode, or pyproject.toml.


💡 Future Ideas

  • no future ideas, its enough for now

🧑‍💻 Author

Made with ❤️ by @kdrkrgz


🪪 License

MIT License

  • Contact us
  • Jobs
  • Privacy
  • Manage cookies
  • Terms of use
  • Trademarks
© 2025 Microsoft