{"id":60,"date":"2025-12-08T00:00:00","date_gmt":"2025-12-08T00:00:00","guid":{"rendered":"https:\/\/wordpress.securinsight.ca\/?p=60"},"modified":"2025-12-08T00:00:00","modified_gmt":"2025-12-08T00:00:00","slug":"workers-easy-python-package-management-with-pywrangler","status":"publish","type":"post","link":"https:\/\/wordpress.securinsight.ca\/index.php\/2025\/12\/08\/workers-easy-python-package-management-with-pywrangler\/","title":{"rendered":"Workers &#8211; Easy Python package management with Pywrangler"},"content":{"rendered":"<p>We are introducing a brand new tool called Pywrangler, which simplifies package management in Python Workers by<br \/>\nautomatically installing Workers-compatible Python packages into your project.<\/p>\n<p>With Pywrangler, you specify your Worker&#8217;s Python dependencies in your <code>pyproject.toml<\/code> file:<\/p>\n<div>\n<figure>\n<pre data-language=\"toml\"><code class=\"language-toml\"><div><div><span>[<\/span><span>project<\/span><span>]<\/span><\/div><\/div><div><div><span>name<\/span><span> <\/span><span>=<\/span><span> <\/span><span>\"python-beautifulsoup-worker\"<\/span><\/div><\/div><div><div><span>version<\/span><span> <\/span><span>=<\/span><span> <\/span><span>\"0.1.0\"<\/span><\/div><\/div><div><div><span>description<\/span><span> <\/span><span>=<\/span><span> <\/span><span>\"A simple Worker using beautifulsoup4\"<\/span><\/div><\/div><div><div><span>requires-python<\/span><span> <\/span><span>=<\/span><span> <\/span><span>\"&gt;=3.12\"<\/span><\/div><\/div><div><div><span>dependencies<\/span><span> <\/span><span>=<\/span><span> <\/span><span>[<\/span><\/div><\/div><div><div><span>    <\/span><span>\"beautifulsoup4\"<\/span><\/div><\/div><div><div><span>]<\/span><\/div><\/div><div><div>\n<\/div><\/div><div><div><span>[<\/span><span>dependency-groups<\/span><span>]<\/span><\/div><\/div><div><div><span>dev<\/span><span> <\/span><span>=<\/span><span> <\/span><span>[<\/span><\/div><\/div><div><div><span>  <\/span><span>\"workers-py\"<\/span><span>,<\/span><\/div><\/div><div><div><span>  <\/span><span>\"workers-runtime-sdk\"<\/span><\/div><\/div><div><div><span>]<\/span><\/div><\/div><\/code><\/pre>\n<div><\/div>\n<\/figure>\n<\/div>\n<p>You can then develop and deploy your Worker using the following commands:<\/p>\n<div>\n<figure>\n<pre data-language=\"bash\"><code class=\"language-bash\"><div><div><span>uv<\/span><span> <\/span><span>run<\/span><span> <\/span><span>pywrangler<\/span><span> <\/span><span>dev<\/span><\/div><\/div><div><div><span>uv<\/span><span> <\/span><span>run<\/span><span> <\/span><span>pywrangler<\/span><span> <\/span><span>deploy<\/span><\/div><\/div><\/code><\/pre>\n<div><\/div>\n<\/figure>\n<\/div>\n<p>Pywrangler automatically downloads and vendors the necessary packages for your Worker, and these packages are bundled with the Worker when you deploy.<\/p>\n<p>Consult the <a href=\"https:\/\/developers.cloudflare.com\/workers\/languages\/python\/packages\/\">Python packages documentation<\/a> for full details on Pywrangler and Python package management in Workers.<\/p>","protected":false},"excerpt":{"rendered":"<p>We are introducing a brand new tool called Pywrangler, which simplifies package management in Python Workers by automatically installing Workers-compatible Python packages into your project. With Pywrangler, you specify your Worker&#8217;s Python dependencies in your pyproject.toml file: [project]name = &#8220;python-beautifulsoup-worker&#8221;version = &#8220;0.1.0&#8221;description = &#8220;A simple Worker using beautifulsoup4&#8243;requires-python = &#8220;&gt;=3.12&#8243;dependencies = [ &#8220;beautifulsoup4&#8221;] [dependency-groups]dev = [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1],"tags":[],"class_list":["post-60","post","type-post","status-publish","format-standard","hentry","category-uncategorized"],"_links":{"self":[{"href":"https:\/\/wordpress.securinsight.ca\/index.php\/wp-json\/wp\/v2\/posts\/60","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/wordpress.securinsight.ca\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/wordpress.securinsight.ca\/index.php\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/wordpress.securinsight.ca\/index.php\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/wordpress.securinsight.ca\/index.php\/wp-json\/wp\/v2\/comments?post=60"}],"version-history":[{"count":1,"href":"https:\/\/wordpress.securinsight.ca\/index.php\/wp-json\/wp\/v2\/posts\/60\/revisions"}],"predecessor-version":[{"id":63,"href":"https:\/\/wordpress.securinsight.ca\/index.php\/wp-json\/wp\/v2\/posts\/60\/revisions\/63"}],"wp:attachment":[{"href":"https:\/\/wordpress.securinsight.ca\/index.php\/wp-json\/wp\/v2\/media?parent=60"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/wordpress.securinsight.ca\/index.php\/wp-json\/wp\/v2\/categories?post=60"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/wordpress.securinsight.ca\/index.php\/wp-json\/wp\/v2\/tags?post=60"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}