Script entry file (execution entry), must be named main
requirements.txt
Python dependency management file
input_schema.json
UI input form configuration file
output_schema.json
Output table structure configuration file
sdk.py
Core SDK functionality
sdk_pb2.py
Enhanced data processing module
sdk_pb2_grpc.py
Network communication module
These three SDK files (sdk.py, sdk_pb2.py, sdk_pb2_grpc.py) are required and must be placed in the root directory of the project. Together they form the script’s toolbox, providing all essential capabilities for Worker execution and interaction with the platform backend.
Use upsert_data to update existing records or insert new ones based on a unique key. This is useful when you need to re-scrape and update previously collected data:
data = {
"id": "test-1",
"title": "Updated Title",
"description": "Updated description",
}
CoreSDK.Result.upsert_data(data, "id")
How it works:
If a record with the same unique key exists, it will be updated
If no matching record is found, a new record will be inserted
The unique key must exist in the data dictionary
Important: The unique key field must also be defined in output_schema.json, or the platform cannot match and update rows correctly
This file lists all third-party Python packages required to run the script. The platform automatically installs all dependencies specified in this file.
Q: Why specify versions?
A: To ensure consistent behavior across development, testing, and production environments.
Q: What if I don’t specify a version?
A: The latest version will be installed, which may cause compatibility issues. For core dependencies, pinning versions is recommended.
Q: How do I add new dependencies?
A: Add a new line to requirements.txt and re-upload the ZIP package. The platform will install them on the next run.
Q: What if installation fails?
A: Check network connectivity or package mirrors. If the issue persists, verify the package name and version.
Q: Can I use both sync and async code in the same Worker?
A: Yes. CoreClaw supports both styles. Choose the one that best fits your use case. Async is recommended when using async libraries like aiohttp or when you need concurrent I/O.
You are visitor 01402775 — GeezerVison does not store the pages you look up. Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.