Skip to content

Commit 01768e2

Browse files
committed
chore: minor doc and installation tweaks
1 parent 8257021 commit 01768e2

File tree

6 files changed

+86
-39
lines changed

6 files changed

+86
-39
lines changed

CHANGELOG.rst

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,23 @@
22
Changelog
33
=========
44

5+
2.0.1 (2024-03-22)
6+
------------------
7+
8+
Patch release with minor bug fixes, no API changes and some documentation tweaks.
9+
10+
Bug fixes
11+
~~~~~~~~~
12+
* Removed two unnecessary debugging ``print()`` statements that were
13+
accidentally left in the code.
14+
15+
Documentation
16+
~~~~~~~~~~~~~
17+
* Introduced the ability to optionally install ``pandas`` and ``pyarrow`` via
18+
``python3 -m pip install -U questdb[dataframe]`` and updated the documentation
19+
to reflect this.
20+
21+
522
2.0.0 (2024-03-19)
623
------------------
724

README.rst

Lines changed: 20 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -22,24 +22,11 @@ The latest version of the library is 2.0.1.
2222

2323
::
2424

25-
python3 -m pip install -U questdb
25+
python3 -m pip install -U questdb[dataframe]
2626

2727
Please start by `setting up QuestDB <https://questdb.io/docs/quick-start/>`_ . Once set up, you can use this library to insert data.
2828

29-
.. code-block:: python
30-
31-
from questdb.ingress import Sender, TimestampNanos
32-
33-
conf = f'http::addr=localhost:9000;'
34-
with Sender.from_conf(conf) as sender:
35-
sender.row(
36-
'sensors',
37-
symbols={'id': 'toronto1'},
38-
columns={'temperature': 20.0, 'humidity': 0.5},
39-
at=TimestampNanos.now())
40-
sender.flush()
41-
42-
You can also send Pandas dataframes:
29+
The most common way to insert data is from a Pandas dataframe.
4330

4431
.. code-block:: python
4532
@@ -56,8 +43,25 @@ You can also send Pandas dataframes:
5643
with Sender.from_conf(conf) as sender:
5744
sender.dataframe(df, table_name='sensors', at='timestamp')
5845
46+
You can also send individual rows. This only requires a more minimal installation::
47+
48+
python3 -m pip install -U questdb
49+
50+
.. code-block:: python
51+
52+
from questdb.ingress import Sender, TimestampNanos
53+
54+
conf = f'http::addr=localhost:9000;'
55+
with Sender.from_conf(conf) as sender:
56+
sender.row(
57+
'sensors',
58+
symbols={'id': 'toronto1'},
59+
columns={'temperature': 20.0, 'humidity': 0.5},
60+
at=TimestampNanos.now())
61+
sender.flush()
62+
5963
60-
To connect via TCP, set the
64+
To connect via the `older TCP protocol <https://py-questdb-client.readthedocs.io/en/latest/sender.html#ilp-tcp-or-ilp-http>`_, set the
6165
`configuration string <https://py-questdb-client.readthedocs.io/en/latest/conf.html>`_ to:
6266

6367
.. code-block:: python

docs/conf.rst

Lines changed: 11 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -67,6 +67,7 @@ Connection
6767

6868
The default is ``0.0.0.0``.
6969

70+
.. _sender_conf_auth:
7071

7172
Authentication
7273
==============
@@ -128,7 +129,7 @@ still use TLS by setting up a proxy in front of QuestDB, such as
128129
* ``pem_file``: Path to a PEM-encoded certificate authority file.
129130
This is useful for testing with self-signed certificates.
130131

131-
The default is: ``'webpki_roots'``.
132+
The default is: ``'webpki_and_os_roots'``.
132133

133134
* ``tls_roots`` - ``str``: Path to a PEM-encoded certificate authority file.
134135
When used it defaults the ``tls_ca`` to ``'pem_file'``.
@@ -166,7 +167,7 @@ The following parameters control the :ref:`sender_auto_flush` behavior.
166167
* ``auto_flush`` - ``'on'`` | ``'off'``: Global switch for the auto-flushing
167168
behavior.
168169

169-
*Default: ``'on'``.*
170+
Default: ``'on'``.
170171

171172
* ``auto_flush_rows`` - ``int > 0`` | ``'off'``: The number of rows that will
172173
trigger a flush. Set to ``'off'`` to disable.
@@ -176,12 +177,12 @@ The following parameters control the :ref:`sender_auto_flush` behavior.
176177
* ``auto_flush_bytes`` - ``int > 0`` | ``'off'``: The number of bytes that will
177178
trigger a flush. Set to ``'off'`` to disable.
178179

179-
*Default: ``'off'``.*
180+
Default: ``'off'``.
180181

181182
* ``auto_flush_interval`` - ``int > 0`` | ``'off'``: The time in milliseconds
182183
that will trigger a flush. Set to ``'off'`` to disable.
183184

184-
*Default: 1000 (millis).*
185+
Default: 1000 (millis).
185186

