Add pyodide packages

This commit is contained in:
Phil Szalay 2025-03-14 10:53:42 +01:00
parent dabccd4cec
commit 7841f28f82

View File

@ -121,241 +121,255 @@
executing = true;
let packages = [
code.includes('requests') ? 'requests' : null,
code.includes('bs4') ? 'beautifulsoup4' : null,
code.includes('numpy') ? 'numpy' : null,
code.includes('pandas') ? 'pandas' : null,
code.includes('scipy') ? 'scipy' : null,
code.includes('seaborn') ? 'seaborn' : null,
code.includes('sympy') ? 'sympy' : null,
code.includes('tiktoken') ? 'tiktoken' : null,
code.includes('matplotlib') ? 'matplotlib' : null,
code.includes('pytz') ? 'pytz' : null,
code.includes('simplejson') ? 'simplejson' : null,
code.includes('affine') ? 'affine' : null,
code.includes('aiohttp') ? 'aiohttp' : null,
code.includes('aiosignal') ? 'aiosignal' : null,
code.includes('altair') ? 'altair' : null,
code.includes('annotated-types') ? 'annotated-types' : null,
code.includes('apsw') ? 'apsw' : null,
code.includes('argon2-cffi') ? 'argon2-cffi' : null,
code.includes('argon2-cffi-bindings') ? 'argon2-cffi-bindings' : null,
code.includes('arro3-compute') ? 'arro3-compute' : null,
code.includes('arro3-core') ? 'arro3-core' : null,
code.includes('arro3-io') ? 'arro3-io' : null,
code.includes('asciitree') ? 'asciitree' : null,
code.includes('astropy') ? 'astropy' : null,
code.includes('astropy_iers_data') ? 'astropy_iers_data' : null,
code.includes('asttokens') ? 'asttokens' : null,
code.includes('async-timeout') ? 'async-timeout' : null,
code.includes('atomicwrites') ? 'atomicwrites' : null,
code.includes('attrs') ? 'attrs' : null,
code.includes('autograd') ? 'autograd' : null,
code.includes('awkward-cpp') ? 'awkward-cpp' : null,
code.includes('b2d') ? 'b2d' : null,
code.includes('bcrypt') ? 'bcrypt' : null,
code.includes('biopython') ? 'biopython' : null,
code.includes('bitarray') ? 'bitarray' : null,
code.includes('bitstring') ? 'bitstring' : null,
code.includes('bleach') ? 'bleach' : null,
code.includes('bokeh') ? 'bokeh' : null,
code.includes('boost-histogram') ? 'boost-histogram' : null,
code.includes('brotli') ? 'brotli' : null,
code.includes('cachetools') ? 'cachetools' : null,
code.includes('Cartopy') ? 'Cartopy' : null,
code.includes('casadi') ? 'casadi' : null,
code.includes('cbor-diag') ? 'cbor-diag' : null,
code.includes('certifi') ? 'certifi' : null,
code.includes('cffi') ? 'cffi' : null,
code.includes('cffi_example') ? 'cffi_example' : null,
code.includes('cftime') ? 'cftime' : null,
code.includes('charset-normalizer') ? 'charset-normalizer' : null,
code.includes('clarabel') ? 'clarabel' : null,
code.includes('click') ? 'click' : null,
code.includes('cligj') ? 'cligj' : null,
code.includes('clingo') ? 'clingo' : null,
code.includes('cloudpickle') ? 'cloudpickle' : null,
code.includes('cmyt') ? 'cmyt' : null,
code.includes('colorspacious') ? 'colorspacious' : null,
code.includes('contourpy') ? 'contourpy' : null,
code.includes('coolprop') ? 'coolprop' : null,
code.includes('coverage') ? 'coverage' : null,
code.includes('cramjam') ? 'cramjam' : null,
code.includes('crc32c') ? 'crc32c' : null,
code.includes('cryptography') ? 'cryptography' : null,
code.includes('css-inline') ? 'css-inline' : null,
code.includes('cssselect') ? 'cssselect' : null,
code.includes('cvxpy-base') ? 'cvxpy-base' : null,
code.includes('cycler') ? 'cycler' : null,
code.includes('cysignals') ? 'cysignals' : null,
code.includes('cytoolz') ? 'cytoolz' : null,
code.includes('decorator') ? 'decorator' : null,
code.includes('demes') ? 'demes' : null,
code.includes('deprecation') ? 'deprecation' : null,
code.includes('distlib') ? 'distlib' : null,
code.includes('docutils') ? 'docutils' : null,
code.includes('duckdb') ? 'duckdb' : null,
code.includes('ewah_bool_utils') ? 'ewah_bool_utils' : null,
code.includes('exceptiongroup') ? 'exceptiongroup' : null,
code.includes('executing') ? 'executing' : null,
code.includes('fastparquet') ? 'fastparquet' : null,
code.includes('fiona') ? 'fiona' : null,
code.includes('fonttools') ? 'fonttools' : null,
code.includes('freesasa') ? 'freesasa' : null,
code.includes('frozenlist') ? 'frozenlist' : null,
code.includes('fsspec') ? 'fsspec' : null,
code.includes('future') ? 'future' : null,
code.includes('galpy') ? 'galpy' : null,
code.includes('gensim') ? 'gensim' : null,
code.includes('geopandas') ? 'geopandas' : null,
code.includes('gmpy2') ? 'gmpy2' : null,
code.includes('gsw') ? 'gsw' : null,
code.includes('h5py') ? 'h5py' : null,
code.includes('html5lib') ? 'html5lib' : null,
code.includes('httpx') ? 'httpx' : null,
code.includes('idna') ? 'idna' : null,
code.includes('igraph') ? 'igraph' : null,
code.includes('imageio') ? 'imageio' : null,
code.includes('iminuit') ? 'iminuit' : null,
code.includes('iniconfig') ? 'iniconfig' : null,
code.includes('ipython') ? 'ipython' : null,
code.includes('jedi') ? 'jedi' : null,
code.includes('Jinja2') ? 'Jinja2' : null,
code.includes('joblib') ? 'joblib' : null,
code.includes('jsonschema') ? 'jsonschema' : null,
code.includes('jsonschema_specifications') ? 'jsonschema_specifications' : null,
code.includes('kiwisolver') ? 'kiwisolver' : null,
code.includes('lakers-python') ? 'lakers-python' : null,
code.includes('lazy-object-proxy') ? 'lazy-object-proxy' : null,
code.includes('lazy_loader') ? 'lazy_loader' : null,
code.includes('libcst') ? 'libcst' : null,
code.includes('lightgbm') ? 'lightgbm' : null,
code.includes('logbook') ? 'logbook' : null,
code.includes('lxml') ? 'lxml' : null,
code.includes('MarkupSafe') ? 'MarkupSafe' : null,
code.includes('matplotlib-inline') ? 'matplotlib-inline' : null,
code.includes('matplotlib-pyodide') ? 'matplotlib-pyodide' : null,
code.includes('memory-allocator') ? 'memory-allocator' : null,
code.includes('micropip') ? 'micropip' : null,
code.includes('mmh3') ? 'mmh3' : null,
code.includes('mne') ? 'mne' : null,
code.includes('more-itertools') ? 'more-itertools' : null,
code.includes('mpmath') ? 'mpmath' : null,
code.includes('msgpack') ? 'msgpack' : null,
code.includes('msgspec') ? 'msgspec' : null,
code.includes('msprime') ? 'msprime' : null,
code.includes('multidict') ? 'multidict' : null,
code.includes('munch') ? 'munch' : null,
code.includes('mypy') ? 'mypy' : null,
code.includes('mypy_extensions') ? 'mypy_extensions' : null,
code.includes('netCDF4') ? 'netCDF4' : null,
code.includes('networkx') ? 'networkx' : null,
code.includes('newick') ? 'newick' : null,
code.includes('nltk') ? 'nltk' : null,
code.includes('numba') ? 'numba' : null,
code.includes('numcodecs') ? 'numcodecs' : null,
code.includes('numexpr') ? 'numexpr' : null,
code.includes('opencv-python') ? 'opencv-python' : null,
code.includes('openpyxl') ? 'openpyxl' : null,
code.includes('orjson') ? 'orjson' : null,
code.includes('osqp') ? 'osqp' : null,
code.includes('packaging') ? 'packaging' : null,
code.includes('palettable') ? 'palettable' : null,
code.includes('parso') ? 'parso' : null,
code.includes('passlib') ? 'passlib' : null,
code.includes('patsy') ? 'patsy' : null,
code.includes('pexpect') ? 'pexpect' : null,
code.includes('pickleshare') ? 'pickleshare' : null,
code.includes('Pillow') ? 'Pillow' : null,
code.includes('platformdirs') ? 'platformdirs' : null,
code.includes('plotly') ? 'plotly' : null,
code.includes('pluggy') ? 'pluggy' : null,
code.includes('ply') ? 'ply' : null,
code.includes('polars') ? 'polars' : null,
code.includes('pooch') ? 'pooch' : null,
code.includes('prompt-toolkit') ? 'prompt-toolkit' : null,
code.includes('protobuf') ? 'protobuf' : null,
code.includes('psutil') ? 'psutil' : null,
code.includes('ptyprocess') ? 'ptyprocess' : null,
code.includes('pure-eval') ? 'pure-eval' : null,
code.includes('py') ? 'py' : null,
code.includes('pyarrow') ? 'pyarrow' : null,
code.includes('pycparser') ? 'pycparser' : null,
code.includes('pydantic') ? 'pydantic' : null,
code.includes('pydantic_core') ? 'pydantic_core' : null,
code.includes('pydub') ? 'pydub' : null,
code.includes('pyerfa') ? 'pyerfa' : null,
code.includes('Pygments') ? 'Pygments' : null,
code.includes('pyproj') ? 'pyproj' : null,
code.includes('pyrsistent') ? 'pyrsistent' : null,
code.includes('pytest') ? 'pytest' : null,
code.includes('python-dateutil') ? 'python-dateutil' : null,
code.includes('python-lsp-jsonrpc') ? 'python-lsp-jsonrpc' : null,
code.includes('python-lsp-server') ? 'python-lsp-server' : null,
code.includes('python-multipart') ? 'python-multipart' : null,
code.includes('pytz-deprecation-shim') ? 'pytz-deprecation-shim' : null,
code.includes('PyWavelets') ? 'PyWavelets' : null,
code.includes('pyxel') ? 'pyxel' : null,
code.includes('PyYAML') ? 'PyYAML' : null,
code.includes('qrcode') ? 'qrcode' : null,
code.includes('rasterio') ? 'rasterio' : null,
code.includes('rdflib') ? 'rdflib' : null,
code.includes('referencing') ? 'referencing' : null,
code.includes('regex') ? 'regex' : null,
code.includes('reportlab') ? 'reportlab' : null,
code.includes('rpds-py') ? 'rpds-py' : null,
code.includes('ruff') ? 'ruff' : null,
code.includes('scikit-image') ? 'scikit-image' : null,
code.includes('scikit-learn') ? 'scikit-learn' : null,
code.includes('scs') ? 'scs' : null,
code.includes('shapely') ? 'shapely' : null,
code.includes('shellingham') ? 'shellingham' : null,
code.includes('six') ? 'six' : null,
code.includes('skia-python') ? 'skia-python' : null,
code.includes('smart_open') ? 'smart_open' : null,
code.includes('sniffio') ? 'sniffio' : null,
code.includes('snuggs') ? 'snuggs' : null,
code.includes('sortedcontainers') ? 'sortedcontainers' : null,
code.includes('soupsieve') ? 'soupsieve' : null,
code.includes('SPARQLWrapper') ? 'SPARQLWrapper' : null,
code.includes('sqlalchemy') ? 'sqlalchemy' : null,
code.includes('sqlglot') ? 'sqlglot' : null,
code.includes('stack_data') ? 'stack_data' : null,
code.includes('statsmodels') ? 'statsmodels' : null,
code.includes('tabulate') ? 'tabulate' : null,
code.includes('tenacity') ? 'tenacity' : null,
code.includes('threadpoolctl') ? 'threadpoolctl' : null,
code.includes('tifffile') ? 'tifffile' : null,
code.includes('tinycss2') ? 'tinycss2' : null,
code.includes('toml') ? 'toml' : null,
code.includes('tomli') ? 'tomli' : null,
code.includes('toolz') ? 'toolz' : null,
code.includes('tornado') ? 'tornado' : null,
code.includes('tqdm') ? 'tqdm' : null,
code.includes('traitlets') ? 'traitlets' : null,
code.includes('tskit') ? 'tskit' : null,
code.includes('typing_extensions') ? 'typing_extensions' : null,
code.includes('tzdata') ? 'tzdata' : null,
code.includes('tzlocal') ? 'tzlocal' : null,
code.includes('ujson') ? 'ujson' : null,
code.includes('unicodedata2') ? 'unicodedata2' : null,
code.includes('urllib3') ? 'urllib3' : null,
code.includes('virtualenv') ? 'virtualenv' : null,
code.includes('wcwidth') ? 'wcwidth' : null,
code.includes('webencodings') ? 'webencodings' : null,
code.includes('wordcloud') ? 'wordcloud' : null,
code.includes('wrapt') ? 'wrapt' : null,
code.includes('xarray') ? 'xarray' : null,
code.includes('xarray-einstats') ? 'xarray-einstats' : null,
code.includes('xgboost') ? 'xgboost' : null,
code.includes('xlrd') ? 'xlrd' : null,
code.includes('xlsxwriter') ? 'xlsxwriter' : null,
code.includes('xmltodict') ? 'xmltodict' : null,
code.includes('xyzservices') ? 'xyzservices' : null,
code.includes('yarl') ? 'yarl' : null,
code.includes('zarr') ? 'zarr' : null
].filter(Boolean);
// Define the packages array
const availablePackages = [
'affine',
'altair',
'annotated-types',
'apsw',
'argon2-cffi',
'argon2-cffi-bindings',
'arro3-compute',
'arro3-core',
'arro3-io',
'asciitree',
'astropy',
'astropy_iers_data',
'asttokens',
'async-timeout',
'atomicwrites',
'attrs',
'autograd',
'awkward-cpp',
'b2d',
'bcrypt',
'beautifulsoup4',
'biopython',
'bitarray',
'bitstring',
'bleach',
'bokeh',
'boost-histogram',
'brotli',
'cachetools',
'Cartopy',
'casadi',
'cbor-diag',
'cffi',
'cffi_example',
'cftime',
'charset-normalizer',
'clarabel',
'click',
'cligj',
'clingo',
'cloudpickle',
'cmyt',
'colorspacious',
'contourpy',
'coolprop',
'coverage',
'cramjam',
'crc32c',
'cryptography',
'css-inline',
'cssselect',
'cvxpy-base',
'cycler',
'cysignals',
'cytoolz',
'decorator',
'demes',
'deprecation',
'distlib',
'docutils',
'duckdb',
'ewah_bool_utils',
'exceptiongroup',
'executing',
'fastparquet',
'fiona',
'fonttools',
'freesasa',
'frozenlist',
'fsspec',
'future',
'galpy',
'gmpy2',
'gsw',
'h5py',
'html5lib',
'igraph',
'imageio',
'iminuit',
'iniconfig',
'ipython',
'jedi',
'Jinja2',
'joblib',
'jsonschema',
'jsonschema_specifications',
'kiwisolver',
'lakers-python',
'lazy-object-proxy',
'lazy_loader',
'libcst',
'logbook',
'lxml',
'MarkupSafe',
'matplotlib',
'matplotlib-inline',
'matplotlib-pyodide',
'memory-allocator',
'mmh3',
'mne',
'more-itertools',
'mpmath',
'msgpack',
'msgspec',
'msprime',
'multidict',
'munch',
'mypy',
'narwhals',
'netcdf4',
'networkx',
'newick',
'nh3',
'nlopt',
'nltk',
'numcodecs',
'numpy',
'opencv-python',
'optlang',
'orjson',
'packaging',
'pandas',
'parso',
'patsy',
'peewee',
'pi-heif',
'Pillow',
'pillow-heif',
'pkgconfig',
'pluggy',
'polars',
'pplpy',
'primecountpy',
'prompt_toolkit',
'protobuf',
'pure-eval',
'py',
'pyclipper',
'pycparser',
'pycryptodome',
'pydantic',
'pydantic_core',
'pyerfa',
'pygame-ce',
'Pygments',
'pyheif',
'pyiceberg',
'pyinstrument',
'pynacl',
'pyodide-unix-timezones',
'pyparsing',
'pyproj',
'pyrsistent',
'pysam',
'pyshp',
'pytest',
'pytest-asyncio',
'pytest-benchmark',
'python-dateutil',
'python-flint',
'python-magic',
'python-sat',
'python-solvespace',
'pytz',
'pywavelets',
'pyxel',
'pyxirr',
'pyyaml',
'rasterio',
'rateslib',
'rebound',
'reboundx',
'referencing',
'regex',
'retrying',
'rich',
'river',
'rpds-py',
'ruamel.yaml',
'rust-abi-test',
'rust-panic-test',
'scipy',
'screed',
'setuptools',
'shapely',
'simplejson',
'sisl',
'six',
'smart-open',
'sortedcontainers',
'soupsieve',
'sourmash',
'soxr',
'sparseqr',
'sqlalchemy',
'stack-data',
'statsmodels',
'strictyaml',
'svgwrite',
'swiglpk',
'sympy',
'tblib',
'termcolor',
'texttable',
'threadpoolctl',
'tiktoken',
'tomli',
'tomli-w',
'toolz',
'tqdm',
'traitlets',
'traits',
'tree-sitter',
'tree-sitter-go',
'tree-sitter-java',
'tree-sitter-python',
'tskit',
'typing-extensions',
'tzdata',
'uncertainties',
'unyt',
'vega-datasets',
'wcwidth',
'webencodings',
'wordcloud',
'wrapt',
'xarray',
'xlrd',
'xxhash',
'xyzservices',
'yt',
'zarr',
'zengl',
'zfpy',
'zstandard'
];
// Detect packages from the code
let packages = [];
// Then check for direct package names
for (const pkg of availablePackages) {
// Check if the package name appears in the code
if (code.includes(pkg)) {
packages.push(pkg);
}
}
console.log(packages);