Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions .github/workflows/test_python_templates.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,12 @@ jobs:
with:
python-version: ${{ matrix.python-version }}

# Used by the uv-based templates (e.g. python-uv). uv installs the Python version
# pinned in the template's .python-version file on its own, so it intentionally
# does not get the matrix Python version passed in.
- name: Setup uv
uses: astral-sh/setup-uv@v8.1.0

- name: Install Chrome and Chromedriver
# Use pnpm dlx instead of npx — npx is the npm CLI and trips
# devEngines.packageManager=pnpm at the repo root.
Expand Down
19 changes: 19 additions & 0 deletions templates/manifest.json
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,25 @@
"showcaseFiles": ["my_actor/main.py", "my_actor/__main__.py"],
"useCases": ["STARTER", "WEB_SCRAPING"]
},
{
"id": "python-uv",
"name": "python-uv",
"label": "One‑Page HTML Scraper with uv",
"category": "python",
"technologies": ["uv", "beautifulsoup", "httpx"],
"description": "Scrape single page with provided URL with HTTPX and extract data from page's HTML with Beautiful Soup. The project and its dependencies are managed by the uv package manager.",
"messages": {
"postCreate": "To install the dependencies, run \"uv sync\" in the Actor directory. It creates a virtual environment in the \".venv\" folder and installs the locked dependencies from \"uv.lock\". To install additional Python packages, use \"uv add <package>\"."
},
"archiveUrl": "https://github.com/apify/actor-templates/blob/master/dist/templates/python-uv.zip?raw=true",
"defaultRunOptions": {
"build": "latest",
"memoryMbytes": 1024,
"timeoutSecs": 3600
},
"showcaseFiles": ["my_actor/main.py", "pyproject.toml", "my_actor/__main__.py"],
"useCases": ["STARTER", "WEB_SCRAPING"]
},
{
"id": "python-beautifulsoup",
"name": "python-beautifulsoup",
Expand Down
19 changes: 19 additions & 0 deletions templates/python-uv/.actor/actor.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
{
"$schema": "https://apify.com/schemas/v1/actor.ide.json",
"actorSpecification": 1,
"name": "python-uv",
"title": "Scrape single page in Python with uv",
"description": "Scrape data from single page with provided URL, with project and dependencies managed by uv.",
"version": "0.0",
"buildTag": "latest",
"meta": {
"templateId": "python-uv",
"generatedBy": "<FILL-IN-MODEL>"
},
"input": "./input_schema.json",
"output": "./output_schema.json",
"storages": {
"dataset": "./dataset_schema.json"
},
"dockerfile": "../Dockerfile"
}
26 changes: 26 additions & 0 deletions templates/python-uv/.actor/dataset_schema.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
{
"$schema": "https://apify.com/schemas/v1/dataset.ide.json",
"actorSpecification": 1,
"fields": {},
"views": {
"overview": {
"title": "Overview",
"transformation": {
"fields": ["level", "text"]
},
"display": {
"component": "table",
"properties": {
"level": {
"label": "Level",
"format": "text"
},
"text": {
"label": "Text",
"format": "text"
}
}
}
}
}
}
16 changes: 16 additions & 0 deletions templates/python-uv/.actor/input_schema.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
{
"$schema": "https://apify.com/schemas/v1/input.ide.json",
"title": "Scrape data from a web page",
"type": "object",
"schemaVersion": 1,
"properties": {
"url": {
"title": "URL of the page",
"type": "string",
"description": "The URL of website you want to get the data from.",
"editor": "textfield",
"prefill": "https://www.apify.com/"
}
},
"required": ["url"]
}
12 changes: 12 additions & 0 deletions templates/python-uv/.actor/output_schema.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
{
"$schema": "https://apify.com/schemas/v1/output.ide.json",
"actorOutputSchemaVersion": 1,
"title": "Output schema",
"properties": {
"results": {
"type": "string",
"title": "Results",
"template": "{{links.apiDefaultDatasetUrl}}/items"
}
}
}
39 changes: 39 additions & 0 deletions templates/python-uv/.dockerignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
# Git metadata - not needed inside the image
.git

# Apify storage folder
storage/

# Python virtual environment - recreated by `uv sync` during the Docker build
.venv/
.env/

# Python (and Python tools) cache files
__pycache__/
*.py[cod]
*$py.class
.mypy_cache/
.pytest_cache/
.ruff_cache/
.ty_cache/

# Python build files
__pypackages__/
build/
dist/
*.egg-info/
*.egg

# Environment variables
.env

# Log files
*.log

# Editor / OS noise
.idea/
.vscode
.zed
.DS_Store
.mise.toml
.nvim.lua
39 changes: 39 additions & 0 deletions templates/python-uv/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
# Apify storage folder
storage/

# Python virtual environment - recreated by `uv sync`
.venv/
.env/

# Python (and Python tools) cache files
__pycache__/
*.py[cod]
*$py.class
.mypy_cache/
.pytest_cache/
.ruff_cache/
.ty_cache/

# Python build files
__pypackages__/
build/
dist/
*.egg-info/
*.egg

# Environment variables
.env

# Log files
*.log

# Editor / OS noise
.idea/
.vscode
.zed
.DS_Store
.mise.toml
.nvim.lua

# Note: .python-version and uv.lock are intentionally committed - uv uses them
# to provide the same Python version and dependencies on every machine.
1 change: 1 addition & 0 deletions templates/python-uv/.python-version
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
3.14
Loading
Loading