← quik.run
NP@naman-parashar-s-team / pkg testPublic

pkg test

A PY snippet on QuikRun, callable at quik.run/r/pkg-test.

PY· python:3.11· 17 runs· 0 forks· updated 8h ago
Endpointquik.run/r/pkg-testRunFork
pkg test.js
# /// script
# dependencies = ["arrow","faker","cowsay","emoji","humanize","tabulate","python-slugify","shortuuid","pyfiglet","validators","phonenumbers","names","markdown","pyyaml","toml","inflection","unidecode","colorama","termcolor","wonderwords","rich","click","jinja2","pytz","six","attrs","wrapt","packaging","more-itertools","sortedcontainers","cachetools","tenacity","backoff","furl","parse","python-dotenv","pyparsing","tqdm","loguru","xmltodict","jmespath","pydash","boltons","funcy","toolz"]
# ///
_IMPORTS = ["arrow","faker","cowsay","emoji","humanize","tabulate","slugify","shortuuid","pyfiglet","validators","phonenumbers","names","markdown","yaml","toml","inflection","unidecode","colorama","termcolor","wonderwords","rich","click","jinja2","pytz","six","attr","wrapt","packaging","more_itertools","sortedcontainers","cachetools","tenacity","backoff","furl","parse","dotenv","pyparsing","tqdm","loguru","xmltodict","jmespath","pydash","boltons","funcy","toolz"]
_ok, _fail = [], []
for _n in _IMPORTS:
try:
__import__(_n)
_ok.append(_n)
except Exception as _e:
_fail.append(_n + ": " + type(_e).__name__)
 
 
def handler(req, env):
import arrow, humanize, emoji, shortuuid
return {
"declared_packages": len(_IMPORTS),
"imported_ok": len(_ok),
"failed": _fail,
"sample": {
"arrow": arrow.now().format("YYYY-MM-DD HH:mm"),
"humanize": humanize.intword(9999999),
"emoji": emoji.emojize("many packages :fire:"),
"id": shortuuid.uuid(),
},
}
 
Fork this and make it yours

Describe a change in plain English and QuikRun deploys it to your own URL.

Fork snippet

Built on QuikRun by @naman-parashar-s-team · plain English in, live URL out