apify / apify-sdk-python

The Apify SDK for Python is the official library for creating Apify Actors in Python. It provides useful features like actor lifecycle management, local storage emulation, and actor event handling.
https://docs.apify.com/sdk/python
Apache License 2.0
117 stars 11 forks source link

Reconsider `Actor.main` for v2 #237

Closed janbuchar closed 1 month ago

janbuchar commented 2 months ago

It could take care of asyncio.run for example, or it could be a decorator. There isn't much value in it now, compared to async with Actor.

A few mockups:

from apify import Actor

@Actor.main
async def main():
  Actor.push_data({})
from apify import Actor

async def main():
  Actor.push_data({})

Actor.run(main())
janbuchar commented 1 month ago

Let's just remove it