Razpoložljivost
0 je bilo izbranih Ponastavi
Cena
Najvišja cena je $79.99 Ponastavi
$
$
Razvrščanje: Priporočeno
Razvrščanje:
457 del izdelkov
Zaslon
Zaslon
Razpoložljivost
0 je bilo izbranih Ponastavi
Cena
Najvišja cena je $79.99 Ponastavi
$
$
457 del izdelkov
Jasen
Priporočeno
Razvrščanje:
457 del izdelkov

Recently viewed

import re import csv import random from dataclasses import dataclass, field from typing import Optional # ============================== # 1. League Database # ============================== league_db = { "Premier League": ["premier league", "epl"], "La Liga": ["la liga", "laliga"], "Serie A": ["serie a"], "Bundesliga": ["bundesliga"], "Ligue 1": ["ligue 1"], "UEFA Champions League": ["champions league", "ucl"], "FIFA World Cup": ["world cup"], "UEFA Euro": ["euro"], "Copa America": ["copa america"], "MLS": ["mls"], "NCAA": ["ncaa", "college football", "college basketball"], "NFL": ["nfl", "national football league"], "NBA": ["nba", "national basketball association"], "MLB": ["mlb", "major league baseball"], "NHL": ["nhl", "national hockey league"], } # ============================== # 2. Team Database (32 NFL + 30 NBA + 30 MLB + 32 NHL + 30 NCAA + European Soccer) # ============================== team_db = { # European Soccer "Manchester United": ["manchester united", "man utd"], "Manchester City": ["manchester city", "man city"], "Liverpool": ["liverpool"], "Arsenal": ["arsenal"], "Chelsea": ["chelsea"], "Tottenham Hotspur": ["tottenham", "spurs"], "Real Madrid": ["real madrid"], "FC Barcelona": ["barcelona", "barca"], "Juventus": ["juventus", "juve"], "AC Milan": ["ac milan"], "Inter Milan": ["inter milan", "inter"], "Bayern Munich": ["bayern munich", "bayern"], "Paris Saint-Germain": ["psg", "paris saint-germain"], # NFL "Arizona Cardinals": ["arizona cardinals"], "Atlanta Falcons": ["atlanta falcons"], "Baltimore Ravens": ["baltimore ravens"], "Buffalo Bills": ["buffalo bills"], "Carolina Panthers": ["carolina panthers"], "Chicago Bears": ["chicago bears"], "Cincinnati Bengals": ["cincinnati bengals"], "Cleveland Browns": ["cleveland browns"], "Dallas Cowboys": ["dallas cowboys"], "Denver Broncos": ["denver broncos"], "Detroit Lions": ["detroit lions"], "Green Bay Packers": ["green bay packers"], "Houston Texans": ["houston texans"], "Indianapolis Colts": ["indianapolis colts"], "Jacksonville Jaguars": ["jacksonville jaguars"], "Kansas City Chiefs": ["kansas city chiefs"], "Las Vegas Raiders": ["las vegas raiders"], "Los Angeles Chargers": ["la chargers", "los angeles chargers"], "Los Angeles Rams": ["la rams", "los angeles rams"], "Miami Dolphins": ["miami dolphins"], "Minnesota Vikings": ["minnesota vikings"], "New England Patriots": ["new england patriots"], "New Orleans Saints": ["new orleans saints"], "New York Giants": ["new york giants"], "New York Jets": ["new york jets"], "Philadelphia Eagles": ["philadelphia eagles"], "Pittsburgh Steelers": ["pittsburgh steelers"], "San Francisco 49ers": ["san francisco 49ers"], "Seattle Seahawks": ["seattle seahawks"], "Tampa Bay Buccaneers": ["tampa bay buccaneers"], "Tennessee Titans": ["tennessee titans"], "Washington Commanders": ["washington commanders"], # NBA "Atlanta Hawks": ["atlanta hawks"], "Boston Celtics": ["boston celtics"], "Brooklyn Nets": ["brooklyn nets"], "Charlotte Hornets": ["charlotte hornets"], "Chicago Bulls": ["chicago bulls"], "Cleveland Cavaliers": ["cleveland cavaliers"], "Dallas Mavericks": ["dallas mavericks"], "Denver Nuggets": ["denver nuggets"], "Detroit Pistons": ["detroit pistons"], "Golden State Warriors": ["golden state warriors"], "Houston Rockets": ["houston rockets"], "Indiana Pacers": ["indiana pacers"], "Los Angeles Clippers": ["la clippers", "los angeles clippers"], "Los Angeles Lakers": ["la lakers", "los angeles lakers"], "Memphis Grizzlies": ["memphis grizzlies"], "Miami Heat": ["miami heat"], "Milwaukee Bucks": ["milwaukee bucks"], "Minnesota Timberwolves": ["minnesota timberwolves"], "New Orleans Pelicans": ["new orleans pelicans"], "New York Knicks": ["new york knicks"], "Oklahoma City Thunder": ["oklahoma city thunder"], "Orlando Magic": ["orlando magic"], "Philadelphia 76ers": ["philadelphia 76ers"], "Phoenix Suns": ["phoenix suns"], "Portland Trail Blazers": ["portland trail blazers"], "Sacramento Kings": ["sacramento kings"], "San Antonio Spurs": ["san antonio spurs"], "Toronto Raptors": ["toronto raptors"], "Utah Jazz": ["utah jazz"], "Washington Wizards": ["washington wizards"], # MLB "Arizona Diamondbacks": ["arizona diamondbacks"], "Atlanta Braves": ["atlanta braves"], "Baltimore Orioles": ["baltimore orioles"], "Boston Red Sox": ["boston red sox"], "Chicago Cubs": ["chicago cubs"], "Chicago White Sox": ["chicago white sox"], "Cincinnati Reds": ["cincinnati reds"], "Cleveland Guardians": ["cleveland guardians"], "Colorado Rockies": ["colorado rockies"], "Detroit Tigers": ["detroit tigers"], "Houston Astros": ["houston astros"], "Kansas City Royals": ["kansas city royals"], "Los Angeles Angels": ["la angels", "los angeles angels"], "Los Angeles Dodgers": ["la dodgers", "los angeles dodgers"], "Miami Marlins": ["miami marlins"], "Milwaukee Brewers": ["milwaukee brewers"], "Minnesota Twins": ["minnesota twins"], "New York Mets": ["new york mets"], "New York Yankees": ["new york yankees"], "Oakland Athletics": ["oakland athletics"], "Philadelphia Phillies": ["philadelphia phillies"], "Pittsburgh Pirates": ["pittsburgh pirates"], "San Diego Padres": ["san diego padres"], "San Francisco Giants": ["san francisco giants"], "Seattle Mariners": ["seattle mariners"], "St. Louis Cardinals": ["st louis cardinals"], "Tampa Bay Rays": ["tampa bay rays"], "Texas Rangers": ["texas rangers"], "Toronto Blue Jays": ["toronto blue jays"], "Washington Nationals": ["washington nationals"], # NHL "Anaheim Ducks": ["anaheim ducks"], "Arizona Coyotes": ["arizona coyotes"], "Boston Bruins": ["boston bruins"], "Buffalo Sabres": ["buffalo sabres"], "Calgary Flames": ["calgary flames"], "Carolina Hurricanes": ["carolina hurricanes"], "Chicago Blackhawks": ["chicago blackhawks"], "Colorado Avalanche": ["colorado avalanche"], "Columbus Blue Jackets": ["columbus blue jackets"], "Dallas Stars": ["dallas stars"], "Detroit Red Wings": ["detroit red wings"], "Edmonton Oilers": ["edmonton oilers"], "Florida Panthers": ["florida panthers"], "Los Angeles Kings": ["la kings", "los angeles kings"], "Minnesota Wild": ["minnesota wild"], "Montreal Canadiens": ["montreal canadiens"], "Nashville Predators": ["nashville predators"], "New Jersey Devils": ["new jersey devils"], "New York Islanders": ["new york islanders"], "New York Rangers": ["new york rangers"], "Ottawa Senators": ["ottawa senators"], "Philadelphia Flyers": ["philadelphia flyers"], "Pittsburgh Penguins": ["pittsburgh penguins"], "San Jose Sharks": ["san jose sharks"], "Seattle Kraken": ["seattle kraken"], "St. Louis Blues": ["st louis blues"], "Tampa Bay Lightning": ["tampa bay lightning"], "Toronto Maple Leafs": ["toronto maple leafs"], "Vancouver Canucks": ["vancouver canucks"], "Vegas Golden Knights": ["vegas golden knights"], "Washington Capitals": ["washington capitals"], "Winnipeg Jets": ["winnipeg jets"], # NCAA "Alabama Crimson Tide": ["alabama crimson tide", "alabama football"], "Ohio State Buckeyes": ["ohio state buckeyes"], "Clemson Tigers": ["clemson tigers"], "LSU Tigers": ["lsu tigers"], "Oklahoma Sooners": ["oklahoma sooners"], "Georgia Bulldogs": ["georgia bulldogs"], "Texas Longhorns": ["texas longhorns"], "Michigan Wolverines": ["michigan wolverines"], "Notre Dame Fighting Irish": ["notre dame fighting irish"], "Penn State Nittany Lions": ["penn state nittany lions"], "Florida State Seminoles": ["florida state seminoles"], "Auburn Tigers": ["auburn tigers"], "USC Trojans": ["usc trojans"], "Oregon Ducks": ["oregon ducks"], "Miami Hurricanes": ["miami hurricanes"], "Duke Blue Devils": ["duke blue devils"], "Kentucky Wildcats": ["kentucky wildcats"], "Kansas Jayhawks": ["kansas jayhawks"], "North Carolina Tar Heels": ["north carolina tar heels"], "Villanova Wildcats": ["villanova wildcats"], "Gonzaga Bulldogs": ["gonzaga bulldogs"], "Virginia Cavaliers": ["virginia cavaliers"], "Michigan State Spartans": ["michigan state spartans"], "Arizona Wildcats": ["arizona wildcats"], "Texas A&M Aggies": ["texas a&m aggies"], "Tennessee Volunteers": ["tennessee volunteers"], "Florida Gators": ["florida gators"], "Wisconsin Badgers": ["wisconsin badgers"], "Iowa Hawkeyes": ["iowa hawkeyes"], "Arkansas Razorbacks": ["arkansas razorbacks"], } # ============================== # 3. National Team Database # ============================== country_db = { "England National Team": ["england"], "France National Team": ["france"], "Germany National Team": ["germany"], "Spain National Team": ["spain"], "Italy National Team": ["italy"], "Brazil National Team": ["brazil"], "Argentina National Team": ["argentina"], "Portugal National Team": ["portugal"], "Netherlands National Team": ["netherlands", "holland"], "USA National Team": ["usa", "united states"], "Canada National Team": ["canada"], "Japan National Team": ["japan"], "South Korea National Team": ["south korea", "korea"], "Mexico National Team": ["mexico"], } # ============================== # 4. Sport Database # ============================== sport_db = { "Soccer": ["soccer", "football jersey", "football kit"], "Basketball": ["basketball"], "American Football": ["american football", "nfl jersey", "college football"], "Baseball": ["baseball"], "Ice Hockey": ["ice hockey", "hockey"], } # ============================== # 5. 【核心】多变体随机模板 # ============================== sport_templates = { "Soccer": { "sport_desc": [ "Soccer unites millions around the globe through thrilling matchdays, legendary rivalries and intricate tactical battles. It is far more than a sport; it is a worldwide culture built on passion, lifelong loyalty and unforgettable sporting moments.", "Across every continent, soccer brings communities together. From local street pitches to iconic stadiums, the beautiful game thrives on teamwork, dramatic comebacks and generations of devoted supporters.", "Soccer’s magic lies in its simplicity and global reach. Historic trophies, heated derby clashes and shared fan rituals create a living culture that transcends borders, languages and backgrounds." ], "league_desc": [ "{league_name} delivers elite soccer drama each season, blending world-class athletes, clever tactical battles and a massive international fanbase. Every fixture carries heritage, pride and bragging rights.", "As one of the globe’s most watched soccer competitions, {league_name} constantly serves up iconic goals, tense showdowns and emerging talent that captures the attention of supporters everywhere.", "{league_name} has defined modern soccer culture, with storied clubs, blockbuster fixtures and passionate fan communities spanning every corner of the world." ], "team_desc": [ "{team_name} is etched deep into soccer folklore, home to legendary players, historic triumphs and a global family of supporters. Wear this jersey to show your loyalty at stadiums, watch parties or as everyday streetwear.", "Rooted in decades of unforgettable soccer history, {team_name} boasts a worldwide fanbase united by pride in every match. This jersey lets you display your allegiance wherever you go.", "For diehard supporters of {team_name}, this jersey is more than apparel. It represents decades of iconic matches, club identity and the bond shared with fellow fans across the planet." ], "national_team_desc": [ "{country_name} carries national football pride onto the world stage. Major international tournaments unite supporters as one; this kit is a lasting way to represent your nation’s soccer legacy.", "When {country_name} steps onto the pitch, national pride takes centre stage. This jersey lets you stand with your nation during global tournaments and celebrate your country’s football identity." ] }, "Basketball": { "sport_desc": [ "Basketball moves fast, built on explosive athleticism, sharp tactical systems and thrilling momentum swings. From buzzer-beaters to streetball culture, it blends competitive fire with contemporary style.", "Courtside energy, creative ball handling and hard-fought playoff series define basketball. It appeals to fans who love individual brilliance as well as seamless team coordination and modern sports fashion.", "Basketball continues to evolve as both elite competition and global street culture. Quick transitions, clutch scoring and iconic rivalries keep fans engaged season after season." ], "league_desc": [ "{league_name} stands as basketball’s premier global platform, featuring generational stars, creative offence and dramatic postseason battles that resonate with fans worldwide.", "Every season, {league_name} writes new basketball narratives through marquee matchups, rising talent and high-stakes playoff clashes that become lasting sports memories.", "{league_name} redefines modern basketball culture, merging elite athletic competition with global streetwear trends and passionate local fan communities." ], "team_desc": [ "{team_name} has built an enduring basketball legacy through championship campaigns, legendary athletes and strong city pride. Perfect for courtside viewing, fan meetups and casual daily styling.", "Deeply connected to its city’s identity, {team_name} inspires generations of basketball fans. This jersey offers an authentic way to showcase your team loyalty on all occasions.", "Whether you are attending games, hosting watch parties or building fan apparel collections, this {team_name} jersey lets you carry the team’s proud basketball heritage everywhere." ], "national_team_desc": [ "{country_name} brings elite basketball talent to international tournaments, combining superstar athletes and national pride. Represent your country’s hoops legacy with this distinctive jersey.", "On the global basketball stage, {country_name} competes for international glory. This kit lets you display national pride and celebrate your nation’s rich basketball tradition." ] }, "American Football": { "sport_desc": [ "American Football is a tactical physical battle featuring specialised offensive, defensive and special teams units. Game strategy, clock control and explosive plays shape every matchup and postseason chase.", "More than just contact sport, American Football is a weekly cultural event. Carefully designed play calls, tense fourth-quarter drama and long-standing franchise rivalries captivate casual and hardcore fans alike.", "American Football rewards discipline, preparation and resilience. Every snap matters, turning regular-season contests into meaningful chapters in each franchise’s history." ], "league_desc": [ "{league_name} transforms weekly matchups into major cultural moments, with historic franchises, layered strategy and high-stakes postseason battles that unite fans across regions.", "As North America’s top professional American football competition, {league_name} creates unforgettable narratives around legendary rosters, heated divisional rivalries and championship pursuits.", "{league_name} delivers unmatched game-day atmosphere, from tailgates to playoff pressure, cementing its place as a cornerstone of modern American sports culture." ], "team_desc": [ "{team_name} embodies tradition, grit and regional pride. This jersey is ideal for tailgate gatherings, watch parties and building a bold fan wardrobe to honour every drive and big play.", "With decades of memorable seasons and standout rosters, {team_name} commands loyal support across its fanbase. Show your commitment with authentic team graphics and classic styling.", "For dedicated fans of {team_name}, this jersey symbolises loyalty through every tough matchup, comeback victory and championship pursuit in American football history." ], "national_team_desc": [ "{country_name} represents its nation in international American football tournaments, sharing the sport’s unique tactical culture globally. Wear this jersey to display national football pride.", "Overseas competitions let {country_name} showcase elite American football talent on the world stage. This kit lets you support your nation’s international football campaign." ] }, "Baseball": { "sport_desc": [ "Baseball unfolds slowly around tense pitcher-batter duels, careful defensive positioning and season-long storylines. It is a sport of routines, records and multi-generational family fandom.", "Rooted in decades of tradition, baseball builds drama across long regular seasons. Late-inning comebacks, historic franchise milestones and timeless stadium atmosphere keep fans returning year after year.", "Baseball’s charm lies in its rhythm and narrative depth. Every plate appearance, defensive shift and postseason series can grow into legendary sports folklore." ], "league_desc": [ "{league_name} delivers baseball drama through long regular-season races, tight divisional battles and dramatic postseason series that fans revisit for generations.", "Home to iconic franchises and historic baseball moments, {league_name} creates enduring sports stories built around legendary players, winning streaks and hard-fought championship runs.", "{league_name} remains the gold standard of professional baseball, blending classic stadium culture with modern athletic competition and dedicated local fan bases." ], "team_desc": [ "{team_name} carries decades of baseball heritage, unforgettable playoff moments and generations of loyal supporters. Great for stadium visits, retro streetwear and thoughtful fan gifts.", "From legendary lineups to historic championship campaigns, {team_name} holds a special place in baseball history. This jersey delivers timeless styling for casual wear and game-day outings.", "Whether you are a lifelong follower or building your vintage sports apparel collection, this {team_name} jersey lets you celebrate the franchise’s rich baseball legacy every day." ], "national_team_desc": [ "{country_name} competes on the international diamond, bringing national pride to global baseball tournaments. This jersey honours your country’s unique baseball culture and athletic talent.", "When {country_name} takes the field in international baseball competition, national pride takes centre stage. Show your support for your nation’s baseball heritage with this official-style kit." ] }, "Ice Hockey": { "sport_desc": [ "Ice Hockey is fast, physical and unpredictable. Rapid line changes, intense goaltending battles and sudden momentum swings make every period full of tension and excitement.", "Skating skill, controlled contact and relentless pace define ice hockey. Historic rivalries and hard-fought playoff contests create an atmosphere unlike any other team sport.", "From puck drop to final buzzer, ice hockey rewards quick reactions, team chemistry and mental toughness. Overtime drama and iconic playoff runs fuel lifelong fan passion." ], "league_desc": [ "{league_name} is North America’s premier professional ice hockey league, famous for intense playoff battles, historic franchises and the legendary pursuit of the Stanley Cup.", "Overtime thrillers, fierce divisional rivalries and elite goaltending define {league_name}. Every season writes new chapters in ice hockey’s rich competitive history.", "{league_name} delivers authentic ice culture, with storied clubs, heated matchups and passionate regional fan communities that live for playoff hockey." ], "team_desc": [ "{team_name} boasts deep ice hockey tradition, memorable playoff campaigns and a devoted local fanbase. This jersey works perfectly for arena nights, watch parties and everyday fan fashion.", "Built on iconic skaters, historic rivalries and regional pride, {team_name} connects fans across generations. Show your loyalty with authentic team graphics and comfortable fan styling.", "For hockey fans who live for game-day atmosphere, this {team_name} jersey is a staple. Wear it to celebrate historic wins and share pride with fellow supporters." ], "national_team_desc": [ "{country_name} sends elite skaters and goaltenders to compete in global ice hockey tournaments. This jersey lets you honour your nation’s skating, checking and goaltending heritage.", "On the international ice, {country_name} battles for global hockey glory. Represent your nation and celebrate its strong ice hockey tradition with this team jersey." ] } } # ============================== # 6. Data Class # ============================== @dataclass class ProductAnalysis: title: str subtitle: str sport: Optional[str] = None leagues: list = field(default_factory=list) teams: list = field(default_factory=list) countries: list = field(default_factory=list) category_intro: str = "" # ============================== # 7. Keyword Matching Logic # ============================== def analyze_product(title: str, subtitle: str) -> ProductAnalysis: combined_text = f"{title} {subtitle}".lower() res = ProductAnalysis(title=title, subtitle=subtitle) # Match Sport for s_name, keywords in sport_db.items(): if any(k.lower() in combined_text for k in keywords): res.sport = s_name break # Match League for lg_name, keywords in league_db.items(): if any(k.lower() in combined_text for k in keywords): res.leagues.append(lg_name) # Match Team for t_name, keywords in team_db.items(): if any(k.lower() in combined_text for k in keywords): res.teams.append(t_name) # Match National Team for c_name, keywords in country_db.items(): if any(k.lower() in combined_text for k in keywords): res.countries.append(c_name) res.category_intro = build_description(res) return res # ============================== # 8. 随机抽取变体 + 文案组装(核心渲染函数) # ============================== def build_description(analysis: ProductAnalysis) -> str: if not analysis.sport or analysis.sport not in sport_templates: return "General sports apparel item for sports fans. Featuring classic team styling for casual wear, match viewing and fan collection." tmpl = sport_templates[analysis.sport] parts = [] # 随机抽取运动描述 sport_text = random.choice(tmpl["sport_desc"]) parts.append(f"Sport: {sport_text}") # 联赛文案 for lg in analysis.leagues: lg_template = random.choice(tmpl["league_desc"]) lg_text = lg_template.format(league_name=lg) parts.append(f"League: {lg_text}") # 球队文案 for tm in analysis.teams: tm_template = random.choice(tmpl["team_desc"]) tm_text = tm_template.format(team_name=tm) parts.append(f"Team: {tm_text}") # 国家队文案 for nt in analysis.countries: nt_template = random.choice(tmpl["national_team_desc"]) nt_text = nt_template.format(country_name=nt) parts.append(f"National Team: {nt_text}") # 统一追加面料穿搭卖点(跨境电商固定收尾) ending = "Crafted from lightweight breathable fabric, this jersey delivers a comfortable relaxed fit, suitable for game days, casual outings, fan gatherings and gifting to fellow supporters." parts.append(ending) # 切换输出格式 return "\n".join(parts) # return " ".join(parts) # ============================== # 9. Batch & Export # ============================== def batch_process(products: list): rows = [] for item in products: t = item.get("Title", "") s = item.get("Subtitle", "") ana = analyze_product(t, s) row = { "Title": t, "Subtitle": s, "Sport": ana.sport or "Unidentified", "Leagues": ", ".join(ana.leagues) or "Unidentified", "Teams": ", ".join(ana.teams) or "Unidentified", "NationalTeams": ", ".join(ana.countries) or "Unidentified", "CategoryDescription": ana.category_intro } rows.append(row) return rows def export_csv(rows, filename="sport_product_random_description.csv"): if not rows: print("No data to export.") return with open(filename, "w", newline="", encoding="utf-8-sig") as f: writer = csv.DictWriter(f, fieldnames=rows[0].keys()) writer.writeheader() writer.writerows(rows) print(f"✅ File exported: {filename}") # ============================== # Test Demo # ============================== if __name__ == "__main__": sample_products = [ {"Title": "Dallas Cowboys NFL Game Jersey", "Subtitle": "American Football Uniform"}, {"Title": "Los Angeles Lakers NBA Basketball Jersey", "Subtitle": "Official Team Apparel"}, {"Title": "New York Yankees MLB Home Jersey", "Subtitle": "Baseball Shirt"}, {"Title": "Toronto Maple Leafs NHL Ice Hockey Jersey", "Subtitle": "Official Uniform"}, {"Title": "Manchester United Premier League Home Jersey", "Subtitle": "Soccer Kit"}, {"Title": "Alabama Crimson Tide NCAA Football Jersey", "Subtitle": "College Apparel"} ] results = batch_process(sample_products) for r in results: print("-" * 90) print(f"Title: {r['Title']}") print(f"Sport: {r['Sport']}") print(f"CategoryDescription:\n{r['CategoryDescription']}") export_csv(results)

Vaša košarica

Nalaganje