Skip to content

Commit 835ef27

Browse files
authored
Update quickstart code and copy to match (#389)
1 parent 7327cb1 commit 835ef27

File tree

1 file changed

+10
-12
lines changed

1 file changed

+10
-12
lines changed

docs/quickstart.md

Lines changed: 10 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -22,11 +22,10 @@ python -m pip install quixstreams
2222

2323
### Step 2. Producing data to Kafka
2424

25-
In order to process events with Quix Streams, they first need to be in Kafka.
26-
Let's create the file `producer.py` to generate some test data into the Kafka topic:
25+
In order to process events with Quix Streams, they first need to be in Kafka.
26+
Let's create the file `producer.py` to write some test data into a Kafka topic.
2727

2828
```python
29-
3029
from quixstreams import Application
3130

3231
# Create an Application - the main configuration entry point
@@ -65,8 +64,8 @@ if __name__ == "__main__":
6564

6665
### Step 3. Consuming data from Kafka
6766

68-
Let's create the file `consumer.py` with streaming processing code.
69-
It will start consuming messages from Kafka and applying transformations to them.
67+
Let's create the file `consumer.py` to process the data in the topic.
68+
It will start consuming messages from Kafka and apply transformations to them.
7069

7170
```python
7271
from quixstreams import Application
@@ -86,7 +85,7 @@ messages_topic = app.topic(name="messages", value_deserializer="json")
8685
sdf = app.dataframe(topic=messages_topic)
8786

8887
# Print the input data
89-
sdf = sdf.update(lambda message: print("Input: ", message))
88+
sdf = sdf.update(lambda message: print(f"Input: {message}"))
9089

9190
# Define a transformation to split incoming sentences
9291
# into words using a lambda function
@@ -99,17 +98,16 @@ sdf = sdf.apply(
9998
sdf["length"] = sdf["text"].apply(lambda word: len(word))
10099

101100
# Print the output result
102-
sdf = sdf.update(lambda word: print(word))
101+
sdf = sdf.update(lambda word: print(f"Output: {word}"))
103102

104103
# Run the streaming application
105104
if __name__ == "__main__":
106105
app.run(sdf)
107106
```
108107

109-
110108
### Step 4. Running the Producer
111109

112-
Let's run the `producer.py` to fill the topic with data.
110+
Let's run the `producer.py` in a terminal to fill the topic with data.
113111
If the topic does not exist yet, Quix Streams will create it with the default number of partitions.
114112

115113
```commandline
@@ -127,10 +125,11 @@ Produce event with key="id3" value="b'{"chat_id":"id3","text":"Mollis nunc sed i
127125
### Step 5. Running the Consumer
128126

129127
Now that you have a topic with data, you may start consuming events and process them.
130-
Let's run the `consumer.py` to see the results:
128+
Let's run the `consumer.py` to see the results.
131129

132130
```commandline
133131
python consumer.py
132+
134133
[2024-02-21 19:57:38,669] [INFO] : Initializing processing of StreamingDataFrame
135134
[2024-02-21 19:57:38,669] [INFO] : Topics required for this application: "messages", "words"
136135
[2024-02-21 19:57:38,699] [INFO] : Validating Kafka topics exist and are configured correctly...
@@ -147,7 +146,6 @@ Input: {'chat_id': 'id2', 'text': 'Consectetur adipiscing elit sed'}
147146
...
148147
```
149148

150-
151149
## Next steps
152150

153151
Now that you have a simple Quix Streams application working, you can dive into more advanced features:
@@ -164,4 +162,4 @@ Or check out the tutorials for more in-depth examples:
164162

165163
## Getting help
166164

167-
If you run into any problems, please create an [issue](https://github.com/quixio/quix-streams/issues) or ask in `#quix-help` in our **[Quix Community on Slack](https://quix.io/slack-invite)**.
165+
If you run into any problems, please create an [issue](https://github.com/quixio/quix-streams/issues) or ask in `#quix-help` in **[Quix Community on Slack](https://quix.io/slack-invite)**.

0 commit comments

Comments
 (0)