智能化零售店铺选址分析工具,帮助用户基于数据做出科学的选址决策。
When a user requests location analysis:
Execute location_analyzer.py to evaluate:
Use generate_report.py to create:
report_template_simple.htmllocation_analyzer.py)Core analysis engine that calculates location scores.
Key Classes:
LocationData: Data model for location informationLocationAnalyzer: Scoring engine with store-type-specific weightsAnalysisResult: Output containing scores, advantages, risks, and recommendationsUsage Pattern:
import sys
sys.path.insert(0, skill_dir) # Add skill directory to path
from location_analyzer import LocationAnalyzer, LocationData
# Create analyzer for specific store type
analyzer = LocationAnalyzer("咖啡店")
# Prepare location data
location_data = LocationData(
name="Location Name",
address="Full Address",
population_density=10000.0,
daily_traffic=20000,
households=1500,
avg_income=15.0,
commercial_score=80.0,
traffic_score=85.0,
competition_density=10,
delivery_orders=1000,
avg_delivery_price=28.0,
nearby_facilities=["Facility 1", "Facility 2"],
target_audience_match=0.8
)
# Calculate score
score, result = analyzer.calculate_score(location_data)
generate_report.py)Generates HTML and JSON reports from analysis results.
Key Classes:
ReportGenerator: Handles report generation with HTML templatesUsage Pattern:
from generate_report import ReportGenerator
# Create generator
generator = ReportGenerator(analyzer)
# Generate HTML report (uses report_template_simple.html)
html_path = generator.generate_html_report(
results=[result],
district="District Name",
output_path="/path/to/output/report.html"
)
# Generate JSON report
json_report = analyzer.generate_report_json(results, "District Name")
report_template_simple.html: Primary template for report generation (recommended)report_template.html: Alternative template with additional featuresThe report generator automatically uses the simple template unless specified otherwise.
Different store types use different evaluation weights:
Coffee Shops / Bubble Tea Shops:
Toy Stores:
Bakeries:
Restaurants:
Clothing Stores:
Convenience Stores:
When real data is unavailable:
Commercial Districts (e.g., Financial District):
Residential Areas (e.g., Community Districts):
Transportation Hubs (e.g., Train Stations):
Always save output files to the user's output directory:
选址分析报告_{location}_{store_type}.html选址分析数据_{location}_{store_type}.jsonAfter generating reports, use declare_artifact to register the HTML report as a final deliverable.
All files are in the same directory:
SKILL.md - This filelocation_analyzer.py - Core analysis enginegenerate_report.py - Report generatorreport_template_simple.html - Primary HTML template (recommended)report_template.html - Alternative HTML template共 1 个版本