Giter Club home page Giter Club logo

picomamba's Introduction

Picomamba

Mamba in the browser can be used in conjunction with python compiled to wasm from emscripten-forge The usage looks like:

import picomamba

def callback(name, done, total):
    percent = 100.0 * done / total
    print(f"{name} {percent:.2f}% ({done}/{total})")

pm = picomamba.PicoMamba(
    env_prefix=env_prefix,           # the name of the env
    arch_root_url=arch_url,          # root url for arch pkgs
    noarch_template=noarch_template, # templated url for norach pkgs
    progress_callback=callback,      # report download progress 
)
await pm.fetch_repodata(
    arch_url=arch_url,       # url for arch repodata tar.bz2 file
    noarch_url=noarch_url    # url for noarch repodata tar.bz2 file
)
transaction = pm.solve(
    ["regex", "imageio", "numpy", "networkx"]
)
await pm.install_transaction(transaction)


import numpy
import regex
import networkx

the output would be

2022-09-15 11:08:11,235 INFO -- download_repodata
repodata 0.00% (0/13688)
repodata 0.00% (0/3511132)
repodata 0.39% (13688/3511132)
repodata 0.39% (13688/3511132)
repodata 30.25% (1062264/3511132)
repodata 60.12% (2110840/3511132)
repodata 100.00% (3511132/3511132)
repodata 100.00% (3511132/3511132)
2022-09-15 11:08:12,095 INFO -- download_repodata DONE! took 0.86s
2022-09-15 11:08:12,096 INFO -- untar repodata
2022-09-15 11:08:13,648 INFO -- untar repodata DONE! took 1.55s
2022-09-15 11:08:13,649 INFO -- load installed packages
2022-09-15 11:08:13,654 INFO -- load installed packages DONE! took 0.01s
2022-09-15 11:08:13,655 INFO -- solve
2022-09-15 11:08:13,665 INFO -- solve DONE! took 0.01s
2022-09-15 11:08:13,667 INFO -- install transaction
2022-09-15 11:08:13,668 INFO -- install-noarch [networkx=2.8.6=pyhd8ed1ab_0, imageio=2.21.2=pyhfa7a67d_0]
packages 0.00% (0/1629208)
packages 0.00% (0/4973031)
packages 32.76% (1629208/4973031)
packages 32.76% (1629208/4973031)
packages 74.93% (3726360/4973031)
packages 84.16% (4185112/4973031)
packages 100.00% (4973031/4973031)
packages 100.00% (4973031/4973031)
2022-09-15 11:08:13,799 INFO -- install noarch networkx=2.8.6=pyhd8ed1ab_0
2022-09-15 11:08:16,246 INFO -- install noarch networkx=2.8.6=pyhd8ed1ab_0 DONE! took 2.45s
2022-09-15 11:08:16,247 INFO -- install noarch imageio=2.21.2=pyhfa7a67d_0
2022-09-15 11:08:16,854 INFO -- install noarch imageio=2.21.2=pyhfa7a67d_0 DONE! took 0.61s
2022-09-15 11:08:16,855 INFO -- wait for deps
2022-09-15 11:08:16,857 INFO -- install-arch [regex=2022.1.18=py310h672cd09_0, pillow=9.1.0=h8b4d581_0, clapack=3.2.1=h1a65802_0, scipy=1.8.1=py310h7c23efa_0]

Warnings

This is all very experimental and far from usable!!!

picomamba's People

Contributors

derthorsten avatar wolfv avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.