- Implemented PyPISearchClient with semantic search, filtering, and sorting - Added 4 new search tools: search_packages, search_by_category, find_alternatives, get_trending_packages - Created SearchFilter and SearchSort classes for flexible configuration - Added SearchError exception for search-specific error handling - Comprehensive test suite with 13 tests covering all search functionality - Enhanced MCP server with 4 new search endpoints - Support for filtering by Python version, license, category, downloads, maintenance status - Multiple sorting options: relevance, popularity, quality, recency, name, downloads - Semantic search using description similarity scoring - Category-based package discovery with intelligent keyword matching - Package alternatives finder using metadata analysis - Trending packages analysis with download activity tracking - Robust fallback mechanisms using curated package database - All tests passing (13/13) This implements feature #6 from the roadmap: "Advanced PyPI Search with filtering by Python version, license, maintenance status and sorting by popularity, recency, quality score with semantic search capabilities"
48 lines
1.3 KiB
Python
48 lines
1.3 KiB
Python
"""MCP tools for PyPI package queries.
|
|
|
|
This package contains the FastMCP tool implementations that provide
|
|
the user-facing interface for PyPI package operations.
|
|
"""
|
|
|
|
from .compatibility_check import (
|
|
check_python_compatibility,
|
|
get_compatible_python_versions,
|
|
suggest_python_version_for_packages,
|
|
)
|
|
from .dependency_resolver import resolve_package_dependencies
|
|
from .download_stats import (
|
|
get_package_download_stats,
|
|
get_package_download_trends,
|
|
get_top_packages_by_downloads,
|
|
)
|
|
from .package_downloader import download_package_with_dependencies
|
|
from .package_query import (
|
|
query_package_dependencies,
|
|
query_package_info,
|
|
query_package_versions,
|
|
)
|
|
from .search import (
|
|
find_alternatives,
|
|
get_trending_packages,
|
|
search_by_category,
|
|
search_packages,
|
|
)
|
|
|
|
__all__ = [
|
|
"query_package_info",
|
|
"query_package_versions",
|
|
"query_package_dependencies",
|
|
"check_python_compatibility",
|
|
"get_compatible_python_versions",
|
|
"suggest_python_version_for_packages",
|
|
"resolve_package_dependencies",
|
|
"download_package_with_dependencies",
|
|
"get_package_download_stats",
|
|
"get_package_download_trends",
|
|
"get_top_packages_by_downloads",
|
|
"search_packages",
|
|
"search_by_category",
|
|
"find_alternatives",
|
|
"get_trending_packages",
|
|
]
|