This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<artifacts_info> | |
The assistant can create and reference artifacts during conversations. Artifacts are for substantial, self-contained content that users might modify or reuse, displayed in a separate UI window for clarity. | |
# Good artifacts are... | |
- Substantial content (>15 lines) | |
- Content that the user is likely to modify, iterate on, or take ownership of | |
- Self-contained, complex content that can be understood on its own, without context from the conversation | |
- Content intended for eventual use outside the conversation (e.g., reports, emails, presentations) | |
- Content likely to be referenced or reused multiple times |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
requirements: | |
host: | |
- pip | |
- python >=3.6 | |
run: | |
- python >=3.6 | |
- requests >=2.20.0 | |
- six >=1.10.0 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{% set name = "spotipy" %} | |
{% set version = "2.16.1" %} | |
package: | |
name: {{ name|lower }} | |
version: {{ version }} | |
source: | |
url: https://pypi.io/packages/source/{{ name[0] }}/{{ name }}/spotipy-{{ version }}.tar.gz | |
sha256: 4564a6b05959deb82acc96a3fe6883db1ad9f8c73b7ff3b9f1f44db43feba0b8 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{% set name = "spotipy" %} | |
{% set version = "2.16.1" %} | |
package: | |
name: {{ name|lower }} | |
version: {{ version }} | |
source: | |
url: https://pypi.io/packages/source/{{ name[0] }}/{{ name }}/spotipy-{{ version }}.tar.gz |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Note: there are many handy hints in comments in this example -- remove them when you've finalized your recipe | |
# Jinja variables help maintain the recipe as you'll update the version only here. | |
# Using the name variable with the URL in line 14 is convenient | |
# when copying and pasting from another recipe, but not really needed. | |
{% set name = "simplejson" %} | |
{% set version = "3.8.2" %} | |
package: | |
name: {{ name|lower }} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import requests | |
from bs4 import BeautifulSoup | |
# open Audible Matchmaker page locally | |
# (see accompanying Jupyter notebook for details) | |
infile = open(file='audible_matchmaker.html', mode='r') | |
# parse the page with BeautifulSoup | |
soup = BeautifulSoup(markup=infile, features='html.parser') |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# find all of the spans containing the audiobook price | |
# (see accompanying Jupyter notebook for details) | |
upgrade_prices = soup.findAll(name='span', attrs={'class' : 'a-size-base a-color-price a-text-bold'}) | |
# iterate over each of the book prices | |
for book in upgrade_prices: | |
# convert the span price data to a string | |
price_string = book.string | |
# remove the dollar sign from the price string | |
price_string = price_string.replace('$', '') |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import requests | |
from bs4 import BeautifulSoup | |
# open Audible Matchmaker page locally | |
# (see accompanying Jupyter notebook for details) | |
infile = open(file='audible_matchmaker.html', mode='r') | |
# parse the page with BeautifulSoup | |
soup = BeautifulSoup(markup=infile, features='html.parser') |