import json from itertools import groupby # a = [ # {'username': "dev_1009048", 'password': "e60be16cbfeebdb4d4c7dd7c0a6f2f67", 'nickname': "", 'avatar': ""}, # {'username': "dev_1009049", 'password': "e60be16cbfeebdb4d4c7dd7c0a6f2f67", 'nickname': "", 'avatar': ""}, # {'username': "dev_1009050", 'password': "e60be16cbfeebdb4d4c7dd7c0a6f2f67", 'nickname': "", 'avatar': ""} # ] # b = json.dumps(a) # print(b) hotel_arr = [ { "Id" : 1179302758386278426, "ENName" : "Holiday Inn Resort Phuket, an IHG Hotel (SHA Extra Plus)" }, { "Id" : 1179302758386278460, "ENName" : "The Okura Prestige Bangkok" }, { "Id" : 1179302758386278467, "ENName" : "Ibis Styles Bangkok Ratchada" }, { "Id" : 1179302758386278471, "ENName" : "Como Metropolitan Bangkok" }, { "Id" : 1179302765696950370, "ENName" : "InterContinental Koh Samui Resort" }, { "Id" : 1179302772906958871, "ENName" : "Wyndham Sea Pearl Resort, Phuket(SHA Extra Plus)" }, { "Id" : 1179302780486066207, "ENName" : "Hotel M Chiang Mai" }, { "Id" : 1179302795359068183, "ENName" : "Centara Grand & Bangkok Convention Centre at CentralWorld" }, { "Id" : 1179302817517576243, "ENName" : "The Grass Serviced Suites" }, { "Id" : 1179302824845025295, "ENName" : "Maduzi Hotel, Bangkok" }, { "Id" : 1179302824845025300, "ENName" : "Pullman Bangkok Hotel G" }, { "Id" : 1179302846760263731, "ENName" : "The Berkeley Hotel Pratunam Bangkok" }, { "Id" : 1179302869254316118, "ENName" : "Stay with Nimman Chiang Mai" }, { "Id" : 1179303117871685645, "ENName" : "Marina Gallery Resort-Kacha-Kalim Bay" }, { "Id" : 1179303117871685649, "ENName" : "Wyndham Grand Nai Harn Beach Phuket" }, { "Id" : 1179303163316969479, "ENName" : "Ascott Embassy Sathorn Bangkok" }, { "Id" : 1179303163316969510, "ENName" : "Somerset Pattaya" }, { "Id" : 1179303163316969514, "ENName" : "Sheraton Samui Resort" }, { "Id" : 1179303163316969518, "ENName" : "W Koh Samui" }, { "Id" : 1179303765497389121, "ENName" : "New Orient Landmark Hotel" }, { "Id" : 1179303781356052503, "ENName" : "Rio Hotel" }, { "Id" : 1179305771175813194, "ENName" : "The Macau Roosevelt" }, { "Id" : 1179313280867409926, "ENName" : "Mitsui Garden Hotel Ginza-Gochome" }, { "Id" : 1179313294817665048, "ENName" : "Four Seasons Hotel Kuala Lumpur" }, { "Id" : 1179313294817665057, "ENName" : "Mitsui Garden Hotel Ueno" }, { "Id" : 1179302758386278406, "ENName" : "Sindhorn Kempinski Bangkok" }, { "Id" : 1179302758386278412, "ENName" : "Melia Phuket Mai Khao(SHA Extra Plus)" }, { "Id" : 1179302758386278454, "ENName" : "Four Seasons Resort Chiang Mai" }, { "Id" : 1179302758386278459, "ENName" : "Chatrium Grand Bangkok" }, { "Id" : 1179302758386278469, "ENName" : "Ibis Styles Bangkok Sukhumvit Phra Khanong" }, { "Id" : 1179302758386278483, "ENName" : "Anantara Chiang Mai Resort" }, { "Id" : 1179302765696950292, "ENName" : "Twin Lotus Resort & Spa Koh Lanta(SHA Extra Plus)" }, { "Id" : 1179302765696950360, "ENName" : "Novotel Phuket Kata Avista Resort and Spa" }, { "Id" : 1179302772906958854, "ENName" : "Grand Mercure Phuket Patong(SHA Extra Plus)" }, { "Id" : 1179302772906958874, "ENName" : "Shangri-La Hotel, Chiang Mai" }, { "Id" : 1179302772906958881, "ENName" : "The Bayview Hotel Pattaya" }, { "Id" : 1179302772906958896, "ENName" : "The Surin Phuket" }, { "Id" : 1179302772906958903, "ENName" : "Metadee Concept Hotel (SHA Extra Plus)" }, { "Id" : 1179302780486066272, "ENName" : "Rawi Warin Resort and Spa(SHA Extra Plus)" }, { "Id" : 1179302795359068205, "ENName" : "SAii Koh Samui Choengmon" }, { "Id" : 1179302795359068241, "ENName" : "Rarin Jinda Wellness Spa Resort" }, { "Id" : 1179302810102046795, "ENName" : "Sand Sea Resort Railay Krabi" }, { "Id" : 1179302824845025302, "ENName" : "VIE Hotel Bangkok, MGallery Hotel Collection" }, { "Id" : 1179302832143114241, "ENName" : "Park Hyatt Bangkok" }, { "Id" : 1179302832143114282, "ENName" : "Malisa Villa Suites (SHA Extra Plus)" }, { "Id" : 1179302876837617667, "ENName" : "Eastin Tan Hotel Chiang Mai" }, { "Id" : 1179303117871685699, "ENName" : "Sindhorn Midtown Hotel Bangkok, Vignette Collection - an IHG Hotel" }, { "Id" : 1179302758386278407, "ENName" : "Shangri-La Hotel Bangkok" }, { "Id" : 1179302758386278449, "ENName" : "Eastin Grand Hotel Sathorn" }, { "Id" : 1179302758386278451, "ENName" : "Layana Resort & Spa(SHA Extra Plus)" }, { "Id" : 1179302758386278452, "ENName" : "Banyan Tree Krabi" }, { "Id" : 1179302758386278453, "ENName" : "Banyan Tree Samui (SHA Plus+)" }, { "Id" : 1179302758386278457, "ENName" : "SO Bangkok" }, { "Id" : 1179302758386278466, "ENName" : "The Ritz-Carlton, Koh Samui" }, { "Id" : 1179302758386278472, "ENName" : "Movenpick Bdms Wellness Resort Bangkok" }, { "Id" : 1179302758386278474, "ENName" : "Anantara Koh YAO Yai Resort & Villas" }, { "Id" : 1179302765696950349, "ENName" : "Pimalai Resort & Spa" }, { "Id" : 1179302765696950351, "ENName" : "Siam Bayshore Resort Pattaya" }, { "Id" : 1179302772906958880, "ENName" : "Centara Grand Mirage Beach Resort Pattaya" }, { "Id" : 1179302787939344464, "ENName" : "Mercure Bangkok Makkasan" }, { "Id" : 1179302802724266023, "ENName" : "Sofitel Krabi Phokeethra Golf and Spa Resort (SHA Plus+)" }, { "Id" : 1179302824845025296, "ENName" : "Ramada Plaza by Wyndham Bangkok Menam Riverside" }, { "Id" : 1179302824845025306, "ENName" : "Aonang Villa Resort(SHA Extra Plus)" }, { "Id" : 1179302832143114256, "ENName" : "Crowne Plaza Phuket Panwa Beach" }, { "Id" : 1179302832143114289, "ENName" : "Renaissance Pattaya Resort & Spa - Sha Extra Plus" }, { "Id" : 1179302839474757712, "ENName" : "Hard Rock Hotel Pattaya" }, { "Id" : 1179302854100295763, "ENName" : "Vignette Collection Dinso Resort & Villas Phuket, an IHG Hotel" }, { "Id" : 1179302861423550560, "ENName" : "Mercure Bangkok Sukhumvit 11" }, { "Id" : 1179302943950676062, "ENName" : "Raya Heritage (SHA Extra Plus)" }, { "Id" : 1179303102436646978, "ENName" : "Levana Pattaya Hotel" }, { "Id" : 1179313309405454351, "ENName" : "New World Phu Quoc" }, { "Id" : 1179313309405454384, "ENName" : "Hotel Naru Seoul MGallery Ambassador" }, { "Id" : 1179313337494708229, "ENName" : "Amber Hotel Central" }, { "Id" : 1179313337494708238, "ENName" : "HARRIS Hotel Kuta Tuban Bali" }, { "Id" : 1179313337494708246, "ENName" : "Villa Samadhi by Samadhi" }, { "Id" : 1179313352191549453, "ENName" : "Migliore Hotel Seoul Myeongdong" }, { "Id" : 1179313380272414745, "ENName" : "Studio M Hotel" }, { "Id" : 1179313380272414761, "ENName" : "Best Western Premier Gangnam Hotel" }, { "Id" : 1179313380272414764, "ENName" : "The Westin Josun Seoul" }, { "Id" : 1179313380272414774, "ENName" : "Mia Resort Nha Trang" }, { "Id" : 1179313409217306647, "ENName" : "Shangri-La Rasa Ria, Kota Kinabalu" }, { "Id" : 1179313409217306655, "ENName" : "Goodwood Park Hotel" }, { "Id" : 1179313409217306660, "ENName" : "The Oberoi Beach Resort, Bali" }, { "Id" : 1179313437403029526, "ENName" : "Grand Millennium Kuala Lumpur" }, { "Id" : 1179313597164068881, "ENName" : "Conrad Bali" }, { "Id" : 1179313597164068913, "ENName" : "Redtop Hotel & Convention Center" }, { "Id" : 1179313626155098160, "ENName" : "Padma Resort Ubud Bali" }, { "Id" : 1179313841255784498, "ENName" : "Hotel Villa Fontaine Grand Tokyo-Shiodome" }, { "Id" : 1179313927272570939, "ENName" : "Holiday Inn Express Baruna, an IHG Hotel" }, { "Id" : 1179313984705175618, "ENName" : "The Ambassador Seoul - A Pullman Hotel" }, { "Id" : 1179314114292392002, "ENName" : "Mercure Kuala Lumpur Shaw Parade" }, { "Id" : 1179314202012065797, "ENName" : "Amiana Resort Nha Trang" }, { "Id" : 1179314230931791878, "ENName" : "Carlton City Hotel Singapore" }, { "Id" : 1179314230931791879, "ENName" : "Carlton Hotel Singapore" }, { "Id" : 1179314260233199628, "ENName" : "The Seacare Hotel" }, { "Id" : 1179314260233199686, "ENName" : "One Farrer Hotel" }, { "Id" : 1179303132962791494, "ENName" : "Seabed Grand Hotel Phuket(SHA Extra Plus)" }, { "Id" : 1179303155528147014, "ENName" : "Panwaburi Beachfront Resort(SHA Extra Plus)" }, { "Id" : 1179303765497389083, "ENName" : "Regal Riverside Hotel" }, { "Id" : 1179303773407846474, "ENName" : "LArc Macau" }, { "Id" : 1179303773407846475, "ENName" : "Mandarin Oriental Macau" }, { "Id" : 1179303781356052540, "ENName" : "Hong Kong Disneyland Hotel" }, { "Id" : 1179313280867409925, "ENName" : "Millennium Mitsui Garden Hotel Tokyo" }, { "Id" : 1179313280867409934, "ENName" : "Mitsui Garden Hotel Roppongi Tokyo Premier" }, { "Id" : 1179313294817665050, "ENName" : "Capri by Fraser Bukit Bintang" }, { "Id" : 1179313294817665051, "ENName" : "Pavilion Hotel Kuala Lumpur Managed by Banyan Tree" }, { "Id" : 1179313309405454347, "ENName" : "Mulia Resort Nusa Dua Bali" }, { "Id" : 1179313309405454375, "ENName" : "Six Senses Uluwatu" }, { "Id" : 1179313309405454380, "ENName" : "Four Points by Sheraton Singapore, Riverview (SG Clean)" }, { "Id" : 1179313352191549454, "ENName" : "Palazzo Versace Dubai" }, { "Id" : 1179313366032752662, "ENName" : "Hotel Boss Singapore" }, { "Id" : 1179313380272414768, "ENName" : "Ming Garden Hotel & Residences Kota Kinabalu" }, { "Id" : 1179313395095085056, "ENName" : "Four Seasons Resort Langkawi" }, { "Id" : 1179313395095085079, "ENName" : "Pullman Saigon Centre" }, { "Id" : 1179313582085546026, "ENName" : "Century Park Hotel" }, { "Id" : 1179313611831549970, "ENName" : "Merlynn Park Hotel" }, { "Id" : 1179313611831550008, "ENName" : "The Grove Suites by GRAND ASTON" }, { "Id" : 1179313611831550026, "ENName" : "Hilton Garden Inn Bali Ngurah Rai Airport" }, { "Id" : 1179313827125174275, "ENName" : "Hotel Leo" }, { "Id" : 1179313827125174283, "ENName" : "The Shilla Jeju" }, { "Id" : 1179313984705175637, "ENName" : "Vista Walkerhill Seoul - formerly W Seoul" }, { "Id" : 1179302758386278410, "ENName" : "Four Seasons Hotel Bangkok at Chao Phraya River" }, { "Id" : 1179302758386278445, "ENName" : "Conrad Koh Samui" }, { "Id" : 1179302765696950278, "ENName" : "Nora Buri Resort & Spa" }, { "Id" : 1179302765696950288, "ENName" : "Holiday Inn Express Bangkok Sathorn, an IHG Hotel" }, { "Id" : 1179302765696950327, "ENName" : "Four Seasons Resort Koh Samui" }, { "Id" : 1179302765696950336, "ENName" : "Six Senses Koh Samui" }, { "Id" : 1179302772906958911, "ENName" : "Akyra Manor Chiang Mai" }, { "Id" : 1179302772906958945, "ENName" : "Kata Rocks Hotel Phuket" }, { "Id" : 1179302780486066228, "ENName" : "Aster Hotel and Residence" }, { "Id" : 1179302787939344450, "ENName" : "Avista Hideaway Phuket Patong - MGallery (SHA Extra Plus)" }, { "Id" : 1179302795359068192, "ENName" : "Holiday Inn Bangkok Silom, an IHG Hotel" }, { "Id" : 1179302795359068236, "ENName" : "Ibis Styles Phuket City" }, { "Id" : 1179302795359068246, "ENName" : "Amora Thapae Hotel Chiang Mai" }, { "Id" : 1179302802724266018, "ENName" : "LANTA CHA-DA BEACH RESORT & SPA(SHA Extra Plus)" }, { "Id" : 1179302802724266020, "ENName" : "Dusit Thani Krabi Beach Resort" }, { "Id" : 1179302839474757680, "ENName" : "Crowne Plaza Bangkok Lumpini Park, an IHG Hotel" }, { "Id" : 1179303048925716516, "ENName" : "Lub D Koh Samui Chaweng Beach" }, { "Id" : 1179303079888068619, "ENName" : "Novotel Chiangmai Nimman Journeyhub" }, { "Id" : 1179303163316969487, "ENName" : "Thai Fight Hotel" }, { "Id" : 1179303186016542734, "ENName" : "Chanalai Hillside Resort" }, { "Id" : 1179303781356052492, "ENName" : "Metropark Hotel Macau" }, { "Id" : 1179303789417504782, "ENName" : "Harbour Grand Kowloon" }, { "Id" : 1179313309405454336, "ENName" : "Hotel Hankyu RESPIRE OSAKA" }, { "Id" : 1179313309405454381, "ENName" : "Centara Grand Hotel Osaka" }, { "Id" : 1179314274934235197, "ENName" : "Oasia Hotel Downtown, Singapore by Far East Hospitality (Staycation Approved)" }, { "Id" : 1179314319020564537, "ENName" : "Lone Pine Hotel Penang (PenangFightCovid-19 Certified)" }, { "Id" : 1179314376868405262, "ENName" : "Berjaya Times Square Kuala Lumpur" }, { "Id" : 1179314376868405287, "ENName" : "Swissotel the Stamford" }, { "Id" : 1179314420069736455, "ENName" : "Ocean Suites Jeju Hotel" }, { "Id" : 1179314420069736488, "ENName" : "Monarque Hotel Danang" }, { "Id" : 1179314477951131658, "ENName" : "Hoshino Resorts Risonare Tomamu Hotel Hokkaido" }, { "Id" : 1179314506912800811, "ENName" : "The Majestic Hotel Kuala Lumpur, Autograph Collection" }, { "Id" : 1179314594091409476, "ENName" : "Anantara Desert Islands Resort & Spa" }, { "Id" : 1179314594091409490, "ENName" : "Conrad Abu Dhabi Etihad Towers" }, { "Id" : 1179314944890413062, "ENName" : "OMO5 Tokyo Otsuka by Hoshino Resorts" }, { "Id" : 1179315255176634390, "ENName" : "Travelodge Myeongdong City Hall" }, { "Id" : 1179315255176634406, "ENName" : "Plataran Ubud Hotel & Spa - CHSE Certified" }, { "Id" : 1179315342430740515, "ENName" : "Fourpoints by Sheraton Seoul Gangnam" }, { "Id" : 1179316545805918229, "ENName" : "Jhl Solitaire Gading Serpong" }, { "Id" : 1179316667759501313, "ENName" : "Cross Bali Breakers" }, { "Id" : 1179316895132721188, "ENName" : "Liber Hotel at Universal Studio Japan" }, { "Id" : 1179317060816117811, "ENName" : "Kaamala Resort Ubud" }, { "Id" : 1179317283491717194, "ENName" : "Aston Kemayoran City Hotel" }, { "Id" : 1179317355784740895, "ENName" : "Dears Myeongdong" }, { "Id" : 1179317385891455044, "ENName" : "MAUA Nusa Penida Bali" }, { "Id" : 1179317431198326794, "ENName" : "Ana Mandara Cam Ranh" }, { "Id" : 1179318020930052100, "ENName" : "Sleeping Lion Suites" }, { "Id" : 1179303117871685648, "ENName" : "Carlton Hotel Bangkok Sukhumvit (SHA Plus+)" }, { "Id" : 1179303163316969512, "ENName" : "Renaissance Koh Samui Resort & Spa" }, { "Id" : 1179303186016542720, "ENName" : "Lanna Samui" }, { "Id" : 1179303239053516828, "ENName" : "Phuket Emerald Beach Resort" }, { "Id" : 1179303765497389131, "ENName" : "The Royal Pacific Hotel and Towers" }, { "Id" : 1179303765497389134, "ENName" : "The Kowloon Hotel" }, { "Id" : 1179303773407846412, "ENName" : "Hotel Lisboa" }, { "Id" : 1179303773407846466, "ENName" : "Hotel Sintra" }, { "Id" : 1179303781356052537, "ENName" : "Disneys Hollywood Hotel" }, { "Id" : 1179305732848263220, "ENName" : "Harbour Grand Hong Kong" }, { "Id" : 1179305742071537721, "ENName" : "Hongkong Disney Explorers Lodge" }, { "Id" : 1179313280867409938, "ENName" : "Cerulean Tower Tokyu Hotel Tokyo" }, { "Id" : 1179313294817665065, "ENName" : "Hotel Vischio Osaka" }, { "Id" : 1179313309405454373, "ENName" : "Bulgari Resort Bali" }, { "Id" : 1179313352191549463, "ENName" : "Swiss-Belinn Legian" }, { "Id" : 1179313366032752657, "ENName" : "The Bellevue Resort" }, { "Id" : 1179313395095085105, "ENName" : "Movenpick Resort & Spa Jimbaran Bali" }, { "Id" : 1179313395095085109, "ENName" : "Mithi Resort and Spa Bohol" }, { "Id" : 1179313409217306630, "ENName" : "Pullman Kuala Lumpur City Centre Hotel & Residences" }, { "Id" : 1179313423066898445, "ENName" : "Coast Boracay" }, { "Id" : 1179313582081351694, "ENName" : "Berry Amour Romantic Villas" }, { "Id" : 1179313597164068947, "ENName" : "Swiss-Belresort Watu Jimbar" }, { "Id" : 1179313611831550018, "ENName" : "Holiday Inn Resort Baruna Bali, an IHG Hotel" }, { "Id" : 1179313798469689375, "ENName" : "Sheraton Miyako Hotel Osaka" }, { "Id" : 1179313798469689407, "ENName" : "Sotetsu Grand Fresa Tokyo-Bay Ariake" }, { "Id" : 1179313813116198923, "ENName" : "Shibuya Excel Hotel Tokyu Tokyo" }, { "Id" : 1179318020930052186, "ENName" : "Oasia Hotel Novena, Singapore by Far East Hospitality" }, { "Id" : 1179661167287640064, "ENName" : "Silavadee Pool Spa Resort" }, { "Id" : 1179662920645124096, "ENName" : "Borneo Divers Mabul Resort Semporna" }, { "Id" : 1179663349131026432, "ENName" : "Sipadan Kapalai Dive Resort" }, { "Id" : 1179728128717660160, "ENName" : "Alma Resort Cam Ranh" }, { "Id" : 1179728218823892992, "ENName" : "Radisson Blu Resort Cam Ranh" }, { "Id" : 1184342385539194880, "ENName" : "Kimpton Kitalay Samui, an IHG Hotel" }, { "Id" : 1188688637324206080, "ENName" : "The Racha (SHA Plus+)" }, { "Id" : 1194847744590651392, "ENName" : "Four Seasons Hotel Seoul" }, { "Id" : 1179313337494708228, "ENName" : "Maison Glad Jeju" }, { "Id" : 1179313337494708234, "ENName" : "InterContinental Nha Trang, an Ihg Hotel" }, { "Id" : 1179313380272414744, "ENName" : "M Social Singapore" }, { "Id" : 1179313380272414757, "ENName" : "InterContinental Seoul COEX" }, { "Id" : 1179313395095085092, "ENName" : "Anantara Hoi An Resort" }, { "Id" : 1179313409217306656, "ENName" : "Shilla Stay Jeju" }, { "Id" : 1179313597164068884, "ENName" : "Hotel Indonesia Kempinski Jakarta" }, { "Id" : 1179313597164068898, "ENName" : "Favehotel Tanah Abang - Cideng" }, { "Id" : 1179313813116198913, "ENName" : "Palace Hotel Tokyo" }, { "Id" : 1179313813116198916, "ENName" : "The Peninsula Tokyo" }, { "Id" : 1179313927272570923, "ENName" : "Swiss-Belhotel Tuban" }, { "Id" : 1179313956179714090, "ENName" : "Ramada Encore by Wyndham Bali Seminyak" }, { "Id" : 1179313984705175610, "ENName" : "Hotel Samjung Seoul" }, { "Id" : 1179313984705175612, "ENName" : "Grand Walkerhill Seoul" }, { "Id" : 1179314013218054202, "ENName" : "Conrad Osaka" }, { "Id" : 1179314084970012704, "ENName" : "Be Grand Resort Bohol" }, { "Id" : 1179314084970012715, "ENName" : "Iconic Hotel Penang" }, { "Id" : 1179314143618965538, "ENName" : "Berjaya Langkawi Resort" }, { "Id" : 1179314143618965573, "ENName" : "Hotel Shangri-la Kota Kinabalu" }, { "Id" : 1179314158320001027, "ENName" : "The Palace Hotel Kota Kinabalu" }, { "Id" : 1179314173016842333, "ENName" : "Avangio Hotel Kota Kinabalu" }, { "Id" : 1179314230927597589, "ENName" : "Holiday Inn Express Kuala Lumpur City Centre" }, { "Id" : 1179314230931791877, "ENName" : "Royal Plaza on Scotts Singapore" }, { "Id" : 1179314230931791881, "ENName" : "Fairmont Singapore" }, { "Id" : 1179314245595078657, "ENName" : "Sofitel Singapore Sentosa Resort & Spa (Staycation Approved)" }, { "Id" : 1179314260233199663, "ENName" : "Grand Copthorne Waterfront" }, { "Id" : 1179314143618965534, "ENName" : "Bayview Hotel Langkawi" }, { "Id" : 1179314216599855157, "ENName" : "Liberty Central Saigon Centre Hotel" }, { "Id" : 1179314230931791882, "ENName" : "YWCA Fort Canning" }, { "Id" : 1179314230931791884, "ENName" : "Peninsula Excelsior Hotel Singapore" }, { "Id" : 1179314260233199670, "ENName" : "Crowne Plaza Changi Airport Singapore" }, { "Id" : 1179314260233199675, "ENName" : "Dorsett Singapore" }, { "Id" : 1179314319020564564, "ENName" : "AYANA Resort Bali" }, { "Id" : 1179314376868405271, "ENName" : "Dayang Bay Resort Langkawi" }, { "Id" : 1179314434301009934, "ENName" : "Gloucester Hotel Jeju" }, { "Id" : 1179314463669526557, "ENName" : "Kaze No Terrace Kukuna Hotel" }, { "Id" : 1179314477951131664, "ENName" : "Radisson Blu Bali Uluwatu" }, { "Id" : 1179314477951131669, "ENName" : "Siloso Beach Resort, Sentosa" }, { "Id" : 1179314536205819960, "ENName" : "Aston Canggu Beach Resort" }, { "Id" : 1179314579830775816, "ENName" : "Hotel Mi Singapore" }, { "Id" : 1179314594091409462, "ENName" : "Jannah Burj Al Sarab" }, { "Id" : 1179314828343287822, "ENName" : "Anantara the Palm Dubai Resort" }, { "Id" : 1179314944890413093, "ENName" : "Co-op City Hotel Seongsan" }, { "Id" : 1179315561402769427, "ENName" : "Hotel Monterey Lefrere Osaka" }, { "Id" : 1179316054241878055, "ENName" : "Ibis Styles Kota Kinabalu Inanam Hotel" }, { "Id" : 1179316316713033783, "ENName" : "Wyndham Casablanca Jakarta" }, { "Id" : 1179316895132721213, "ENName" : "Aksari Resort Ubud by Ini Vie Hospitality - CHSE Certified" }, { "Id" : 1179316910181883945, "ENName" : "The Clan Hotel Singapore by Far East Hospitality" }, { "Id" : 1179317199190401081, "ENName" : "OZO George Town Penang" }, { "Id" : 1179317370733240389, "ENName" : "Oriental Hotel Universal City" }, { "Id" : 1179317416123998209, "ENName" : "Paramount Hotel Midtown" }, { "Id" : 1179317522629959754, "ENName" : "Aloft Langkawi Pantai Tengah" }, { "Id" : 1179317597691224064, "ENName" : "SKY Water Villas" }, { "Id" : 1179317703354130492, "ENName" : "Owen House by Hmlet" }, { "Id" : 1179317960041341000, "ENName" : "POM POM Island Resort" }, { "Id" : 1179318005763448868, "ENName" : "INNSiDE by Melia Kuala Lumpur Cheras" }, { "Id" : 1179318005763448913, "ENName" : "New World Hoiana Beach Resort" }, { "Id" : 1179318020930052102, "ENName" : "Bohol Dolphin Bay Resort" }, { "Id" : 1179318020930052106, "ENName" : "Hotel Groove Shinjuku, A Parkroyal Hotel" }, { "Id" : 1179318157995712540, "ENName" : "Four Points by Sheraton Bali, Kuta" }, { "Id" : 1179319720059379761, "ENName" : "The Face Style" }, { "Id" : 1179658140988252160, "ENName" : "Cape Dara Resort" }, { "Id" : 1179715670460375040, "ENName" : "Japamala Resorts - by Samadhi - Adults Only" }, { "Id" : 1179721964105801728, "ENName" : "Sutera @ Mantanani Island Resort & Spa" }, { "Id" : 1179722225750679552, "ENName" : "Best Western Premier Sonasea Villas Phu Quoc" }, { "Id" : 1179723501980917760, "ENName" : "Mandarin Nest Boracay" }, { "Id" : 1179727868628869120, "ENName" : "Meruorah Komodo Labuan Bajo" }, { "Id" : 1179731190874152960, "ENName" : "Avante Hotel" }, { "Id" : 1179732206034132992, "ENName" : "Feliz Hotel Boracay" }, { "Id" : 1179733283622133760, "ENName" : "Hoshino Resorts Tomamu the Tower" }, { "Id" : 1181773188003045376, "ENName" : "Hotel Yukari no Mori Kawaguchiko" }, { "Id" : 1181781266450653184, "ENName" : "ClubMed Tomamu Resort Hokkaido" }, { "Id" : 1185116168927617024, "ENName" : "Pullman Phuket Karon Beach Resort" }, { "Id" : 1186487394266816512, "ENName" : "Mountain Resort Koh Lipe" }, { "Id" : 1186487610327998464, "ENName" : "Anda Lipe Resort" }, { "Id" : 1190229712954236928, "ENName" : "Melia Vinpearl Phu Quoc" }, { "Id" : 1179313869772857358, "ENName" : "Hotel Gracery Shinjuku Tokyo" }, { "Id" : 1179314041760292925, "ENName" : "The Tower Plaza Hotel Dubai" }, { "Id" : 1179314216599855166, "ENName" : "Liberty Central Saigon Citypoint" }, { "Id" : 1179314230927597613, "ENName" : "Liberty Central Saigon Riverside Hotel" }, { "Id" : 1179314245595078715, "ENName" : "JW Marriott Hotel Kuala Lumpur" }, { "Id" : 1179314260233199666, "ENName" : "PARKROYAL COLLECTION Marina Bay, Singapore" }, { "Id" : 1179314274934235146, "ENName" : "Swiss-Garden Hotel Bukit Bintang Kuala Lumpur" }, { "Id" : 1179314319020564563, "ENName" : "RIMBA by AYANA Bali" }, { "Id" : 1179314347885764609, "ENName" : "The Westin Osaka" }, { "Id" : 1179314362251255878, "ENName" : "Dusit Thani Abu Dhabi" }, { "Id" : 1179314391208730625, "ENName" : "Bohol Beach Club" }, { "Id" : 1179314434301009931, "ENName" : "Aloft Seoul Gangnam" }, { "Id" : 1179314434301010008, "ENName" : "Wyndham Danang Golden Bay" }, { "Id" : 1179314477951131692, "ENName" : "Jeju Shinhwa World Marriott Resort" }, { "Id" : 1179314594091409505, "ENName" : "Shangri-la Hotel, Qayrayt Al Beri, Abu Dhabi" }, { "Id" : 1179314608435929090, "ENName" : "Traders Hotel, Qaryat Al Beri" }, { "Id" : 1179314740539727953, "ENName" : "The Capitol Kempinski Hotel Singapore" }, { "Id" : 1179315255176634396, "ENName" : "Hotel Sirius" }, { "Id" : 1179315445669339172, "ENName" : "Premier Village Phu Quoc Resort Managed by AccorHotels" }, { "Id" : 1179315489227186224, "ENName" : "Ibis Kuala Lumpur City Centre" }, { "Id" : 1179316211553443862, "ENName" : "The Apurva Kempinski Bali" }, { "Id" : 1179316363278196749, "ENName" : "citizenM Kuala Lumpur Bukit Bintang" }, { "Id" : 1179316864069705778, "ENName" : "Fuji Kawaguchiko Resort Hotel" }, { "Id" : 1179316910181883960, "ENName" : "W Osaka" }, { "Id" : 1179316940015968256, "ENName" : "Zentis Osaka" }, { "Id" : 1179316955497144341, "ENName" : "Hotel Villa Fontaine Grand Tokyo Ariake" }, { "Id" : 1179317385891455011, "ENName" : "Hotel Traveltine" }, { "Id" : 1179317416123998240, "ENName" : "Tribe Bali Kuta Beach" }, { "Id" : 1179318005763448839, "ENName" : "Singamata Adventures and Reef Resort Semporna" }, { "Id" : 1179318020930052097, "ENName" : "Pullman Singapore Orchard" }, { "Id" : 1179711890746548224, "ENName" : "Pullman Singapore Hill Street (Opening October 2023)" }, { "Id" : 1179714423997112320, "ENName" : "Gayana Marine Resort" }, { "Id" : 1179715112752160768, "ENName" : "Dreamtel Kota Kinabalu" }, { "Id" : 1179716658604843008, "ENName" : "Mabul Water Bungalows" }, { "Id" : 1179723312603897856, "ENName" : "Mandarin Bay Resort and Spa" }, { "Id" : 1179727956122050560, "ENName" : "Bunga Raya Island Resort & Spa" }, { "Id" : 1179731661642833920, "ENName" : "The Danna Langkawi Hotel" }, { "Id" : 1179732414017085440, "ENName" : "Semabu Hills Hotel Nusa Penida" }, { "Id" : 1185080571353669636, "ENName" : "InterContinental Bali Sanur Resort, an IHG Hotel" }, { "Id" : 1186910472885018624, "ENName" : "Le Méridien Phuket Mai Khao Beach Resort" }, { "Id" : 1179314274934235212, "ENName" : "Hotel Sixty3 Kota Kinabalu" }, { "Id" : 1179314347885764620, "ENName" : "Hotel Ciputra Jakarta managed by Swiss-Belhotel International" }, { "Id" : 1179314347885764644, "ENName" : "Hotel Indigo Bali Seminyak Beach, an IHG Hotel" }, { "Id" : 1179314376868405267, "ENName" : "The Face Suites" }, { "Id" : 1179314376868405292, "ENName" : "Orchard Hotel Singapore" }, { "Id" : 1179314463669526558, "ENName" : "Shuhokaku Kogetsu" }, { "Id" : 1179314477951131690, "ENName" : "Somerset Jeju Shinhwa World" }, { "Id" : 1179314594091409500, "ENName" : "Anantara Qasr al Sarab Desert Resort" }, { "Id" : 1179314871771111450, "ENName" : "Glad Hotel Mapo" }, { "Id" : 1179314871771111483, "ENName" : "Baiton Seoul Dongdaemun" }, { "Id" : 1179315284482236442, "ENName" : "Pan Borneo Hotel Kota Kinabalu" }, { "Id" : 1179315298839339031, "ENName" : "Ibis Ambassador Myeongdong" }, { "Id" : 1179315387339153484, "ENName" : "Yarra Ocean Suites Danang" }, { "Id" : 1179316697979461681, "ENName" : "Best Western Premier Sonasea Phu Quoc" }, { "Id" : 1179316818813165639, "ENName" : "The Story Resort" }, { "Id" : 1179316848999571511, "ENName" : "Potato Head Suites and Studios" }, { "Id" : 1179316864069705790, "ENName" : "Andaz Seoul Gangnam" }, { "Id" : 1179316879592824899, "ENName" : "Shinhwa Jeju Shinhwa World Hotels & Resorts" }, { "Id" : 1179316895132721152, "ENName" : "Landabout Tokyo" }, { "Id" : 1179316940015968288, "ENName" : "Paramount Hotel Dubai" }, { "Id" : 1179316955497144376, "ENName" : "Tokyu Stay Shinjuku Eastside" }, { "Id" : 1179317121193123885, "ENName" : "Lintas Platinum Hotel" }, { "Id" : 1179317431198326787, "ENName" : "Hyatt Centric Kota Kinabalu" }, { "Id" : 1179317431198326789, "ENName" : "Monocolo Boutique Hotel" }, { "Id" : 1179318005763448840, "ENName" : "SEA STAR RESORT SEMPORNA" }, { "Id" : 1179318005763448915, "ENName" : "Omo Kansai Airport by Hoshino Resorts" }, { "Id" : 1179360515076431872, "ENName" : "A-One the Royal Cruise Hotel Pattaya (SHA Extra Plus)" }, { "Id" : 1179626276017709056, "ENName" : "Amari Pattaya (SHA Plus+)" }, { "Id" : 1179681342879735808, "ENName" : "Plataran Komodo Resort & Spa - CHSE Certified" }, { "Id" : 1179712878580637696, "ENName" : "Citadines Connect City Centre Singapore" }, { "Id" : 1179727658133528576, "ENName" : "Sylvia Hotel & Resort Komodo" }, { "Id" : 1179728746119208960, "ENName" : "The Majestic Malacca Hotel" }, { "Id" : 1179732014262165504, "ENName" : "Loboc River Resort" }, { "Id" : 1179732623849725952, "ENName" : "Royale Chulan Seremban" }, { "Id" : 1179738039090454528, "ENName" : "New World Hoiana Hotel Vietnam" }, { "Id" : 1181845224335384576, "ENName" : "The Ritz-Carlton Bali" }, { "Id" : 1184441436720898048, "ENName" : "Sri Panwa Phuket Luxury Pool Villa Hotel (SHA Plus+)" } ] country_dict = { "东京": ["日本", "Japan", "Tokyo"], "仙本那": ["马来西亚", "Malaysia", "Semporna"], "会安": ["越南", "Vietnam", "Hoi An"], "兰卡威": ["马来西亚", "Malaysia", "Langkawi"], "北海道": ["日本", "Japan", "Hokkaido"], "吉隆坡": ["马来西亚", "Malaysia", "Kuala Lumpur"], "大阪": ["日本", "Japan", "Osaka"], "富国岛": ["越南", "Vietnam", "Phu Quoc Island"], "富士河口湖": ["日本", "Japan", "Mount Fuji"], "岘港": ["越南", "Vietnam", "Da Nang"], "巴厘岛": ["印度尼西亚", "Indonesia", "Bali"], "攀牙": ["泰国", "Thailand", "Phang Nga"], "新加坡": ["新加坡", "Singapore", "Singapore"], "普吉岛": ["泰国", "Thailand", "Phuket"], "曼谷": ["泰国", "Thailand", "Bangkok"], "槟城": ["马来西亚", "Malaysia", "Penang"], "沙巴": ["马来西亚", "Malaysia", "Sabah"], "济州岛": ["韩国", "Korea", "Jeju Island"], "清迈": ["泰国", "Thailand", "Chiang Mai"], "澳门": ["中国", "China", "Macau"], "甲米": ["泰国", "Thailand", "Krabi"], "科莫多": ["印度尼西亚", "Indonesia", "Komodo"], "素叻": ["泰国", "Thailand", "Surat Thani"], "胡志明市": ["越南", "Vietnam", "Ho Chi Minh City"], "芭堤雅": ["泰国", "Thailand", "Pattaya"], "芽庄": ["越南", "Vietnam", "Nha Trang"], "苏梅岛": ["泰国", "Thailand", "Koh Samui"], "薄荷岛": ["菲律宾", "Philippines", "Boracay"], "迪拜": ["阿联酋", "UAE", "Dubai"], "长滩岛": ["菲律宾", "Philippines", "Boracay Island"], "阿布扎比": ["阿联酋", "UAE", "Abu Dhabi"], "雅加达": ["印度尼西亚", "Indonesia", "Jakarta"], "首尔": ["韩国", "Korea", "Seoul"], "香港": ["中国", "China", "Hong Kong"], "马六甲市": ["马来西亚", "Malaysia", "Malacca City"] } def process(): with open('./json/data/old_product_list.json', 'r') as f: out_type = 3 # 1 输出酒店id 2 输出中文处理结果 3 输出英文处理结果 hotel_dict = dict([(p['Id'], p['ENName']) for p in hotel_arr]) in_dict = json.load(f) tmp_arr = [] id_arr = [] for item in in_dict['contents']: id = int(item['value']) city = item['cities'][0] if out_type == 1: id_arr.append(id) elif out_type == 2: new_item = { 'country': country_dict[city][0], 'city': '富士山' if city == '富士河口湖' else city, 'name': item['name'], 'value': id } if 'picture' in item: new_item['path'] = item['picture'] tmp_arr.append(new_item) else: new_item = { 'country': country_dict[city][1], 'city': country_dict[city][2], 'name': hotel_dict[id], 'value': id } if 'picture' in item: new_item['path'] = item['picture'] tmp_arr.append(new_item) if out_type == 1: print(id_arr) else: tmp_arr = sorted(tmp_arr, key=lambda p: (p['country'], p['city'])) tmp_group = groupby(tmp_arr, key=lambda p: (p['country'], p['city'])) country_iter = '' out_arr = [] for key, group in tmp_group: lst = [({'name': p['name'], 'value': p['value'], 'path': p['path']} if 'path' in p else {'name': p['name'], 'value': p['value']}) for p in group] if key[0] != country_iter: country_iter = key[0] out_arr.append({ 'countryName': country_iter, 'cities': [ { 'cityName': key[1], 'productItems': lst } ] }) else: out_arr[-1]['cities'].append({ 'cityName': key[1], 'productItems': lst }) print(json.dumps(out_arr, ensure_ascii=False))