title: How do I write influx line protocol records to QuestDB using Python?
body: <p>How can I send influx line protocol messages to QuestDB from python? Should I be using a library or should I write to the socket? The <a href="https://questdb.io/docs/develop/insert-data" rel="nofollow noreferrer">node example</a> looks like</p>
  <pre class="lang-js prettyprint-override"><code>const net = require(&quot;net&quot;)
  
  const client = new net.Socket()
  
  const HOST = &quot;localhost&quot;
  const PORT = 9009
  
  function run() {
    client.connect(PORT, HOST, () =&gt; {
      const rows = [
        `trades,name=test_ilp1 value=12.4 ${Date.now() * 1e6}`,
        `trades,name=test_ilp2 value=11.4 ${Date.now() * 1e6}`,
      ]
  
      rows.forEach((row) =&gt; {
        client.write(`${row}\n`)
      })
  
      client.destroy()
    })
  
    client.on(&quot;data&quot;, function (data) {
      console.log(&quot;Received: &quot; + data)
    })
  
    client.on(&quot;close&quot;, function () {
      console.log(&quot;Connection closed&quot;)
    })
  }
  
  run()
  </code></pre>