186187
.. _sender_conf_auto_flush_interval:
187188

@@ -229,15 +230,15 @@ Buffer
229230

230231
* ``init_buf_size`` - ``int > 0``: Initial buffer capacity.
231232

232-
*Default: 65536 (64KiB).*
233+
Default: 65536 (64KiB).
233234

234235
* ``max_buf_size`` - ``int > 0``: Maximum flushable buffer capacity.
235236

236-
*Default: 104857600 (100MiB).*
237+
Default: 104857600 (100MiB).
237238

238239
* ``max_name_len`` - ``int > 0``: Maximum length of a table or column name.
239240

240-
*Default: 127.*
241+
Default: 127.
241242

242243
.. _sender_conf_request:
243244

@@ -251,13 +252,13 @@ The following parameters control the HTTP request behavior.
251252
backoff starting at 10ms and doubling after each failed attempt up to a
252253
maximum of 1 second.
253254

254-
*Default: 10000 (10 seconds).*
255+
Default: 10000 (10 seconds).
255256

256257
* ``request_timeout`` - ``int > 0``: The time in milliseconds to wait for a
257258
response from the server. This is in addition to the calculation derived from
258259
the ``request_min_throughput`` parameter.
259260

260-
*Default: 10000 (10 seconds).*
261+
Default: 10000 (10 seconds).
261262

262263
* ``request_min_throughput`` - ``int > 0``: Minimum expected throughput in
263264
bytes per second for HTTP requests. If the throughput is lower than this
@@ -266,7 +267,7 @@ The following parameters control the HTTP request behavior.
266267
This is useful for large requests.
267268
You can set this value to ``0`` to disable this logic.
268269

269-
*Default: 102400 (100 KiB/s).*
270+
Default: 102400 (100 KiB/s).
270271

271272

272273
The final request timeout calculation is::

docs/installation.rst

Lines changed: 34 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -2,36 +2,60 @@
22
Installation
33
============
44

5+
Dependency
6+
==========
7+
58
The Python QuestDB client does not have any additional run-time dependencies and
69
will run on any version of Python >= 3.8 on most platforms and architectures.
710

11+
Optional Dependencies
12+
---------------------
13+
14+
Ingesting dataframes also require the following
15+
dependencies to be installed:
16+
17+
* ``pandas``
18+
* ``pyarrow``
19+
* ``numpy``
20+
21+
These are bundled as the ``dataframe`` extra.
22+
23+
Without this option, the ``questdb`` package has no dependencies other than
24+
to the Python standard library.
25+
26+
PIP
27+
---
28+
829
You can install it (or update it) globally by running::
930

10-
python3 -m pip install -U questdb
31+
python3 -m pip install -U questdb[dataframe]
1132

1233

1334
Or, from within a virtual environment::
1435

15-
pip install -U questdb
36+
pip install -U questdb[dataframe]
1637

1738

39+
If you don't need to work with dataframes::
40+
41+
python3 -m pip install -U questdb
42+
43+
Poetry
44+
------
45+
1846
If you're using poetry, you can add ``questdb`` as a dependency::
1947

48+
poetry add questdb[dataframe]
49+
50+
Similarly, if you don't need to work with dataframes::
51+
2052
poetry add questdb
2153

2254
or to update the dependency::
2355

2456
poetry update questdb
2557

2658

27-
Note that ingesting dataframes also require the following
28-
dependencies to be installed:
29-
30-
* ``pandas``
31-
* ``pyarrow``
32-
* ``numpy``
33-
34-
3559
Verifying the Installation
3660
==========================
3761

docs/sender.rst

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -642,13 +642,13 @@ Since TCP does not block for a response it is useful for high-throughput
642642
scenarios in higher latency networks or on older versions of QuestDB which do
643643
not support ILP/HTTP quite yet.
644644

645-
It should be noted that HTTP performance equivalent to TCP can be achieved by
646-
:ref:`using multiple sender objects in parallel <sender_http_performance>`.
645+
It should be noted that you can achieve equivalent or better performance to TCP
646+
with HTTP by :ref:`using multiple sender objects in parallel <sender_http_performance>`.
647647

648648
Either way, you can easily switch between the two protocols by changing:
649649

650650
* The ``<protocol>`` part of the :ref:`configuration string <sender_conf>`.
651651

652652
* The port number (ILP/TCP default is 9009, ILP/HTTP default is 9000).
653653

654-
* Any authentication parameters such as ``username``, ``token``, et cetera.
654+
* Any :ref:`authentication parameters <sender_conf_auth>` such as ``username``, ``token``, et cetera.

pyproject.toml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,7 @@ email = "adam@questdb.io"
2929
[project.optional-dependencies]
3030
publish = ["twine", "wheel"]
3131
ci = ["cibuildwheel"]
32+
dataframe = ["pandas", "pyarrow", "numpy"]
3233

3334
[project.urls]
3435
Homepage = "https://questdb.io/"

0 commit comments

Comments
 (0)