Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit c14bf6f

Browse filesBrowse files
committed
Improve readme, add contribution guide
1 parent d22e3b9 commit c14bf6f
Copy full SHA for c14bf6f

File tree

Expand file treeCollapse file tree

2 files changed

+38
-57
lines changed
Filter options
Expand file treeCollapse file tree

2 files changed

+38
-57
lines changed

‎CONTRIBUTING.md

Copy file name to clipboardExpand all lines: CONTRIBUTING.md
Whitespace-only changes.

‎README.md

Copy file name to clipboardExpand all lines: README.md
+38-57Lines changed: 38 additions & 57 deletions
Original file line numberDiff line numberDiff line change
@@ -6,76 +6,57 @@ It provides useful features like actor lifecycle management, local storage emula
66
If you just need to access the [Apify API](https://docs.apify.com/api/v2) from your Python applications,
77
check out the [Apify Client for Python](https://docs.apify.com/api/client/python) instead.
88

9-
## Installation
9+
## Documentation
1010

11-
Requires Python 3.8+
11+
For usage instructions, check the documentation on [Apify Docs](https://docs.apify.com/sdk/python/).
1212

13-
You can install the package from its [PyPI listing](https://pypi.org/project/apify).
14-
To do that, simply run `pip install apify` in your terminal.
13+
## Example
1514

16-
## Usage
15+
```python
16+
from apify import Actor
17+
from bs4 import BeautifulSoup
18+
import requests
1719

18-
For usage instructions, check the documentation on [Apify Docs](https://docs.apify.com/sdk/python/) or in [`docs/docs.md`](docs/docs.md).
19-
20-
## Development
21-
22-
### Environment
23-
24-
For local development, it is required to have Python 3.8 installed.
25-
26-
It is recommended to set up a virtual environment while developing this package to isolate your development environment,
27-
however, due to the many varied ways Python can be installed and virtual environments can be set up,
28-
this is left up to the developers to do themselves.
29-
30-
One recommended way is with the built-in `venv` module:
31-
32-
```bash
33-
python3 -m venv .venv
34-
source .venv/bin/activate
20+
async def main():
21+
async with Actor:
22+
response = requests.get('https://apify.com')
23+
soup = BeautifulSoup(response.content, 'html.parser')
24+
await Actor.push_data({ 'url': url, 'title': soup.title.string })
3525
```
3626

37-
To improve on the experience, you can use [pyenv](https://github.com/pyenv/pyenv) to have an environment with a pinned Python version,
38-
and [direnv](https://github.com/direnv/direnv) to automatically activate/deactivate the environment when you enter/exit the project folder.
39-
40-
### Dependencies
41-
42-
To install this package and its development dependencies, run `make install-dev`
43-
44-
### Formatting
45-
46-
We use `autopep8` and `isort` to automatically format the code to a common format. To run the formatting, just run `make format`.
47-
48-
### Linting, type-checking and unit testing
49-
50-
We use `flake8` for linting, `mypy` for type checking and `pytest` for unit testing. To run these tools, just run `make check-code`.
51-
52-
### Integration tests
27+
## What are Actors?
5328

54-
We have integration tests which build and run actors using the Python SDK on the Apify Platform.
55-
To run these tests, you need to set the `APIFY_TEST_USER_API_TOKEN` environment variable to the API token of the Apify user you want to use for the tests,
56-
and then start them with `make integration-tests`.
29+
Actors are serverless cloud programs that can do almost anything a human can do in a web browser.
30+
They can do anything from small tasks such as filling in forms or unsubscribing from online services,
31+
all the way up to scraping and processing vast numbers of web pages.
5732

58-
If you want to run the integration tests on a different environment than the main Apify Platform,
59-
you need to set the `APIFY_INTEGRATION_TESTS_API_URL` environment variable to the right URL to the Apify API you want to use.
33+
They can be run either locally, or on the [Apify platform](https://docs.apify.com/platform/),
34+
where you can run them at scale, monitor them, schedule them, or publish and monetize them.
6035

61-
### Documentation
36+
If you're new to Apify, learn [what is Apify](https://docs.apify.com/platform/about) in the Apify platform documentation.
6237

63-
We use the [Google docstring format](https://sphinxcontrib-napoleon.readthedocs.io/en/latest/example_google.html) for documenting the code.
64-
We document every user-facing class or method, and enforce that using the flake8-docstrings library.
38+
## Creating Actors
6539

66-
The documentation is then rendered from the docstrings in the code using Sphinx and some heavy post-processing and saved as `docs/docs.md`.
67-
To generate the documentation, just run `make docs`.
40+
To create and run Actors through Apify Console,
41+
see the [Console documentation](https://docs.apify.com/academy/getting-started/creating-actors#choose-your-template).
6842

69-
### Release process
43+
To create and run Python Actors locally, check the documentation for [how to create and run Python Actors locally](https://docs.apify.com/sdk/python/docs/overview/running-locally).
7044

71-
Publishing new versions to [PyPI](https://pypi.org/project/apify) happens automatically through GitHub Actions.
45+
## Guides
7246

73-
On each commit to the `master` branch, a new beta release is published, taking the version number from `src/apify/_version.py`
74-
and automatically incrementing the beta version suffix by 1 from the last beta release published to PyPI.
47+
To see how you can use the Apify SDK with other popular libraries used for web scraping,
48+
check out our guides for using
49+
[Requests and HTTPX](https://docs.apify.com/sdk/python/docs/guides/requests-and-httpx),
50+
[Beautiful Soup](https://docs.apify.com/sdk/python/docs/guides/beautiful-soup),
51+
[Playwright](https://docs.apify.com/sdk/python/docs/guides/playwright),
52+
[Selenium](https://docs.apify.com/sdk/python/docs/guides/selenium),
53+
or [Scrapy](https://docs.apify.com/sdk/python/docs/guides/scrapy).
7554

76-
A stable version is published when a new release is created using GitHub Releases, again taking the version number from `src/apify/_version.py`. The built package assets are automatically uploaded to the GitHub release.
55+
## Usage concepts
7756

78-
If there is already a stable version with the same version number as in `src/apify/_version.py` published to PyPI, the publish process fails,
79-
so don't forget to update the version number before releasing a new version.
80-
The release process also fails when the released version is not described in `CHANGELOG.md`,
81-
so don't forget to describe the changes in the new version there.
57+
To learn more about the features of the Apify SDK and how to use them,
58+
check out the Usage Concepts section in the sidebar,
59+
particularly the guides for the [Actor lifecycle](https://docs.apify.com/sdk/python/docs/concepts/actor-lifecycle),
60+
[working with storages](https://docs.apify.com/sdk/python/docs/concepts/storages),
61+
[handling Actor events](https://docs.apify.com/sdk/python/docs/concepts/actor-events)
62+
or [how to use proxies](https://docs.apify.com/sdk/python/docs/concepts/proxy-management).

0 commit comments

Comments
0 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.