How to use covid - 1 common examples

To help you get started, we’ve selected a few covid examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github kandnub / TG-UserBot / userbot / plugins / covid.py View on Github external
async def covid19(event: NewMessage.Event) -> None:
    """
    Get the current COVID-19 stats for a specific country or overall.


    `{prefix}covid` or `{prefix}covid USA India` or `{prefix}covid countries`
    """
    covid = Covid(source="worldometers")
    match = event.matches[0].group(1)
    if match:
        strings = []
        failed = []
        args, _ = await client.parse_arguments(match)
        if match.lower() == "countries":
            strings = sorted(covid.list_countries())
        else:
            for c in args:
                try:
                    country = covid.get_status_by_country_name(c)
                    string = f"**COVID-19** __({country['country']})__\n"
                    string += covid_str % country
                    if country['critical']:
                        string += critical_str % country
                    strings.append(string)

covid

Python package to get information regarding the novel corona virus provided by Johns Hopkins university and worldometers.info

MIT
Latest version published 5 months ago

Package Health Score

65 / 100
Full package analysis

Popular covid functions