Update README.md with install instructions
This commit is contained in:
30
README.md
30
README.md
@@ -16,6 +16,25 @@ This project is very much alpha. The API is in flux and not all the features are
|
|||||||
|
|
||||||
Install with your favorite package manager
|
Install with your favorite package manager
|
||||||
|
|
||||||
|
Pip:
|
||||||
|
|
||||||
|
```shell
|
||||||
|
git clone https://github.com/mumrah/kafka-python
|
||||||
|
pip install kafka-python
|
||||||
|
```
|
||||||
|
|
||||||
|
Setuptools:
|
||||||
|
```shell
|
||||||
|
git clone https://github.com/mumrah/kafka-python
|
||||||
|
easy_install kafka-python
|
||||||
|
```
|
||||||
|
|
||||||
|
Using `setup.py` directly:
|
||||||
|
```shell
|
||||||
|
git clone https://github.com/mumrah/kafka-python
|
||||||
|
python setup.py install
|
||||||
|
```
|
||||||
|
|
||||||
# Tests
|
# Tests
|
||||||
|
|
||||||
## Run the unit tests
|
## Run the unit tests
|
||||||
@@ -55,7 +74,7 @@ python -m test.integration
|
|||||||
|
|
||||||
## Send several messages to a topic
|
## Send several messages to a topic
|
||||||
|
|
||||||
Same as before, just add more arguments to `send_simple`
|
Same as before, just add more arguments to `send\_simple`
|
||||||
|
|
||||||
```python
|
```python
|
||||||
kafka = KafkaClient("localhost", 9092)
|
kafka = KafkaClient("localhost", 9092)
|
||||||
@@ -65,7 +84,7 @@ Same as before, just add more arguments to `send_simple`
|
|||||||
|
|
||||||
## Recieve some messages from a topic
|
## Recieve some messages from a topic
|
||||||
|
|
||||||
Supply `get_message_set` with a `FetchRequest`, get back the messages and new `FetchRequest`
|
Supply `get\_message\_set` with a `FetchRequest`, get back the messages and new `FetchRequest`
|
||||||
|
|
||||||
```python
|
```python
|
||||||
kafka = KafkaClient("localhost", 9092)
|
kafka = KafkaClient("localhost", 9092)
|
||||||
@@ -79,7 +98,7 @@ paging through the queue very simple.
|
|||||||
|
|
||||||
## Send multiple messages to multiple topics
|
## Send multiple messages to multiple topics
|
||||||
|
|
||||||
For this we use the `send_multi_message_set` method along with `ProduceRequest` objects.
|
For this we use the `send\_multi\_message\_set` method along with `ProduceRequest` objects.
|
||||||
|
|
||||||
```python
|
```python
|
||||||
kafka = KafkaClient("localhost", 9092)
|
kafka = KafkaClient("localhost", 9092)
|
||||||
@@ -97,7 +116,7 @@ For this we use the `send_multi_message_set` method along with `ProduceRequest`
|
|||||||
|
|
||||||
## Iterate through all messages from an offset
|
## Iterate through all messages from an offset
|
||||||
|
|
||||||
The `iter_messages` method will make the underlying calls to `get_message_set`
|
The `iter\_messages` method will make the underlying calls to `get\_message\_set`
|
||||||
to provide a generator that returns every message available.
|
to provide a generator that returns every message available.
|
||||||
|
|
||||||
```python
|
```python
|
||||||
@@ -116,5 +135,4 @@ An optional `auto` argument will control auto-paging through results
|
|||||||
kafka.close()
|
kafka.close()
|
||||||
```
|
```
|
||||||
|
|
||||||
This will only iterate through messages in the byte range of
|
This will only iterate through messages in the byte range of (0, 1024\*1024)
|
||||||
(0, 1024\*1024)
|
|
||||||
|
|||||||
1
setup.py
1
setup.py
@@ -8,5 +8,6 @@ setup(
|
|||||||
url="https://github.com/mumrah/kafka-python",
|
url="https://github.com/mumrah/kafka-python",
|
||||||
packages=["kafka"],
|
packages=["kafka"],
|
||||||
license="Copyright 2012, David Arthur under Apache License, v2.0",
|
license="Copyright 2012, David Arthur under Apache License, v2.0",
|
||||||
|
description="Pure Python client for Apache Kafka",
|
||||||
long_description=open("README.md").read(),
|
long_description=open("README.md").read(),
|
||||||
)
|
)
|
||||||
|
|||||||
Reference in New Issue
Block a user