semvec/pypi-packages huggingface dataset:
parse-log 1.0.1
Rust tail implementation
Requires Python: >=3.7
Keywords: log,tail,parse,files

# 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
```python
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]
```
apachecn-indie-wiki 2022.6.28.1
ApacheCN 独立开发/自由职业/远程工作/数字游民知识库
Requires Python: >=3.6

# ApacheCN 独立开发/自由职业/远程工作/数字游民知识库

> 协议：[CC BY-NC-SA 4.0](http://creativecommons.org/licenses/by-nc-sa/4.0/)
> 
> 收割 SB 的人会被 SB 们封神，试图唤醒 SB 的人是 SB 眼中的 SB。——SB 第三定律

* [在线阅读](https://idw.apachecn.org)
* [在线阅读（Gitee）](https://apachecn.gitee.io/doc-template/)
* [ApacheCN 学习资源](http://docs.apachecn.org/)

## 贡献指南

请通过 ISSUE 提交想要收录的文章，负责人看到后就会处理。

## 联系方式

### 负责人

* [飞龙](https://github.com/wizardforcel): 562826179

### 其他

*   在我们的 [apachecn/apachecn-indie-wiki](https://github.com/apachecn/apachecn-indie-wiki) github 上提 issue.
*   发邮件到 Email: `apachecn@163.com`.
*   在我们的 [组织学习交流群](https://www.apachecn.org/#/docs/join) 中联系群主/管理员即可.

## 下载

### Docker

```
docker pull apachecn0/apachecn-indie-wiki
docker run -tid -p <port>:80 apachecn0/apachecn-indie-wiki
# 访问 http://localhost:{port} 查看文档
```

### PYPI

```
pip install apachecn-indie-wiki
apachecn-indie-wiki <port>
# 访问 http://localhost:{port} 查看文档
```

### NPM

```
npm install -g apachecn-indie-wiki
apachecn-indie-wiki <port>
# 访问 http://localhost:{port} 查看文档
```

## 赞助我们

![](http://data.apachecn.org/img/about/donate.jpg)