You are viewing a plain text version of this content. The canonical link for it is here.
Posted to github@beam.apache.org by "tvalentyn (via GitHub)" <gi...@apache.org> on 2023/01/21 01:08:45 UTC

[GitHub] [beam] tvalentyn commented on a diff in pull request #24804: [WebSite] Add new Python quickstart

tvalentyn commented on code in PR #24804:
URL: https://github.com/apache/beam/pull/24804#discussion_r1074011687


##########
website/www/site/content/en/get-started/quickstart-py.md:
##########
@@ -15,7 +15,7 @@ See the License for the specific language governing permissions and
 limitations under the License.
 -->
 
-# Apache Beam Python SDK Quickstart
+# WordCount quickstart for Python

Review Comment:
   do you plan to delete this file? Otherwise, why do we need both
   
   `quickstart-py.md` and `quickstart/python.md` ?



##########
website/www/site/content/en/get-started/quickstart/python.md:
##########
@@ -0,0 +1,216 @@
+---
+title: "Beam Quickstart for Python"
+aliases:
+  - /get-started/quickstart/
+  - /use/quickstart/
+  - /getting-started/
+---
+<!--
+Licensed under the Apache License, Version 2.0 (the "License");
+you may not use this file except in compliance with the License.
+You may obtain a copy of the License at
+
+http://www.apache.org/licenses/LICENSE-2.0
+
+Unless required by applicable law or agreed to in writing, software
+distributed under the License is distributed on an "AS IS" BASIS,
+WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+See the License for the specific language governing permissions and
+limitations under the License.
+-->
+
+# Apache Beam Python SDK quickstart
+
+This quickstart shows you how to run an
+[example pipeline](https://github.com/apache/beam-starter-python) written with
+the [Apache Beam Python SDK](/documentation/sdks/python), using the
+[Direct Runner](/documentation/runners/direct/). The Direct Runner executes
+pipelines locally on your machine.
+
+If you're interested in contributing to the Apache Beam Python codebase, see the
+[Contribution Guide](/contribute).
+
+On this page:
+
+{{< toc >}}
+
+## Set up your development environment
+
+### Check your Python version
+
+The Beam SDK requires Python users to use Python version 3.6 or higher. Check

Review Comment:
   Apache Beam aims to work on released [Python versions](https://devguide.python.org/versions/) that have not yet reached end of life, but it may take a few releases, until Apache Beam fully supports the most recently released Python minor version.
   
   The minimum required Python version is visible in `Meta` section on https://pypi.org/project/apache-beam/ page in the `Requires:` field. The list of all supported Python version is visible `Classifiers` section at the bottom of the page under `Programming Language` field.
   
   Check your Python version by running  ...
    
   If you don't have a Python interpreter, you can download and install it from the [Python downloads page](https://devguide.python.org/versions/). 
   
   If you need to install a different version of Python in addition to the version that you already have, you can find some recommendations in our [Developer Wiki](https://cwiki.apache.org/confluence/display/BEAM/Python+Tips#PythonTips-InstallingPythoninterpreters).
   



##########
website/www/site/content/en/get-started/quickstart/python.md:
##########
@@ -0,0 +1,216 @@
+---
+title: "Beam Quickstart for Python"
+aliases:
+  - /get-started/quickstart/
+  - /use/quickstart/
+  - /getting-started/
+---
+<!--
+Licensed under the Apache License, Version 2.0 (the "License");
+you may not use this file except in compliance with the License.
+You may obtain a copy of the License at
+
+http://www.apache.org/licenses/LICENSE-2.0
+
+Unless required by applicable law or agreed to in writing, software
+distributed under the License is distributed on an "AS IS" BASIS,
+WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+See the License for the specific language governing permissions and
+limitations under the License.
+-->
+
+# Apache Beam Python SDK quickstart
+
+This quickstart shows you how to run an
+[example pipeline](https://github.com/apache/beam-starter-python) written with
+the [Apache Beam Python SDK](/documentation/sdks/python), using the
+[Direct Runner](/documentation/runners/direct/). The Direct Runner executes
+pipelines locally on your machine.
+
+If you're interested in contributing to the Apache Beam Python codebase, see the
+[Contribution Guide](/contribute).
+
+On this page:
+
+{{< toc >}}
+
+## Set up your development environment
+
+### Check your Python version
+
+The Beam SDK requires Python users to use Python version 3.6 or higher. Check
+your version by running:
+
+{{< highlight >}}
+python3 --version
+{{< /highlight >}}
+
+### Install `virtualenv`
+

Review Comment:
   we can delete the Install virtualenv section entirely.



##########
website/www/site/content/en/get-started/quickstart/python.md:
##########
@@ -0,0 +1,216 @@
+---
+title: "Beam Quickstart for Python"
+aliases:
+  - /get-started/quickstart/
+  - /use/quickstart/
+  - /getting-started/
+---
+<!--
+Licensed under the Apache License, Version 2.0 (the "License");
+you may not use this file except in compliance with the License.
+You may obtain a copy of the License at
+
+http://www.apache.org/licenses/LICENSE-2.0
+
+Unless required by applicable law or agreed to in writing, software
+distributed under the License is distributed on an "AS IS" BASIS,
+WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+See the License for the specific language governing permissions and
+limitations under the License.
+-->
+
+# Apache Beam Python SDK quickstart
+
+This quickstart shows you how to run an
+[example pipeline](https://github.com/apache/beam-starter-python) written with
+the [Apache Beam Python SDK](/documentation/sdks/python), using the
+[Direct Runner](/documentation/runners/direct/). The Direct Runner executes
+pipelines locally on your machine.
+
+If you're interested in contributing to the Apache Beam Python codebase, see the
+[Contribution Guide](/contribute).
+
+On this page:
+
+{{< toc >}}
+
+## Set up your development environment
+
+### Check your Python version
+
+The Beam SDK requires Python users to use Python version 3.6 or higher. Check
+your version by running:
+
+{{< highlight >}}
+python3 --version
+{{< /highlight >}}
+
+### Install `virtualenv`
+
+Install [virtualenv](https://pypi.org/project/virtualenv/). For Debian and
+Ubuntu distributions, install the
+[python3-venv](https://packages.debian.org/stable/python3-venv) package:
+
+{{< highlight >}}
+sudo apt update
+sudo apt install python3 python3-dev python3-venv
+{{< /highlight >}}
+
+## Clone the GitHub repository
+
+Clone or download the
+[apache/beam-starter-python](https://github.com/apache/beam-starter-python)
+GitHub repository and change into the `beam-starter-python` directory.
+
+{{< highlight >}}
+git clone https://github.com/apache/beam-starter-python.git
+cd beam-starter-python
+{{< /highlight >}}
+
+## Create and activate a virtual environment
+
+A virtual environment is a directory tree containing its own Python
+distribution. Run the following command:
+
+{{< highlight >}}
+# Create a new Python virtual environment.
+python3 -m venv env
+
+# Activate the virtual environment.
+source env/bin/activate
+{{< /highlight >}}
+
+## Install the project dependences
+
+Run the following command to install the project's dependencies from the
+`requirements.txt` file:
+
+{{< highlight >}}
+pip install -e .
+{{< /highlight >}}
+
+## Run the quickstart
+
+Run the following command:
+
+{{< highlight >}}
+python main.py --input-text="--inputText=Greetings"
+{{< /highlight >}}
+
+The output is similar to the following:
+
+{{< highlight >}}
+Hello
+World!
+Greetings
+{{< /highlight >}}
+
+The lines might appear in a different order.
+
+Optionally, run the following command to deactivate the virtual environment:

Review Comment:
   we can remove the Optionally ... part



##########
website/www/site/content/en/get-started/quickstart/python.md:
##########
@@ -0,0 +1,216 @@
+---
+title: "Beam Quickstart for Python"
+aliases:
+  - /get-started/quickstart/
+  - /use/quickstart/
+  - /getting-started/
+---
+<!--
+Licensed under the Apache License, Version 2.0 (the "License");
+you may not use this file except in compliance with the License.
+You may obtain a copy of the License at
+
+http://www.apache.org/licenses/LICENSE-2.0
+
+Unless required by applicable law or agreed to in writing, software
+distributed under the License is distributed on an "AS IS" BASIS,
+WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+See the License for the specific language governing permissions and
+limitations under the License.
+-->
+
+# Apache Beam Python SDK quickstart
+
+This quickstart shows you how to run an
+[example pipeline](https://github.com/apache/beam-starter-python) written with
+the [Apache Beam Python SDK](/documentation/sdks/python), using the
+[Direct Runner](/documentation/runners/direct/). The Direct Runner executes
+pipelines locally on your machine.
+
+If you're interested in contributing to the Apache Beam Python codebase, see the
+[Contribution Guide](/contribute).
+
+On this page:
+
+{{< toc >}}
+
+## Set up your development environment
+
+### Check your Python version
+
+The Beam SDK requires Python users to use Python version 3.6 or higher. Check
+your version by running:
+
+{{< highlight >}}
+python3 --version
+{{< /highlight >}}
+
+### Install `virtualenv`
+
+Install [virtualenv](https://pypi.org/project/virtualenv/). For Debian and
+Ubuntu distributions, install the
+[python3-venv](https://packages.debian.org/stable/python3-venv) package:
+
+{{< highlight >}}
+sudo apt update
+sudo apt install python3 python3-dev python3-venv
+{{< /highlight >}}
+
+## Clone the GitHub repository
+
+Clone or download the
+[apache/beam-starter-python](https://github.com/apache/beam-starter-python)
+GitHub repository and change into the `beam-starter-python` directory.
+
+{{< highlight >}}
+git clone https://github.com/apache/beam-starter-python.git
+cd beam-starter-python
+{{< /highlight >}}
+
+## Create and activate a virtual environment
+
+A virtual environment is a directory tree containing its own Python
+distribution. Run the following command:

Review Comment:
   ```suggestion
   distribution. We recommend using a virtual environment so that all dependencies of your project are installed in an isolated and self-contained environment. To setup a virtual environment, run the following commands:
   ```



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: github-unsubscribe@beam.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org