marcgrep 2.0.0__tar.gz → 2.0.2__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- {marcgrep-2.0.0 → marcgrep-2.0.2}/PKG-INFO +6 -4
- {marcgrep-2.0.0 → marcgrep-2.0.2}/marcgrep/cli.py +2 -2
- {marcgrep-2.0.0 → marcgrep-2.0.2}/marcgrep/color.py +3 -5
- marcgrep-2.0.2/pyproject.toml +76 -0
- marcgrep-2.0.0/pyproject.toml → marcgrep-2.0.2/pyproject.toml.orig +15 -6
- {marcgrep-2.0.0 → marcgrep-2.0.2}/readme.md +3 -1
- {marcgrep-2.0.0 → marcgrep-2.0.2}/marcgrep/__init__.py +0 -0
- {marcgrep-2.0.0 → marcgrep-2.0.2}/marcgrep/filter.py +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: marcgrep
|
|
3
|
-
Version: 2.0.
|
|
3
|
+
Version: 2.0.2
|
|
4
4
|
Summary: search MARC files for regex matches
|
|
5
5
|
Keywords: marc,grep,regex,libraries,cli,metadata,bibliographic,cataloging
|
|
6
6
|
Author: Eric Phetteplace
|
|
@@ -15,8 +15,8 @@ Classifier: Programming Language :: Python :: 3.12
|
|
|
15
15
|
Classifier: Programming Language :: Python :: 3.13
|
|
16
16
|
Classifier: Operating System :: OS Independent
|
|
17
17
|
Classifier: Topic :: Utilities
|
|
18
|
-
Requires-Dist: click==8.
|
|
19
|
-
Requires-Dist: pymarc==5.
|
|
18
|
+
Requires-Dist: click==8.5.0
|
|
19
|
+
Requires-Dist: pymarc==5.4.0
|
|
20
20
|
Requires-Dist: termcolor==3.3.0
|
|
21
21
|
Requires-Python: >=3.10
|
|
22
22
|
Project-URL: homepage, https://github.com/phette23/marcgreppy
|
|
@@ -116,10 +116,12 @@ You can also configure the subfield delimiter character and the symbol for an em
|
|
|
116
116
|
```sh
|
|
117
117
|
uv sync # install dependencies
|
|
118
118
|
uv run pytest # run tests
|
|
119
|
+
uv run ruff format . # format code
|
|
120
|
+
uv run ruff check . # lint code
|
|
119
121
|
uv build # build package, used in CI
|
|
120
122
|
```
|
|
121
123
|
|
|
122
|
-
Any tag triggers a release to [Test PyPI](https://test.pypi.org/project/marcgrep/). Any tag beginning with the letter `v` requires manual approval to be released to [PyPI](https://pypi.org/project/marcgrep/) and [GitHub](https://github.com/phette23/marcgreppy/releases). There are protection rules on the `pypi` and `testpypi` [environments](https://github.com/phette23/marcgreppy/settings/environments) to this effect, too.
|
|
124
|
+
Any tag triggers a release to [Test PyPI](https://test.pypi.org/project/marcgrep/). Any tag beginning with the letter `v` requires manual approval to be released to [PyPI](https://pypi.org/project/marcgrep/) and [GitHub](https://github.com/phette23/marcgreppy/releases). **Remember to increment the version in pyproject.toml** or the PYPI publish will fail. There are protection rules on the `pypi` and `testpypi` [environments](https://github.com/phette23/marcgreppy/settings/environments) to this effect, too.
|
|
123
125
|
|
|
124
126
|
## License
|
|
125
127
|
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import sys
|
|
2
|
-
from typing import BinaryIO
|
|
2
|
+
from typing import BinaryIO
|
|
3
3
|
|
|
4
4
|
import click
|
|
5
5
|
from pymarc import MARCReader
|
|
@@ -28,7 +28,7 @@ from .filter import Filter
|
|
|
28
28
|
)
|
|
29
29
|
@click.version_option(package_name="marcgrep", message="%(prog)s %(version)s")
|
|
30
30
|
def main(
|
|
31
|
-
files:
|
|
31
|
+
files: list[BinaryIO],
|
|
32
32
|
color: bool,
|
|
33
33
|
invert: bool,
|
|
34
34
|
count: bool,
|
|
@@ -27,11 +27,9 @@ EMPTY_INDICATOR: str = env_get("EMPTY_INDICATOR", "_")
|
|
|
27
27
|
|
|
28
28
|
|
|
29
29
|
def _set_color_env(token: str, invert: bool) -> str:
|
|
30
|
-
var = f"{token}_COLOR"
|
|
30
|
+
var: str = f"{token}_COLOR"
|
|
31
31
|
# validate that termcolor supports the color
|
|
32
|
-
|
|
33
|
-
assert environ.get(f"MARC_{var}", "black") in AVAILABLE_COLORS.keys()
|
|
34
|
-
except AssertionError:
|
|
32
|
+
if not environ.get(f"MARC_{var}", "black") in AVAILABLE_COLORS:
|
|
35
33
|
raise ValueError(
|
|
36
34
|
f'Invalid color "{environ.get(f"MARC_{var}")}" for MARC_{var}. '
|
|
37
35
|
f"Valid colors are: {', '.join(AVAILABLE_COLORS.keys())}."
|
|
@@ -41,7 +39,7 @@ def _set_color_env(token: str, invert: bool) -> str:
|
|
|
41
39
|
return env_get(var, COLOR_DARK_DEFAULTS[token])
|
|
42
40
|
|
|
43
41
|
|
|
44
|
-
def _setup_colors(invert: bool):
|
|
42
|
+
def _setup_colors(invert: bool) -> None:
|
|
45
43
|
"""Create COLORS global dict from env vars and invert flag
|
|
46
44
|
|
|
47
45
|
Args:
|
|
@@ -0,0 +1,76 @@
|
|
|
1
|
+
[project]
|
|
2
|
+
name = "marcgrep"
|
|
3
|
+
version = "2.0.2"
|
|
4
|
+
description = "search MARC files for regex matches"
|
|
5
|
+
license = "MIT"
|
|
6
|
+
readme = "readme.md"
|
|
7
|
+
keywords = [
|
|
8
|
+
"marc",
|
|
9
|
+
"grep",
|
|
10
|
+
"regex",
|
|
11
|
+
"libraries",
|
|
12
|
+
"cli",
|
|
13
|
+
"metadata",
|
|
14
|
+
"bibliographic",
|
|
15
|
+
"cataloging",
|
|
16
|
+
]
|
|
17
|
+
classifiers = [
|
|
18
|
+
"Development Status :: 5 - Production/Stable",
|
|
19
|
+
"Environment :: Console",
|
|
20
|
+
"Programming Language :: Python :: 3",
|
|
21
|
+
"Programming Language :: Python :: 3.10",
|
|
22
|
+
"Programming Language :: Python :: 3.11",
|
|
23
|
+
"Programming Language :: Python :: 3.12",
|
|
24
|
+
"Programming Language :: Python :: 3.13",
|
|
25
|
+
"Operating System :: OS Independent",
|
|
26
|
+
"Topic :: Utilities",
|
|
27
|
+
]
|
|
28
|
+
dependencies = [
|
|
29
|
+
"click==8.5.0",
|
|
30
|
+
"pymarc==5.4.0",
|
|
31
|
+
"termcolor==3.3.0",
|
|
32
|
+
]
|
|
33
|
+
requires-python = ">=3.10"
|
|
34
|
+
|
|
35
|
+
[[project.authors]]
|
|
36
|
+
name = "Eric Phetteplace"
|
|
37
|
+
email = "phette23@gmail.com"
|
|
38
|
+
|
|
39
|
+
[project.scripts]
|
|
40
|
+
marcgrep = "marcgrep.cli:main"
|
|
41
|
+
|
|
42
|
+
[project.urls]
|
|
43
|
+
homepage = "https://github.com/phette23/marcgreppy"
|
|
44
|
+
issues = "https://github.com/phette23/marcgreppy/issues"
|
|
45
|
+
repository = "https://github.com/phette23/marcgreppy"
|
|
46
|
+
|
|
47
|
+
[dependency-groups]
|
|
48
|
+
dev = [
|
|
49
|
+
"pytest==9.2.0",
|
|
50
|
+
"ruff>=0.17.3",
|
|
51
|
+
]
|
|
52
|
+
|
|
53
|
+
[tool.setuptools.packages.find]
|
|
54
|
+
where = ["marcgrep"]
|
|
55
|
+
|
|
56
|
+
[tool.uv.build-backend]
|
|
57
|
+
module-name = "marcgrep"
|
|
58
|
+
module-root = ""
|
|
59
|
+
|
|
60
|
+
[tool.ruff.lint]
|
|
61
|
+
select = [
|
|
62
|
+
"A",
|
|
63
|
+
"B",
|
|
64
|
+
"F",
|
|
65
|
+
"I",
|
|
66
|
+
"UP",
|
|
67
|
+
"S",
|
|
68
|
+
"SIM",
|
|
69
|
+
]
|
|
70
|
+
|
|
71
|
+
[tool.ruff.lint.per-file-ignores]
|
|
72
|
+
"**/test*.py" = ["S"]
|
|
73
|
+
|
|
74
|
+
[build-system]
|
|
75
|
+
requires = ["uv_build<=0.13.5"]
|
|
76
|
+
build-backend = "uv_build"
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
[project]
|
|
2
2
|
name = "marcgrep"
|
|
3
|
-
version = "2.0.
|
|
3
|
+
version = "2.0.2"
|
|
4
4
|
description = "search MARC files for regex matches"
|
|
5
5
|
authors = [{name = "Eric Phetteplace", email = "phette23@gmail.com"}]
|
|
6
6
|
license = "MIT"
|
|
@@ -18,15 +18,16 @@ classifiers = [
|
|
|
18
18
|
"Topic :: Utilities",
|
|
19
19
|
]
|
|
20
20
|
dependencies = [
|
|
21
|
-
"click==8.
|
|
22
|
-
"pymarc==5.
|
|
23
|
-
"termcolor==3.3.0"
|
|
21
|
+
"click==8.5.0",
|
|
22
|
+
"pymarc==5.4.0",
|
|
23
|
+
"termcolor==3.3.0",
|
|
24
24
|
]
|
|
25
25
|
requires-python = ">=3.10"
|
|
26
26
|
|
|
27
27
|
[dependency-groups]
|
|
28
28
|
dev = [
|
|
29
|
-
"pytest==9.0
|
|
29
|
+
"pytest==9.2.0",
|
|
30
|
+
"ruff>=0.17.3",
|
|
30
31
|
]
|
|
31
32
|
|
|
32
33
|
[project.scripts]
|
|
@@ -45,5 +46,13 @@ module-name = "marcgrep"
|
|
|
45
46
|
module-root = ""
|
|
46
47
|
|
|
47
48
|
[build-system]
|
|
48
|
-
requires = ["uv_build"]
|
|
49
|
+
requires = ["uv_build<=0.13.5"]
|
|
49
50
|
build-backend = "uv_build"
|
|
51
|
+
|
|
52
|
+
[tool.ruff.lint]
|
|
53
|
+
# Bugbear, Pyflakes, import sorting, syntax upgrades, security, simplicity
|
|
54
|
+
select = ["A", "B", "F", "I", "UP", "S", "SIM"]
|
|
55
|
+
|
|
56
|
+
[tool.ruff.lint.per-file-ignores]
|
|
57
|
+
# Allow `assert` statements in test files
|
|
58
|
+
"**/test*.py" = ["S"]
|
|
@@ -90,10 +90,12 @@ You can also configure the subfield delimiter character and the symbol for an em
|
|
|
90
90
|
```sh
|
|
91
91
|
uv sync # install dependencies
|
|
92
92
|
uv run pytest # run tests
|
|
93
|
+
uv run ruff format . # format code
|
|
94
|
+
uv run ruff check . # lint code
|
|
93
95
|
uv build # build package, used in CI
|
|
94
96
|
```
|
|
95
97
|
|
|
96
|
-
Any tag triggers a release to [Test PyPI](https://test.pypi.org/project/marcgrep/). Any tag beginning with the letter `v` requires manual approval to be released to [PyPI](https://pypi.org/project/marcgrep/) and [GitHub](https://github.com/phette23/marcgreppy/releases). There are protection rules on the `pypi` and `testpypi` [environments](https://github.com/phette23/marcgreppy/settings/environments) to this effect, too.
|
|
98
|
+
Any tag triggers a release to [Test PyPI](https://test.pypi.org/project/marcgrep/). Any tag beginning with the letter `v` requires manual approval to be released to [PyPI](https://pypi.org/project/marcgrep/) and [GitHub](https://github.com/phette23/marcgreppy/releases). **Remember to increment the version in pyproject.toml** or the PYPI publish will fail. There are protection rules on the `pypi` and `testpypi` [environments](https://github.com/phette23/marcgreppy/settings/environments) to this effect, too.
|
|
97
99
|
|
|
98
100
|
## License
|
|
99
101
|
|
|
File without changes
|
|
File without changes
|