This release is a pre-release and may not be stable for production use.
Export data to InfluxDB's Line Protocol format based on specified input data structure (columns names) and desired output (measurement, fields, tags, timestamp).
Any data going through the exporter is sanitized according to Influx's recommendations:
https://docs.influxdata.com/influxdb/v1.0/write_protocols/line_protocol_tutorial/#data-types
https://docs.influxdata.com/influxdb/v1.0/write_protocols/line_protocol_tutorial/#special-characters-and-keywords
InfluxDB's Line Protocol documentation can be found here:
https://docs.influxdata.com/influxdb/v1.0/write_protocols/
## Usage
from lineprotocol import LineProtocolExporter
input = [
['1', 'foo', 'x', '24', '50.2', 'True'],
['2', 'bar', 'y', '25', '17.0', 'True'],
['3', 'baz', 'z', '26', '100', 'False'],
]
exporter = LineProtocolExporter(
labels=['id', 'name', 'some_letter', 'some_number', 'percentage', 'status'],
measurement='example',
tag_columns=['some_letter'],
field_columns=['id', 'name', 'percentage', 'status'],
field_types=['int', 'str', 'float', 'bool'],
timestamp=1465839830100400200,
)
for line in input:
print exporter.export(line)
# Output:
# example,some_letter=x id=1i,name="foo",percentage=50.2,status=True 1465839830100400200
# example,some_letter=y id=2i,name="bar",percentage=17.0,status=True 1465839830100400200
# example,some_letter=z id=3i,name="baz",percentage=100,status=False 1465839830100400200
## Running tests
$ python -m unittest tests.smoke_test
Metadata
Release files for lineprotocol 0.1.dev0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| lineprotocol-0.1.dev0.tar.gz | 4.7 kB | Without provenance | Details for lineprotocol-0.1.dev0.tar.gz |
Release files / lineprotocol-0.1.dev0.tar.gz
| Download URL | lineprotocol-0.1.dev0.tar.gz |
|---|---|
| Size | 4.7 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
1f89007984423f6973d0a22d148e26abc7abd375354129ab18ddfba34d7300e5
|
|
BLAKE2b-256 checksum How to use checksums |
2cc3816794c3f7cb5a84eb21939f52dc7ab7ed7184d494c6198b6b1bee3fbad2
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
Security for lineprotocol 0.1.dev0
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.