VeronicaWasson commented on code in PR #24804: URL: https://github.com/apache/beam/pull/24804#discussion_r1084514598
########## 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: Fixed ########## 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: Fixed -- 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: [email protected] For queries about this service, please contact Infrastructure at: [email protected]
