pyvector-rs
An experiment to integrate the power of Vector with Python!
Sending messages reliably can be quite hard
Even with something simple like SQS, when sending a batch of messages individual messages can fail while the rest succeed. So you need to detect this (and other errors), keep them in memory, and retry them with some kind of backoff. But what if your process is asked to exist before these have been sent successfully? What do you do? And how do you handle a large spike in send failures? You don't want messages to pile up and exhaust your memory, which would result in you loosing all your messages. So you need some kind of disk buffer. And you need metrics around this, and logging, and the rest.
If you squint a bit, this begins to look a lot like Vector.
What does this do?
This library integrates Vector with Python (without using an external process) and provides a custom python source
that allows you to send Python bytes to Vector with minimal copying.
You can then use any of the many available sinks to forward this data anywhere, with Vector handling all the complexities around batching, buffering to disk or memory, retries, rate-limiting, partitioning, authentication, backpressure and more.
The code below sends 1 million events to a SQS queue, a S3 bucket and an Elasticsearch cluster:
import uuid
import pyvector
import asyncio
import json
# Vector config: https://vector.dev/docs/reference/configuration/
config = """
[sources.python]
type = "python"
[sinks.s3]
type = "aws_s3"
inputs = ["python"]
bucket = "my-bucket"
[sinks.sqs]
type = "aws_sqs"
inputs = ["python"]
queue_url = "..."
[sinks.elasticsearch]
type = "elasticsearch"
inputs = ["python"]
endpoints = ["..."]
"""
async def send_to_vector():
vector = pyvector.Vector(config)
await vector.start()
for i in range(1_000_000):
data = json.dumps({"i": i, "uuid": str(uuid.uuid4())}).encode()
await vector.send(source="python", data=data)
await vector.stop()
asyncio.run(send_to_vector())
Metadata
Release files for pyvector-rs 0.1.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| pyvector_rs-0.1.0.tar.gz | 55.2 kB | Details |
Built distributions (wheels)
| File | Reset | |||
|---|---|---|---|---|
| pyvector_rs-0.1.0-cp312-cp312-manylinux_2_28_x86_64.whl | CPython 3.12 | CPython 3.12 | Linux glibc 2.28+ x86-64 | Details |
| pyvector_rs-0.1.0-cp312-cp312-macosx_11_0_arm64.whl | CPython 3.12 | CPython 3.12 | macOS 11.0+ ARM64 | Details |
| pyvector_rs-0.1.0-cp311-cp311-manylinux_2_28_x86_64.whl | CPython 3.11 | CPython 3.11 | Linux glibc 2.28+ x86-64 | Details |
| pyvector_rs-0.1.0-cp311-cp311-macosx_11_0_arm64.whl | CPython 3.11 | CPython 3.11 | macOS 11.0+ ARM64 | Details |
| pyvector_rs-0.1.0-cp310-cp310-manylinux_2_28_x86_64.whl | CPython 3.10 | CPython 3.10 | Linux glibc 2.28+ x86-64 | Details |
| pyvector_rs-0.1.0-cp310-cp310-macosx_11_0_arm64.whl | CPython 3.10 | CPython 3.10 | macOS 11.0+ ARM64 | Details |
| pyvector_rs-0.1.0-cp39-cp39-manylinux_2_28_x86_64.whl | CPython 3.9 | CPython 3.9 | Linux glibc 2.28+ x86-64 | Details |
| pyvector_rs-0.1.0-cp39-cp39-macosx_11_0_arm64.whl | CPython 3.9 | CPython 3.9 | macOS 11.0+ ARM64 | Details |
Total release size: 307.1 MB
Release files / pyvector_rs-0.1.0.tar.gz
| Download URL | pyvector_rs-0.1.0.tar.gz |
|---|---|
| Size | 55.2 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
ffaa1107a92e197750ff0c1635b6c464193c0279e5c974258a5dc35e4b546c91
|
|
BLAKE2b-256 checksum How to use checksums |
91035a9bdd77be7dea774f1058ae5375c1d1940428dc1e515ce3887d2dc3b5dd
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/5.0.0 CPython/3.12.3
|
Release files / pyvector_rs-0.1.0-cp312-cp312-manylinux_2_28_x86_64.whl
| Download URL | pyvector_rs-0.1.0-cp312-cp312-manylinux_2_28_x86_64.whl |
|---|---|
| Size | 58.5 MB |
| Tags | CPython 3.12 Linux glibc 2.28+ x86-64 |
|
SHA-256 checksum How to use checksums |
f853ae41efd35edc32c0e871c1b72dc40b8528a0bdc67bdd3d03db70c22ad58a
|
|
BLAKE2b-256 checksum How to use checksums |
e4afc3dda92a4a934f29edb817e2d83ef778903716b879474e46b7b90edba6b8
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/5.0.0 CPython/3.12.3
|
Release files / pyvector_rs-0.1.0-cp312-cp312-macosx_11_0_arm64.whl
| Download URL | pyvector_rs-0.1.0-cp312-cp312-macosx_11_0_arm64.whl |
|---|---|
| Size | 18.3 MB |
| Tags | CPython 3.12 macOS 11.0+ ARM64 |
|
SHA-256 checksum How to use checksums |
9db2f4211631d96f188cb3cd6be41f721ad5b963bb1915c4f52229cb257f8132
|
|
BLAKE2b-256 checksum How to use checksums |
7b21bea139043b6f8ae622501a9ef5fe128d4b1bc559a10170a289465645bc0b
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/5.0.0 CPython/3.12.3
|
Release files / pyvector_rs-0.1.0-cp311-cp311-manylinux_2_28_x86_64.whl
| Download URL | pyvector_rs-0.1.0-cp311-cp311-manylinux_2_28_x86_64.whl |
|---|---|
| Size | 58.5 MB |
| Tags | CPython 3.11 Linux glibc 2.28+ x86-64 |
|
SHA-256 checksum How to use checksums |
a924fa6c4c32341f087b63d3c0f9ef1d25a7f3ded020e3a105ae55ce5fc114b2
|
|
BLAKE2b-256 checksum How to use checksums |
c1bd6e4f086f095d4b2f2ba5a7f208e45fb204c8767063df90bacb6ce4171888
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/5.0.0 CPython/3.12.3
|
Release files / pyvector_rs-0.1.0-cp311-cp311-macosx_11_0_arm64.whl
| Download URL | pyvector_rs-0.1.0-cp311-cp311-macosx_11_0_arm64.whl |
|---|---|
| Size | 18.3 MB |
| Tags | CPython 3.11 macOS 11.0+ ARM64 |
|
SHA-256 checksum How to use checksums |
976cbd6d745b3aef9b49cfa15a9321f64cf5895b38252e7d0f9b791d680eaed5
|
|
BLAKE2b-256 checksum How to use checksums |
7ce5c8183272760cefdc19e1409f9a60e2d0564ebb355665407b9dd3142c154c
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/5.0.0 CPython/3.12.3
|
Release files / pyvector_rs-0.1.0-cp310-cp310-manylinux_2_28_x86_64.whl
| Download URL | pyvector_rs-0.1.0-cp310-cp310-manylinux_2_28_x86_64.whl |
|---|---|
| Size | 58.5 MB |
| Tags | CPython 3.10 Linux glibc 2.28+ x86-64 |
|
SHA-256 checksum How to use checksums |
37b5d47d0d41c8fc748a59e1f713b3e5a9a3505abb595badbaeb47a7e679f5df
|
|
BLAKE2b-256 checksum How to use checksums |
a13d277f72f5f9ed7319bc626687a76fe4a4a9b201d8154fc9ffb268026c8ded
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/5.0.0 CPython/3.12.3
|
Release files / pyvector_rs-0.1.0-cp310-cp310-macosx_11_0_arm64.whl
| Download URL | pyvector_rs-0.1.0-cp310-cp310-macosx_11_0_arm64.whl |
|---|---|
| Size | 18.3 MB |
| Tags | CPython 3.10 macOS 11.0+ ARM64 |
|
SHA-256 checksum How to use checksums |
a6e2d51f96774805434f2ff1307503b8134e90a70680badf2bfc247af89231bf
|
|
BLAKE2b-256 checksum How to use checksums |
35c4f6758a2c52df8cb9da067770fbb221ddcf677cb4cf6bee876e2ab138f10a
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/5.0.0 CPython/3.12.3
|
Release files / pyvector_rs-0.1.0-cp39-cp39-manylinux_2_28_x86_64.whl
| Download URL | pyvector_rs-0.1.0-cp39-cp39-manylinux_2_28_x86_64.whl |
|---|---|
| Size | 58.5 MB |
| Tags | CPython 3.9 Linux glibc 2.28+ x86-64 |
|
SHA-256 checksum How to use checksums |
e2fc3810f79ab6895ca685cf590642e2c8dc79c8dc619933726a416b1e0f7bd6
|
|
BLAKE2b-256 checksum How to use checksums |
85b4f39de2ce87608a42471e49ba9fe606862048cc33dcba21bfd0bf9094136d
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/5.0.0 CPython/3.12.3
|
Release files / pyvector_rs-0.1.0-cp39-cp39-macosx_11_0_arm64.whl
| Download URL | pyvector_rs-0.1.0-cp39-cp39-macosx_11_0_arm64.whl |
|---|---|
| Size | 18.3 MB |
| Tags | CPython 3.9 macOS 11.0+ ARM64 |
|
SHA-256 checksum How to use checksums |
2e9318f2a74f908b2c2014fce4438f1159d7eac5f58aee3e1daedbb29ef08ef8
|
|
BLAKE2b-256 checksum How to use checksums |
bcd4fea5fd16cc8ed23e04be31d74216c3db673907f8eb3d005f9cb74346c484
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/5.0.0 CPython/3.12.3
|