Logo

ThaiPy - Bangkok Python Meetup

Monthly meetup for those interested in python, the most popular language in the world.

Visit our Meetup Page
Contact us via LINE

Next meetup

Every 3rd Thursday - Join Us RSVP

packages = ["python-dateutil", "BeautifulSoup4", "requests"] [splashscreen] enabled = false #[[fetch]] #from = 'https://openrss.org/www.meetup.com/thaipy-bangkok-python-meetup/' #from = "https://www.meetup.com/thaipy-bangkok-python-meetup/" #files = ["events"] import asyncio from datetime import datetime as dt import calendar import json import requests from dateutil.relativedelta import relativedelta from dateutil.parser import parse from pyodide.http import pyfetch from js import console import datetime now = dt.now().astimezone() async def get_next_event(): CORS_PROXY = "https://corsproxy.io/?" # page = await pyfetch(CORS_PROXY+"https://openrss.org/www.meetup.com/thaipy-bangkok-python-meetup/events/", # headers={"Accept": "application/rss+xml"}, mode="no-cors") url = CORS_PROXY+"https://www.meetup.com/thaipy-bangkok-python-meetup/events/" console.log(url) page = await pyfetch(url, mode="cors") text = (await page.bytes()).decode("utf8") top, rest = text.split('", 1) data = json.loads(script) props = data['props']['pageProps']['__APOLLO_STATE__'] withdates = (p for p in props.values() if hasattr(p, 'get') and p.get(u'dateTime')) nextdate = sorted((parse(p['dateTime']),p['title']) for p in withdates)[0] return nextdate async def get_next_repeat(): next_date = calendar.Calendar(3).monthdatescalendar(now.year, now.month)[3][0] if next_date < now.date(): next_date = calendar.Calendar(3).monthdatescalendar(now.year, now.month+1)[3][0] return (dt(next_date.year, next_date.month, next_date.day, 18, 30, 0, tzinfo=datetime.timezone(datetime.timedelta(hours=7))), "") def humanise_timedelta(td): time_arr = [] if td.months: time_arr.append(f"{td.months} month{'' if td.months == 1 else 's'}") if td.days: time_arr.append(f"{td.days} day{'' if td.days == 1 else 's'}") if td.hours: time_arr.append(f"{td.hours} hour{'' if td.hours == 1 else 's'}") if td.minutes: time_arr.append(f"{td.minutes} minute{'' if td.minutes == 1 else 's'}") if td.seconds: time_arr.append(f"{td.seconds} second{'' if td.seconds == 1 else 's'}") return " ".join(time_arr) async def main(): try: next_date, next_event = await get_next_event() except Exception as e: console.log(str(e)) next_date, next_event = await get_next_repeat() output_year = f"{next_date.strftime('%a %b %d')}" Element("newdate").write(output_year) while True: td = relativedelta(next_date, dt.now().astimezone()) Element("showtime").write("- in " + humanise_timedelta(td)) Element("title").write(next_event) await asyncio.sleep(1) asyncio.ensure_future(main()) # Feeds -

ThaiPy Health and Safety Policy

Our attendees’ health and safety remain our top priority as we continue to monitor the current health guidelines from the government to make the best and most informed decisions around onsite safety and requirements. ThaiPy has worked hard to be a community that is welcoming to all, including those of us who are immunocompromised, disabled, elderly, have support needs, or are caregivers for children, and those of us who share households with or caretake for people in those groups, so we will be erring on the side of safety for all participants.

The guidelines implemented for ThaiPy are subject to change based on health and safety recommendations at the time of our events. We are committing, however, to only make changes in the direction of greater protections.

Mask Requirement

Face coverings are not required at ThaiPy events. If you feel unwell then you are encouraged to wear a mask if attending.

Vaccination Requirement

ThaiPy no longer has a requirement for a COVID-19 vaccine. COVID-19 vaccines are effective at protecting people from getting seriously ill, being hospitalized, and dying. As with other diseases, you are protected best from COVID-19 when you stay up to date with the recommended vaccines, including locally available boosters.

Rapid Testing

We encourage attendees to do a rapid test before attending if you have any symtoms. There is no requirement for entry based on rapid testing however.