Skip to main content

Parse LOG

rust tail implementation to parse files

Features

  • Load N lines or all lines
  • search and ignore lines with certain strings
  • parse lines and extract what you want

Usage

import tail

path_to_file = 'path/to/file/thefile.log'
number_of_lines = 3

#return 3 lines
tail.lines(path_to_file, number_of_lines)

#return all lines with the given search string
#or 'search1, search2'
tail.search_all(path_to_file, 'Search_String')

#return all lines with the given search string
#or 'search1, search2' also 'ignore1, ignore2' and so on
tail.isearch_all(path_to_file, 'Search_String', 'Ignore_String')

#search through all lines contains certain string condition
#or 'search1, search2' also 'ignore1, ignore2' and so on
tail.search_lines(path_to_file, "search", "ignore_string", number_of_lines)

#search through all lines and ignore lines that contains certain stuff
#or 'search1, search2' also 'ignore1, ignore2' and so on
tail.isearch_lines(path_to_file, 'Search_String', 'Ignore_string', number_of_lines)

#return the last line based on the search condition
#or 'search1, search2'
tail.search_last_line(path_to_file, 'Search_String')

#return last line based on search and ignore conditions
#or 'search1, search2' also 'ignore1, ignore2' and so on
tail.isearch_last_line(path_to_file, 'Search_String', 'Ignore_String')

#parse line by line
lines = tail.lines(path_to_file, number_of_lines)
[tail.parse_line(lines, "begin_delimiter", "end_delimiter") for line in lines]

Metadata

Release files for parse-log 1.0.1

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for parse-log 1.0.1
File Size Uploaded
parse_log-1.0.1.tar.gz 4.4 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for parse-log 1.0.1
File Interpreter ABI Platform
parse_log-1.0.1-cp37-cp37m-manylinux_2_5_x86_64.manylinux1_x86_64.whl CPython 3.7 CPython 3.7 pymalloc Linux glibc 2.5+ x86-64 Details

Total release size: 192.3 kB

Release files / parse_log-1.0.1.tar.gz

Download URL parse_log-1.0.1.tar.gz
Size 4.4 kB
Tags Source
SHA-256 checksum
How to use checksums
ae019afe8bc5147288ab93265333a58059d642dd79c3cde2a11757b226c368dd
BLAKE2b-256 checksum
How to use checksums
e3eb656d964ca66a80359baef7e3b6127a8b1a47410cee89c9451f91829d51cc
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via maturin/0.13.0-beta.7

Release files / parse_log-1.0.1-cp37-cp37m-manylinux_2_5_x86_64.manylinux1_x86_64.whl

Download URL parse_log-1.0.1-cp37-cp37m-manylinux_2_5_x86_64.manylinux1_x86_64.whl
Size 187.9 kB
Tags CPython 3.7 CPython 3.7 pymalloc Linux glibc 2.5+ x86-64
SHA-256 checksum
How to use checksums
fda754a30ed9616d0e07c28605c75c209746258e8bc7c575e83c179ace1459ce
BLAKE2b-256 checksum
How to use checksums
82f62892de1df01629a217bc21ded9b3a52150bed212940ed2d87fa1a923322e
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via maturin/0.13.0-beta.7

Release history Release notifications | RSS feed

This release

1.0.1 This release

2 release files

1.0.0

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page