Skip to content

Commit

Permalink
new version 0.0.27
Browse files Browse the repository at this point in the history
- fixed issue with parsing regular expressions and suppressed deprecation warnings ("Flags not at the start of the expression").
- cleaned output for '--count' option and added string count along with cell and row count  
- added support for .cvs files
  • Loading branch information
zazuum authored Jun 10, 2022
1 parent 34828e4 commit 5845697
Show file tree
Hide file tree
Showing 4 changed files with 175 additions and 135 deletions.
17 changes: 11 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,16 +1,18 @@
## Owerview

*xlsxgrep* is a CLI tool to search text in XLSX, XLS and ODS files. It works similarly to Unix/GNU Linux *grep*.
*xlsxgrep* is a CLI tool to search text in XLSX, XLS, CSV and ODS files. It works similarly to Unix/GNU Linux *grep*.

## Features

- Grep compatible: xlsxgrep tries to be compatible with Unix/Linux grep, where it makes sense.
Some of grep options are supported (such as `-r`, `-i` or `-c`).

- Search many XLSX, XLS and ODS files at once, even recursively in directories.
- Search many XLSX, XLS, CSV and ODS files at once, even recursively in directories.

- Regular expressions: Python regex.

- Supported file types: csv, ods, xls, xlsx

## Usage:
```
Expand All @@ -24,8 +26,9 @@ positional arguments:
optional arguments:
-h, --help show this help message and exit
-V, --version display version information and exit.
-P, --python-regex PATTERN is a Python regular expression. This is the default.
-F, --fixed-strings interpret PATTERN as fixed strings, not regular expressions.
-i, --ignore-case ignore case distinctions.
-P, --python-regex PATTERN is a Python regular expression.
-w, --word-regexp force PATTERN to match only whole words.
-c, --count print only a count of matches per file.
-r, --recursive search directories recursively.
Expand All @@ -40,10 +43,12 @@ optional arguments:
```

## Example:

## Examples:
```sh
xlsxgrep -i "foo" foobar.xlsx
```
```sh
xlsxgrep "PATTERN" -H -N --sep=";" -r /path/to/file_or_folder
xlsxgrep -c -H "(?i)foo|bar" /folder
```
## Installation

Expand Down
38 changes: 38 additions & 0 deletions setup.cfg
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
[metadata]
name = xlsxgrep
version = 0.0.27
author = Ivan Cvitic
author_email = cviticivan@gmail.com
license = MIT
description = CLI tool to search text in XLSX, XLS and ODS files. It works similarly to Unix\GNU Linux grep
url = https://github.com/zazuum/xlsxgrep
long_description = file: README.md
long_description_content_type = text/markdown
classifiers =
Environment :: Console
License :: OSI Approved :: MIT License
Intended Audience :: Developers
Intended Audience :: Education
Intended Audience :: End Users/Desktop
Operating System :: OS Independent
Programming Language :: Python :: 3
Programming Language :: Python :: 3.7
Programming Language :: Python :: 3.8
Programming Language :: Python :: 3.9
Programming Language :: Python :: 3.10
Topic :: Scientific/Engineering :: Information Analysis
Topic :: Scientific/Engineering :: Bio-Informatics
Topic :: Utilities

[options]
packages = xlsxgrep
install_requires =
pyexcel
pyexcel-xls
pyexcel-xlsx
pyexcel-ods3
pyexcel-ods
include_package_data = True

[options.entry_points]
console_scripts = xlsxgrep=xlsxgrep.xlsxgrep:main
40 changes: 4 additions & 36 deletions setup.py
Original file line number Diff line number Diff line change
@@ -1,38 +1,6 @@
from setuptools import setup

def readme():
with open('README.md') as f:
README = f.read()
return README
#!/usr/bin/env python

from setuptools import setup

setup(
name="xlsxgrep",
version="0.0.26",
description="CLI tool to search text in XLSX, XLS and ODS files. It works similarly to Unix\GNU Linux grep",
long_description=readme(),
long_description_content_type="text/markdown",
url="https://github.com/zazuum/xlsxgrep",
author="Ivan Cvitic",
author_email="cviticivan@gmail.com",
license="MIT",
classifiers=[
"License :: OSI Approved :: MIT License",
"Intended Audience :: Developers",
"Intended Audience :: Education",
"Intended Audience :: End Users/Desktop",
"Programming Language :: Python :: 3",
"Programming Language :: Python :: 3.7",
"Programming Language :: Python :: 3.8",
"Programming Language :: Python :: 3.9",
"Programming Language :: Python :: 3.10",
],
packages=["xlsxgrep"],
include_package_data=True,
install_requires=["pyexcel","pyexcel-xls", "pyexcel-xlsx", "pyexcel-ods3", "pyexcel-ods"],
entry_points={
"console_scripts": [
"xlsxgrep=xlsxgrep.xlsxgrep:main",
]
},
)
if __name__ == "__main__":
setup()
Loading

0 comments on commit 5845697

Please sign in to comment.