Skip to content

Commit 506b770

Browse files
committed
Merge remote-tracking branch 'origin/master' into no-locking-queue
2 parents d29a534 + 5489a1f commit 506b770

File tree

2 files changed

+67
-7
lines changed

2 files changed

+67
-7
lines changed

docs/02_concepts/12_pay_per_event.mdx

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,12 @@ Apify provides several [pricing models](https://docs.apify.com/platform/actors/p
1313

1414
To use the pay-per-event pricing model, you first need to [set it up](https://docs.apify.com/platform/actors/running/actors-in-store#pay-per-event) for your Actor in the Apify console. After that, you're free to start charging for events.
1515

16+
:::info How pay-per-event pricing works
17+
18+
If you want more details about PPE pricing, please refer to our [PPE documentation](https://docs.apify.com/platform/actors/publishing/monetize/pay-per-event).
19+
20+
:::
21+
1622
## Charging for events
1723

1824
After monetization is set in the Apify console, you can add <ApiLink to="class/Actor#charge">`Actor.charge`</ApiLink> calls to your code and start monetizing!

docs/04_upgrading/upgrading_to_v3.md

Lines changed: 61 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,66 @@ This page summarizes the breaking changes between Apify Python SDK v2.x and v3.0
99

1010
Support for Python 3.9 has been dropped. The Apify Python SDK v3.x now requires Python 3.10 or later. Make sure your environment is running a compatible version before upgrading.
1111

12+
## Changes in storages
13+
14+
Apify Python SDK v3.0 includes Crawlee v1.0, which brings significant changes to the storage APIs. In Crawlee v1.0, the `Dataset`, `KeyValueStore`, and `RequestQueue` storage APIs have been updated for consistency and simplicity. Below is a detailed overview of what's new, what's changed, and what's been removed.
15+
16+
See the Crawlee's [Storages guide](https://crawlee.dev/python/docs/guides/storages) for more details.
17+
18+
### Dataset
19+
20+
The `Dataset` API now includes several new methods, such as:
21+
22+
- `get_metadata` - retrieves metadata information for the dataset.
23+
- `purge` - completely clears the dataset, including all items (keeps the metadata only).
24+
- `list_items` - returns the dataset's items in a list format.
25+
26+
Some older methods have been removed or replaced:
27+
28+
- `from_storage_object` constructor has been removed. You should now use the `open` method with either a `name` or `id` parameter.
29+
- `get_info` method and the `storage_object` property have been replaced by the new `get_metadata` method.
30+
- `set_metadata` method has been removed.
31+
- `write_to_json` and `write_to_csv` methods have been removed; instead, use the `export_to` method for exporting data in different formats.
32+
33+
### Key-value store
34+
35+
The `KeyValueStore` API now includes several new methods, such as:
36+
37+
- `get_metadata` - retrieves metadata information for the key-value store.
38+
- `purge` - completely clears the key-value store, removing all keys and values (keeps the metadata only).
39+
- `delete_value` - deletes a specific key and its associated value.
40+
- `list_keys` - lists all keys in the key-value store.
41+
42+
Some older methods have been removed or replaced:
43+
44+
- `from_storage_object` - removed; use the `open` method with either a `name` or `id` instead.
45+
- `get_info` and `storage_object` - replaced by the new `get_metadata` method.
46+
- `set_metadata` method has been removed.
47+
48+
### Request queue
49+
50+
The `RequestQueue` API now includes several new methods, such as:
51+
52+
- `get_metadata` - retrieves metadata information for the request queue.
53+
- `purge` - completely clears the request queue, including all pending and processed requests (keeps the metadata only).
54+
- `add_requests` - replaces the previous `add_requests_batched` method, offering the same functionality under a simpler name.
55+
56+
Some older methods have been removed or replaced:
57+
58+
- `from_storage_object` - removed; use the `open` method with either a `name` or `id` instead.
59+
- `get_info` and `storage_object` - replaced by the new `get_metadata` method.
60+
- `get_request` has argument `unique_key` instead of `request_id` as the `id` field was removed from the `Request`.
61+
- `set_metadata` method has been removed.
62+
63+
Some changes in the related model classes:
64+
65+
- `resource_directory` in `RequestQueueMetadata` - removed; use the corresponding `path_to_*` property instead.
66+
- `stats` field in `RequestQueueMetadata` - removed as it was unused.
67+
- `RequestQueueHead` - replaced by `RequestQueueHeadWithLocks`.
68+
69+
## Removed Actor.config property
70+
- `Actor.config` property has been removed. Use `Actor.configuration` instead.
71+
1272
## Actor initialization and ServiceLocator changes
1373

1474
`Actor` initialization and global `service_locator` services setup is more strict and predictable.
@@ -45,13 +105,7 @@ async def main():
45105
## Removed Actor.config property
46106
- `Actor.config` property has been removed. Use `Actor.configuration` instead.
47107

48-
## Storages
49-
50-
<!-- TODO -->
51-
52-
## Storage clients
53-
54-
<!-- TODO -->
108+
### Changes in storage clients
55109

56110
## Explicit control over storage clients used in Actor
57111
- It is now possible to have full control over which storage clients are used by the `Actor`. To make development of Actors convenient, the `Actor` has two storage clients. One that is used when running on Apify platform or when opening storages with `force_cloud=True` and the other client that is used when running outside the Apify platform. The `Actor` has reasonable defaults and for the majority of use-cases there is no need to change it. However, if you need to use a different storage client, you can set it up before entering `Actor` context through `service_locator`.

0 commit comments

Comments
 (0)