ලාංකිකයාගේ visa ඉරණම python ඇසින්

namal_sir_buduwewa

Well-known member
  • Aug 13, 2021
    284
    517
    93
    පොහොට්ටු ගූ බල්ලොන්ගේ විහිලු කතා පැත්තක තියලා අපි වත්මන් තත්වය පොඩ්ඩක් විශ්ලේශණය කරමු.

    මෙන්න යන්න පුලුවන් රටවල් ලිස්ට් එක.

    https://en.wikipedia.org/wiki/Visa_requirements_for_Sri_Lankan_citizens

    පොඩි python script ලියලා රටවල් ලිස්ට් එක කොපි කරගන්න පුලුවන් (සමහර කෑලි ඉන්ටනෙට් එකෙන් කොපි කරා කම්මැලිකමට )

    Python:
    import pandas as pd
    import requests
    from bs4 import BeautifulSoup 
    
    wikiurl="https://en.wikipedia.org/wiki/Visa_requirements_for_Sri_Lankan_citizens"
    table_class="wikitable sortable jquery-tablesorter"
    response=requests.get(wikiurl)
    print(response.status_code)
    
    soup = BeautifulSoup(response.text, 'html.parser')
    sltable=soup.find('table',{'class':"wikitable"})
    
    df=pd.read_html(str(sltable))
    df=pd.DataFrame(df[0])
    print(df.head())
    
    
    data = df.drop(["Notes (excluding departure fees)"], axis=1)
    data = data.rename(columns={"country": "Country","req": "Visa requirement"})

    මට වැඩිය dataframes, numpy එක්ක වැඩ බෑ, අපි data scientists ලා නෙමෙයිනේ. ඔක්කොම python lists කරගමු

    Python:
    import numpy as np
    final = list([list(l) for l in np.array(data)])

    දැණ් මෙතනින් evisa හරි on arrival හරි පුලුවන් රටවල් ටික තෝරලා ගමු.

    Python:
    evisa_or_on_arrival   = [f for f in final if "Visa required" not in f[1]]
    [['Antigua and Barbuda', 'Electronic Entry Visa[15]', nan],
    ['Azerbaijan', 'eVisa[21]', '30 days[22]'],
    ['Bahamas', 'Visa not required[23]', '3 months'],
    ['Barbados', 'Visa not required[26]', '6 months'],
    ['Benin', 'eVisa / Visa on arrival[30][31]', '30 days / 8 days'],
    ['Bolivia', 'Visa on arrival[33]', '90 days'],
    ['Cambodia', 'eVisa/Visa on arrival[42]', '30 days'],
    ['Cape Verde', 'Visa on arrival[45]', nan],
    ['Comoros', 'Visa on arrival[51]', nan],
    ["Côte d'Ivoire", 'eVisa[55]', '3 months'],
    ['Djibouti', 'eVisa[61]', '31 days'],
    ['Dominica', 'Visa not required[62]', '6 months'],
    ['Ethiopia', 'eVisa[71]', 'up to 90 days'],
    ['Gabon', 'eVisa[75]', nan],
    ['Gambia', 'Visa not required[76]', '90 days'],
    ['Grenada', 'Visa not required[82]', '3 months'],
    ['Guinea', 'eVisa[84]', '90 days'],
    ['Guinea-Bissau', 'eVisa / Visa on arrival[85]', '90 days'],
    ['Haiti', 'Visa not required[87]', '90 days'],
    ['Indonesia', 'Visa not required[92]', '30 days'],
    ['Kazakhstan', 'eVisa[101]', nan],
    ['Kenya', 'eVisa / Visa on arrival[102]', '3 months'],
    ['Kyrgyzstan', 'eVisa[107]', nan],
    ['Laos', 'eVisa / Visa on arrival[108]', '30 days'],
    ['Lesotho', 'Visa not required[111]', '90 days'],
    ['Madagascar', 'eVisa / Visa on arrival[117]', '90 days'],
    ['Malawi', 'eVisa[118][119]', nan],
    ['Malaysia', 'eVisa[120]', nan],
    ['Maldives', 'Visa on arrival[122]', '30 days'],
    ['Mauritania', 'Visa on arrival[126]', nan],
    ['Mauritius', 'Visa on arrival[127]', '60 days[128]'],
    ['Micronesia', 'Visa not required[130]', '30 days'],
    ['Moldova', 'eVisa[131]', nan],
    ['Myanmar', 'eVisa[139]', '28 days'],
    ['Nepal', 'Visa on arrival[142]', '90 days'],
    ['Pakistan', 'Electronic Travel Authorization[152]', nan],
    ['Palau', 'Visa on arrival[156]', '30 days'],
    ['Qatar', 'eVisa[164][165]', nan],
    ['Rwanda', 'eVisa / Visa on arrival[168]', '30 days'],
    ['Saint Kitts and Nevis', 'Visa not required[169]', nan],
    ['Saint Vincent and the Grenadines', 'Visa not required[171]', '1 month'],
    ['Samoa', 'Entry Permit on arrival[172]', '60 days'],
    ['São Tomé and Príncipe', 'eVisa[174]', nan],
    ['Senegal', 'Visa on arrival[176]', nan],
    ['Seychelles', "Visitor's Permit on arrival[178]", '3 months'],
    ['Sierra Leone', 'Visa on arrival[179]', nan],
    ['Singapore', 'Visa not required[180]', '30 days'],
    ['Somalia', 'Visa on arrival[184]', '30 days'],
    ['South Sudan', 'Electronic Visa[186]', nan],
    ['Suriname', 'eVisa[190]', nan],
    ['Tajikistan', 'Visa not required[194][195]', '30 days'],
    ['Timor-Leste', 'Visa on arrival[198]', '30 days'],
    ['Togo', 'Visa on arrival[199]', '7 days'],
    ['Tuvalu', 'Visa on arrival[205]', '1 month'],
    ['Uganda', 'eVisa / Visa on arrival[206]', '3 months'],
    ['Uzbekistan', 'eVisa[213]', '30 days'],
    ['Vanuatu', 'Visa not required[215]', '30 days'],
    ['Venezuela', 'Visa not required[217]', '90 days'],
    ['Zambia', 'eVisa[221]', nan],
    ['Zimbabwe', 'eVisa[222]', nan]]


    හුටා 60 ක් තියනවා, නරක නෑ. අපි එච්චර දියුනුද?
    අපි මේ රටවල් හැට විශ්ලේශණය කරමු තවදුරට...

    Python:
    evisa_or_on_a_formatted = [l[:2] for l in evisa_or_on_arrival]

    වෙන වෙනම මහද්වීප වලට රටවල් ටික වෙන් කරමු. පොඩි library එකක් import කරන්න උනා මේකට.

    Python:
    import pycountry_convert as pc
    
    def get_continent(country_name):
        try:
            country_code = pc.country_name_to_country_alpha2(country_name, cn_name_format="default")
            return pc.country_alpha2_to_continent_code(country_code)
        except:
            return "NA"
    
    
    evisa_or_on_arrival_by_continent = [[*c,get_continent(c[0])]  for c in evisa_or_on_a_formatted]

    ඇප්‍රිකා රටවල් සෙට් එක ගමු වෙනම..

    Python:
    african_free_c = [c for c in evisa_or_on_arrival_by_continent if c[2] == 'AF']
    len(african_free_c)
    [['Benin', 'eVisa / Visa on arrival[30][31]', 'AF'],
    ['Cape Verde', 'Visa on arrival[45]', 'AF'],
    ['Comoros', 'Visa on arrival[51]', 'AF'],
    ["Côte d'Ivoire", 'eVisa[55]', 'AF'],
    ['Djibouti', 'eVisa[61]', 'AF'],
    ['Ethiopia', 'eVisa[71]', 'AF'],
    ['Gabon', 'eVisa[75]', 'AF'],
    ['Gambia', 'Visa not required[76]', 'AF'],
    ['Guinea', 'eVisa[84]', 'AF'],
    ['Guinea-Bissau', 'eVisa / Visa on arrival[85]', 'AF'],
    ['Kenya', 'eVisa / Visa on arrival[102]', 'AF'],
    ['Lesotho', 'Visa not required[111]', 'AF'],
    ['Madagascar', 'eVisa / Visa on arrival[117]', 'AF'],
    ['Malawi', 'eVisa[118][119]', 'AF'],
    ['Mauritania', 'Visa on arrival[126]', 'AF'],
    ['Mauritius', 'Visa on arrival[127]', 'AF'],
    ['Rwanda', 'eVisa / Visa on arrival[168]', 'AF'],
    ['São Tomé and Príncipe', 'eVisa[174]', 'AF'],
    ['Senegal', 'Visa on arrival[176]', 'AF'],
    ['Seychelles', "Visitor's Permit on arrival[178]", 'AF'],
    ['Sierra Leone', 'Visa on arrival[179]', 'AF'],
    ['Somalia', 'Visa on arrival[184]', 'AF'],
    ['South Sudan', 'Electronic Visa[186]', 'AF'],
    ['Togo', 'Visa on arrival[199]', 'AF'],
    ['Uganda', 'eVisa / Visa on arrival[206]', 'AF'],
    ['Zambia', 'eVisa[221]', 'AF'],
    ['Zimbabwe', 'eVisa[222]', 'AF']]

    හුටා, 60න් 27ක්ම ඇප්‍රිකන් රටවල් (ඇප්‍රිකා සුපිරි රටවල් තියනවා ethiopia, rwanda වගේ ඒත් උඹලට ඇත්තටම එහෙ යන්න ඕන වෙයිද කියල හිතලා බලපන් )

    (ටිකක් හරි) වැඩකට ඇති රටවල් = Ethiopia, Rwanda, Seychelles, Zambia

    හරි ඉතුරු මහද්වීප බලමු...
    රටවල් 33ක් ඉතුරුයි..

    යුරෝප් වලින් එක රටයි, යුරෝප් වල දුප්පත්ම රට.
    Python:
    eu_free_c = [c for c in evisa_or_on_arrival_by_continent if c[2] == 'EU']
    len(eu_free_c)
    [['Moldova', 'eVisa[131]', 'EU']]
     

    namal_sir_buduwewa

    Well-known member
  • Aug 13, 2021
    284
    517
    93
    කමක් නෑ ඇවිත් පනින්න හරි පුලුවන්නේ.

    වැඩකට ඇති රටවල් = Moldova

    ආසියාවෙනම් වැඩකට ඇති රටවල් කීපයක් තියනවා.

    Python:
    as_free_c = [c for c in evisa_or_on_arrival_by_continent if c[2] == 'AS']
    len(as_free_c)
    [['Azerbaijan', 'eVisa[21]', 'AS'],
    ['Cambodia', 'eVisa/Visa on arrival[42]', 'AS'],
    ['Indonesia', 'Visa not required[92]', 'AS'],
    ['Kazakhstan', 'eVisa[101]', 'AS'],
    ['Kyrgyzstan', 'eVisa[107]', 'AS'],
    ['Laos', 'eVisa / Visa on arrival[108]', 'AS'],
    ['Malaysia', 'eVisa[120]', 'AS'],
    ['Maldives', 'Visa on arrival[122]', 'AS'],
    ['Myanmar', 'eVisa[139]', 'AS'],
    ['Nepal', 'Visa on arrival[142]', 'AS'],
    ['Pakistan', 'Electronic Travel Authorization[152]', 'AS'],
    ['Qatar', 'eVisa[164][165]', 'AS'],
    ['Singapore', 'Visa not required[180]', 'AS'],
    ['Tajikistan', 'Visa not required[194][195]', 'AS'],
    ['Uzbekistan', 'eVisa[213]', 'AS']]

    වැඩකට ඇති රටවල් = Singapore, Indonesia, Kazakhastan, Malaysia, Maldives, Qatar

    දැන් අන්තිමට ඇමරිකන් සහ පැසිපික් රටවල් බලමු.
    Python:
    na_free_c = [c for c in evisa_or_on_arrival_by_continent if c[2] in ['NA', 'SA', 'OC']]
    len(na_free_c)
    [['Antigua and Barbuda', 'Electronic Entry Visa[15]', 'NA'],
    ['Bahamas', 'Visa not required[23]', 'NA'],
    ['Barbados', 'Visa not required[26]', 'NA'],
    ['Bolivia', 'Visa on arrival[33]', 'SA'],
    ['Dominica', 'Visa not required[62]', 'NA'],
    ['Grenada', 'Visa not required[82]', 'NA'],
    ['Haiti', 'Visa not required[87]', 'NA'],
    ['Micronesia', 'Visa not required[130]', 'OC'],
    ['Palau', 'Visa on arrival[156]', 'OC'],
    ['Saint Kitts and Nevis', 'Visa not required[169]', 'NA'],
    ['Saint Vincent and the Grenadines', 'Visa not required[171]', 'NA'],
    ['Samoa', 'Entry Permit on arrival[172]', 'OC'],
    ['Suriname', 'eVisa[190]', 'SA'],
    ['Timor-Leste', 'Visa on arrival[198]', 'NA'],
    ['Tuvalu', 'Visa on arrival[205]', 'OC'],
    ['Vanuatu', 'Visa not required[215]', 'OC'],
    ['Venezuela', 'Visa not required[217]', 'SA']]

    මේ පොඩි පොඩි දූපත් නම් ඕන එකෙක්ට එන්න යන්න දෙනවා. මොකද උන්ට හැම රටකම වගේ ඉන්න ලොකුම හොරුන්ගේ (මයිනොංගේ, කපුටොංගේ) සල්ලි තියාගන්න බැංකු (tax havens) තියනවා. ඒ වගෙම cruises, yachts, boats වලින් එන මිනිස්සුන්ට ලේසි වෙන්නත් එක්ක තමයි මෙහෙම තියෙන්නේ.

    හයිටි වලටනම් යන්න උඹලට පිස්සු වෙන්න ඕන. ආමි එකේ උන්ටනම් හොඳයි.
    බොලිවියා කියන්නේ landlocked රටක්, ඉතුන් උන්ට ලොකු ප්‍රශනයක් නෑ මොකා ආවත්. සුරිනාමුත් එහෙමයි.

    (ටිකක් හරි) වැඩකට ඇති රටවල් = -

    ඔන්න ඔහොමයි තත්වෙ, දුකයි ශෝචනීයයි. ඇත්තටම ඔතනින් visa on arrival/ visa free තියෙන්නෙ රටවල් 31ක් විතරයි.
    එතනිනුත් අප්‍රිකානු, සහ පැසිපික් දූපත්, කැරිබියන් දූපත්, දකුණු ඇමරිකාවෙ දුප්පත් රටවල් ටික අයින් කරාම...
    Python:
    true_free_c = [c for c in evisa_or_on_arrival_by_continent if c[2] != 'AF' and "eVisa" not in c[1] and "Electronic" not in c[1] and c[2] not in ['NA', 'SA', 'OC']]
    len(true_free_c)
    [['Indonesia', 'Visa not required[92]', 'AS'],
    ['Maldives', 'Visa on arrival[122]', 'AS'],
    ['Nepal', 'Visa on arrival[142]', 'AS'],
    ['Singapore', 'Visa not required[180]', 'AS'],
    ['Tajikistan', 'Visa not required[194][195]', 'AS']]

    රටවල් 4යි, ඔක්කොම Asian. ටජිකිස්තානෙත් ගූ හැත්තෑවේ රටක්. ඇත්තටම ඇත්තටම බැලුවම තියෙන්නෙ මෙච්චරයි.
    1. ඉන්දොනීසියාව
    2. මාලදිවයින
    3. නේපාලය
    4. සිංගප්පූරුව

    ඔන්න ඔහොමයි අවුරුදු 70ක් තිස්සේ උඹලට ඇරපු ඇරිල්ල python වලින්.

    NB1: යුරෝපියන් PR/residency තියනවනම් මීට අමතරව EU එකෙ ගොඩක් රටවල් (27 in EU + 15/16 others) වලට යන්න පුලුවන්.
    NB2: එක්කෝ මේ ඉන්න උන්ව එලවලා දාල මුල ඉඳන් අලුත් system එකක් පටන්ගනින්, නැත්තම් ඕක දාල පලයව්.
     

    shenat

    Well-known member
  • May 13, 2007
    58,434
    86,690
    113
    ආශ්චර්යමත් රටක
    ඕක තමා හැත්තෑ වසරක සංවර්ධනය.

    ආ කුහක කමට වැරදුනා. තව -70 Billion USD විතර ණය කන්දකුත් හැදුවා. ඒකෙන් බාගෙකට වඩා හැදුවෙ රට හොඳටම සොන්වර්ධනේ කරපු මයිනා ඇතුලු පරම්පරාව.
     

    namal_sir_buduwewa

    Well-known member
  • Aug 13, 2021
    284
    517
    93
    ඕක තමා හැත්තෑ වසරක සංවර්ධනය.

    ආ කුහක කමට වැරදුනා. තව -70 Billion USD විතර ණය කන්දකුත් හැදුවා. ඒකෙන් බාගෙකට වඩා හැදුවෙ රට හොඳටම සොන්වර්ධනේ කරපු මයිනා ඇතුලු පරම්පරාව.
    කියලා වැඩක් නෑ බං, මෙහෙම දෙයක් වෙලා තියෙද්දීවත් මුන් විප්ලවයක් කරයි කියලා හිතුවා.
    බලපන් ඒත් EVEN NOW මේකේ තියන ත්‍රෙඩ් වලින් බාගයක් ගෑනුන්ගේ පුකවලුයි, ලින්ක් ඉල්ලන්නයි. එලකිරි කියන්නේ ලංකාවේ තරුන, මැදි වයස් ආකල්ප වල හොඳ පැතිකඩක්.
    මුන් හැදෙන රටක් නෙමෙයි
     

    Sen-lu

    Well-known member
  • කියලා වැඩක් නෑ බං, මෙහෙම දෙයක් වෙලා තියෙද්දීවත් මුන් විප්ලවයක් කරයි කියලා හිතුවා.
    බලපන් ඒත් EVEN NOW මේකේ තියන ත්‍රෙඩ් වලින් බාගයක් ගෑනුන්ගේ පුකවලුයි, ලින්ක් ඉල්ලන්නයි. එලකිරි කියන්නේ ලංකාවේ තරුන, මැදි වයස් ආකල්ප වල හොඳ පැතිකඩක්.
    මුන් හැදෙන රටක් නෙමෙයි
    අපි දැන් වගා විප්ලවයක් පටාන් අරං තියෙන්නෙ. ඔය අයියලා මයියොක්ක දණ්ඩක් එහෙම හිටෙව්වෙ නැතැයි. එහෙමයිලු ප්‍රගතිශීලී ජහමනය වැඩකරන්නෙ
     

    olu bakka

    Well-known member
  • Aug 18, 2011
    22,736
    23,408
    113
    Supiri
    Etkota apita puluwanda bn singapore wage kshanikawa ynna hituna gaman. Online earnings thiyena ekektann chance ekk habayi
     

    namal_sir_buduwewa

    Well-known member
  • Aug 13, 2021
    284
    517
    93
    Supiri
    Etkota apita puluwanda bn singapore wage kshanikawa ynna hituna gaman. Online earnings thiyena ekektann chance ekk habayi
    The best country in Asia for remote work is Indonesia. They have a normal visa scheme which is very easy to get.

    What about india?
    Funny they couldn't negociate even that, fucking morins in the foreign ministry.
    ------ Post added on Jun 20, 2022 at 5:24 PM