Logfmt
Python package for parsing log lines in the logfmt style. See the original project by Blake Mizerany and Keith Rarick for information about logfmt conventions and use: https://github.com/kr/logfmt
Using logfmt
Easily process lines from logfmt formatted input:
from logfmt import parse
input = StringIO('\n'.join(['key1=value1', 'key2=value2']))
for values in parse(input):
print values
This program produces this output:
{'key1': 'value1'}
{'key2': 'value2'}
Easily generate lines in logfmt formatted output
from logfmt import format
for line in format({'key1': 'value1'}, {'key2': 'value2'}):
print line
This program produces this output:
key1="value1" key2="value2"
Installation
To install it, simply:
pip install logfmt
Metadata
Release files for logfmt 0.4
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| logfmt-0.4.tar.gz | 3.4 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| logfmt-0.4-py2.py3-none-any.whl | Python 2, Python 3 | none | any | Details |
Total release size: 6.5 kB
Release files / logfmt-0.4.tar.gz
| Download URL | logfmt-0.4.tar.gz |
|---|---|
| Size | 3.4 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
9db2ba67519a968c5c3d2230e79ab68e6cfac791daa516bbca9e2606eb02a4c6
|
|
BLAKE2b-256 checksum How to use checksums |
4640a3b1d774c8b919d9bcfbfe211c20f1b8f4d7478457c0cd831e8f4f17774c
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/1.12.1 pkginfo/1.4.2 requests/2.20.1 setuptools/40.4.1 requests-toolbelt/0.8.0 tqdm/4.28.1 CPython/3.6.6
|
Release files / logfmt-0.4-py2.py3-none-any.whl
| Download URL | logfmt-0.4-py2.py3-none-any.whl |
|---|---|
| Size | 3.1 kB |
| Tags | Python 2 Python 3 |
|
SHA-256 checksum How to use checksums |
0914b7ca93e75d841e6eb8a680fef4475a322f91be2c1883c0e9582e6620dc41
|
|
BLAKE2b-256 checksum How to use checksums |
f5fc143f15b9347c2e42a5c726a04defed086c543ddd541419c31baef01c6a17
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/1.12.1 pkginfo/1.4.2 requests/2.20.1 setuptools/40.4.1 requests-toolbelt/0.8.0 tqdm/4.28.1 CPython/3.6.6
|