Package: brython-brip
brip - The Brython Package Installerbripstands forBrython's pip.
It brings the Python packages ecosystem and the pip-like workflow to Brython-powered projects.You can usebripto install packages from thePyPIand other indexes, into your different Brython project.Installationbripcan be installed bypipwith the namebrython-brip.It is recommended that you installbripinto one central virtual environment,rather thaninstallingbripinside each of your brython project's environment.
(In fact, your Brython project technically does not need its own virtual environment.)Installation on Linux and macOS:python3 -m venv ~/venv_central
source ~/venv_central/bin/activate
pip install brython-bripInstallation on Windows:py -m venv $HOME\venv_central
$HOME\venv_central\Scripts\activate
pip install brython-bripQuickstartThis quickstart assumes you use Linux or macOS.
Windows users please adjust the path separator in each sample.Install a package fromPyPIinto your Brython project's web root directory:cd my_brython_project_one/website
brip install SomePackageNow a newsite-packages.brython.jsis generated in current directory,
containing SomePackageand its dependencies.
Your Brython project'sindex.htmlwould just need to add a line<script src="site-packages.brython.js"></script>,
from now on you can useimport some_packageinside your Brython project!Package installed bybripis obtained directly from PyPI.
You doNOTneed to install the package bypipfirst.List what packages are installed for current Brython project
(or more precisely speaking, list packages contained insite-packages.brython.js):cd my_brython_project_one/website
brip listNote:
Packages installed bybripare not visible topip list, and vice versa.
Because their installation target are completely different.Install several packages fromPyPIinto your Brython project's web root directory:cd my_brython_project_two/website
brip install -r brequirements.txtThe file "brequirements.txt" hasa format identical topip's "requirements.txt",
and it can be named whatever name you want.
We recommend using a namedifferent thanpip's conventional "requirements.txt",
though, such as "brequirements.txt",
to remind you that its content are meant to be installed bybrip, not bypip.Uninstalling a package ... is not directly supported, but can be achieved by
organizing your full dependency list in a "brequirements.txt" file,
and then use this pattern:cd my_brython_project_two/website

# Use your editor to remove one package name
edit brequirements.txt

# Each install will OVERWRITE existing site-packages.brython.js
brip install -r brequirements.txtDifferences topipInpipyou can do incremental installation.
If you runpip install fooand thenpip install bar,
you would end up with bothfooandbarinstalled.But, due to some technical reason,bripalways do overwrite installation.
If you runbrip install fooand thenbrip install bar,
you would end up with onlybaravailable in your Brython project.Therefore, we recommend you always use a "brequirements.txt"
to organize your project's full dependency.
That way, any adjustment to such a file would be flushed to your Brython project
by nextbrip install -r brequirements.txt.bripalso only implements a small subset ofpip.
Please refer to the command-line helpbrip -horbrip install -hetc..Packages compatibilitiesAlthoughbriptheoretically gives you access to all packages on PyPI,
Brython will only accept those packages not only themselves implemented in pure Python,
but also their entire dependencies must be implemented in pure Python.Even so, some packages still won't work.
Feel free to report those packages intobrip's issue list.bripmight not be in position to solve it directly,
but the community might be able to help.