From c4e1a4140ad5a21c3e137246341910d3cc243710 Mon Sep 17 00:00:00 2001 From: Marc Abramowitz Date: Fri, 15 Mar 2019 01:11:39 -0700 Subject: [PATCH] Add beautifulsoup4 (w/ soupsieve) Example: If you do: ```js languagePluginLoader.then(() => { // pyodide is now ready to use... pyodide.loadPackage('beautifulsoup4').then(() => { pyodide.runPython(` text = """

Cat

Dog

Mouse

""" from bs4 import BeautifulSoup import soupsieve soup = BeautifulSoup(text, 'html.parser') print(soup.select('p:is(.a, .c)')) `); }); }); ``` then the output is: ``` [

Cat

,

Mouse

] ``` --- packages/beautifulsoup4/meta.yaml | 12 ++++++++++++ packages/soupsieve/meta.yaml | 9 +++++++++ 2 files changed, 21 insertions(+) create mode 100644 packages/beautifulsoup4/meta.yaml create mode 100644 packages/soupsieve/meta.yaml diff --git a/packages/beautifulsoup4/meta.yaml b/packages/beautifulsoup4/meta.yaml new file mode 100644 index 000000000..d007eca5b --- /dev/null +++ b/packages/beautifulsoup4/meta.yaml @@ -0,0 +1,12 @@ +package: + name: beautifulsoup4 + version: 4.7.1 +source: + sha256: 945065979fb8529dd2f37dbb58f00b661bdbcbebf954f93b32fdf5263ef35348 + url: https://files.pythonhosted.org/packages/80/f2/f6aca7f1b209bb9a7ef069d68813b091c8c3620642b568dac4eb0e507748/beautifulsoup4-4.7.1.tar.gz +requirements: + run: + - soupsieve +test: + imports: + - bs4 diff --git a/packages/soupsieve/meta.yaml b/packages/soupsieve/meta.yaml new file mode 100644 index 000000000..7060032d8 --- /dev/null +++ b/packages/soupsieve/meta.yaml @@ -0,0 +1,9 @@ +package: + name: soupsieve + version: '1.8' +source: + sha256: eaed742b48b1f3e2d45ba6f79401b2ed5dc33b2123dfe216adb90d4bfa0ade26 + url: https://files.pythonhosted.org/packages/0c/52/e9088bb9b96e2d39fc3b33fcda5b4fde9d71473536ac660a1ca9a0958a2f/soupsieve-1.8.tar.gz +test: + imports: + - soupsieve