with one click
python-imports
Python import style guidelines for absolute and relative imports
Install with Codex or Claude Copy this prompt, paste it into Codex, Claude, or another assistant, and let it review the skill page and install it for you.
Menu
Python import style guidelines for absolute and relative imports
Install with Codex or Claude Copy this prompt, paste it into Codex, Claude, or another assistant, and let it review the skill page and install it for you.
Based on SOC occupation classification
Python naming conventions for variables, constants, files, and directories
Python pathlib usage guidelines for file and directory operations
Python refactoring triggers and guidelines for code size limits
UV command-line usage patterns for Python project management
UV command automation and project lifecycle management patterns powered by the uv-mcp server
Universal coding principles and best practices for maintainable software
| name | python-imports |
| description | Python import style guidelines for absolute and relative imports |
| license | MIT |
| compatibility | opencode |
| metadata | {"related_python_guidelines":"For general Python development standards, use skill `python-guidelines`"} |
Provide guidelines for Python import styles with emphasis on absolute imports.
# ✅ CORRECT - Use absolute imports in regular modules
from module.common.types import TestDesign
from module.consolidate.parsing import parse_p800_raw_results
from package.submodule.utils import helper_function
# ❌ AVOID - Relative imports in regular modules
from .types import TestDesign
from ..consolidate.parsing import parse_p800_raw_results
# ✅ EXCEPTION - Relative imports allowed in __init__.py only
# Use relative imports when re-exporting from submodules
# In package/__init__.py
from .parsing import parse_data
from .statistics import calculate_stats
from .processing import ProcessResult
# Public API exports
__all__ = ["parse_data", "calculate_stats", "ProcessResult"]
# Standard library imports
import os
import sys
from pathlib import Path
from typing import List, Dict
# Third-party imports
import numpy as np
import pandas as pd
from rich.console import Console
# Local application imports
from package.module import function
from package.module.class_ import ClassName
Use this skill when: