bib-optimizer 0.4.1__tar.gz → 0.4.3__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.
- {bib_optimizer-0.4.1/src/bib_optimizer.egg-info → bib_optimizer-0.4.3}/PKG-INFO +70 -14
- {bib_optimizer-0.4.1 → bib_optimizer-0.4.3}/README.md +67 -12
- {bib_optimizer-0.4.1 → bib_optimizer-0.4.3}/pyproject.toml +5 -6
- bib_optimizer-0.4.3/src/bib_optimizer/__init__.py +2 -0
- {bib_optimizer-0.4.1 → bib_optimizer-0.4.3}/src/bib_optimizer/__main__.py +1 -2
- {bib_optimizer-0.4.1 → bib_optimizer-0.4.3}/src/bib_optimizer/helpers.py +2 -2
- {bib_optimizer-0.4.1 → bib_optimizer-0.4.3/src/bib_optimizer.egg-info}/PKG-INFO +70 -14
- {bib_optimizer-0.4.1 → bib_optimizer-0.4.3}/src/bib_optimizer.egg-info/SOURCES.txt +0 -2
- {bib_optimizer-0.4.1 → bib_optimizer-0.4.3}/src/bib_optimizer.egg-info/requires.txt +1 -1
- bib_optimizer-0.4.1/MANIFEST.in +0 -0
- bib_optimizer-0.4.1/src/bib_optimizer/__init__.py +0 -2
- bib_optimizer-0.4.1/src/bib_optimizer/helpers_old.py +0 -37
- {bib_optimizer-0.4.1 → bib_optimizer-0.4.3}/LICENSE +0 -0
- {bib_optimizer-0.4.1 → bib_optimizer-0.4.3}/setup.cfg +0 -0
- {bib_optimizer-0.4.1 → bib_optimizer-0.4.3}/src/bib_optimizer.egg-info/dependency_links.txt +0 -0
- {bib_optimizer-0.4.1 → bib_optimizer-0.4.3}/src/bib_optimizer.egg-info/entry_points.txt +0 -0
- {bib_optimizer-0.4.1 → bib_optimizer-0.4.3}/src/bib_optimizer.egg-info/top_level.txt +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: bib_optimizer
|
|
3
|
-
Version: 0.4.
|
|
3
|
+
Version: 0.4.3
|
|
4
4
|
Summary: Clean and optimize bib file.
|
|
5
5
|
Author-email: Ka Wa Yip <yipkawa@gmail.com>
|
|
6
6
|
License: MIT License
|
|
@@ -37,10 +37,11 @@ Classifier: Programming Language :: Python :: 3.10
|
|
|
37
37
|
Classifier: Programming Language :: Python :: 3.11
|
|
38
38
|
Classifier: Programming Language :: Python :: 3.12
|
|
39
39
|
Classifier: Programming Language :: Python :: 3.13
|
|
40
|
+
Classifier: Programming Language :: Python :: 3.14
|
|
40
41
|
Requires-Python: >=3.8
|
|
41
42
|
Description-Content-Type: text/markdown
|
|
42
43
|
License-File: LICENSE
|
|
43
|
-
Requires-Dist: bibtexparser
|
|
44
|
+
Requires-Dist: bibtexparser<2,>=1.4.3
|
|
44
45
|
Provides-Extra: build
|
|
45
46
|
Requires-Dist: build; extra == "build"
|
|
46
47
|
Requires-Dist: twine; extra == "build"
|
|
@@ -89,16 +90,58 @@ These input files will **remain unchanged**.
|
|
|
89
90
|
Installation
|
|
90
91
|
------------
|
|
91
92
|
|
|
92
|
-
|
|
93
|
-
|
|
93
|
+
### Install from PyPI with pip
|
|
94
94
|
|
|
95
|
-
|
|
95
|
+
Create and activate a virtual environment, then install the latest release from PyPI:
|
|
96
96
|
|
|
97
|
-
|
|
97
|
+
```bash
|
|
98
|
+
python -m venv .venv
|
|
98
99
|
|
|
99
|
-
|
|
100
|
+
# Linux/macOS
|
|
101
|
+
source .venv/bin/activate
|
|
102
|
+
|
|
103
|
+
# Windows
|
|
104
|
+
.venv\Scripts\activate
|
|
105
|
+
|
|
106
|
+
python -m pip install --upgrade bib_optimizer
|
|
107
|
+
```
|
|
108
|
+
|
|
109
|
+
Alternatively, install the command in an isolated environment with [uv](https://docs.astral.sh/uv/):
|
|
110
|
+
|
|
111
|
+
```bash
|
|
112
|
+
uv tool install bib_optimizer
|
|
113
|
+
```
|
|
114
|
+
|
|
115
|
+
After either installation method, the `bibopt` command is available in your terminal.
|
|
116
|
+
|
|
117
|
+
### Install from source for development
|
|
118
|
+
|
|
119
|
+
This repository uses uv for project and dependency management.
|
|
120
|
+
|
|
121
|
+
1. **Clone the repository**
|
|
122
|
+
|
|
123
|
+
```bash
|
|
124
|
+
git clone https://github.com/kwyip/bib_optimizer.git
|
|
125
|
+
cd bib_optimizer
|
|
126
|
+
```
|
|
127
|
+
|
|
128
|
+
2. **Install environment**
|
|
129
|
+
|
|
130
|
+
```bash
|
|
131
|
+
# This creates the virtual environment and installs all dependencies
|
|
132
|
+
uv sync
|
|
133
|
+
```
|
|
134
|
+
|
|
135
|
+
3. **Activate environment**
|
|
136
|
+
|
|
137
|
+
```bash
|
|
138
|
+
# Linux/MacOS
|
|
139
|
+
source .venv/bin/activate
|
|
140
|
+
|
|
141
|
+
# Windows
|
|
142
|
+
.venv\Scripts\activate
|
|
143
|
+
```
|
|
100
144
|
|
|
101
|
-
|
|
102
145
|
_🐍 This requires Python 3.8 or newer versions_
|
|
103
146
|
|
|
104
147
|
* * *
|
|
@@ -122,20 +165,33 @@ _🐍 This requires Python 3.8 or newer versions_
|
|
|
122
165
|
|
|
123
166
|
You may test the installation using the sample input files (`sample_main.tex` and `sample_ref.bib`) located in the test folder.
|
|
124
167
|
|
|
125
|
-
<img src="https://github.com/kwyip/bib_optimizer/blob/main/sample_main_shot.png?raw=True" alt="sample_main_shot"
|
|
168
|
+
<img src="https://github.com/kwyip/bib_optimizer/blob/main/sample_main_shot.png?raw=True" alt="sample_main_shot" width="34.83%"/> <img src="https://github.com/kwyip/bib_optimizer/blob/main/sample_ref_shot.png?raw=True" alt="sample_ref_shot" width="43%" />
|
|
126
169
|
|
|
127
|
-
|
|
170
|
+
`sample_main.tex` _and_ `sample_ref.bib`
|
|
128
171
|
|
|
129
|
-
<img src="https://github.com/kwyip/bib_optimizer/blob/main/sample_ref_opt_shot.png?raw=True" alt="sample_ref_opt_shot"
|
|
172
|
+
<img src="https://github.com/kwyip/bib_optimizer/blob/main/sample_ref_opt_shot.png?raw=True" alt="sample_ref_opt_shot" width="43%" />
|
|
130
173
|
|
|
131
|
-
_A
|
|
174
|
+
_A sample_ `ref_opt.bib` _created after running_ `bibopt sample_main.tex sample_ref.bib ref_opt.bib`
|
|
132
175
|
|
|
133
176
|
---
|
|
134
|
-
#### New feature (version 0.4)
|
|
177
|
+
#### New feature (version 0.4.0)
|
|
135
178
|
|
|
136
179
|
If the `main.tex` calls inputs from other `.tex` (e.g., with `\input{...}`), the newly generated `ref_opt.bib` will preserve the order of appearances in the `main.tex` with each inputted `.tex` as well. \
|
|
137
180
|
(The dependent `.tex` files need to be placed in the same directory as `main.tex`.)
|
|
138
181
|
|
|
139
182
|
---
|
|
183
|
+
#### New feature (version 0.4.1)
|
|
184
|
+
|
|
185
|
+
On top of version 0.4, skip any `\input` `.tex` file if not found.
|
|
186
|
+
|
|
187
|
+
---
|
|
188
|
+
#### New feature/Fix (version 0.4.2)
|
|
189
|
+
|
|
190
|
+
Added support for the `\include{...}` command in addition to `\input{...}`, fixing missing citations when a LaTeX project uses `\include` to split its content across files.
|
|
191
|
+
|
|
192
|
+
---
|
|
193
|
+
#### New feature/Fix (version 0.4.3)
|
|
194
|
+
|
|
195
|
+
Added Python 3.14 support and constrained `bibtexparser` to the compatible 1.x release series, fixing `ModuleNotFoundError: No module named 'bibtexparser.bwriter'` during fresh installations.
|
|
140
196
|
|
|
141
|
-
♥ Lastly executed on Python `3.
|
|
197
|
+
♥ Lastly executed on Python `3.14` on 2026-09-29.
|
|
@@ -35,16 +35,58 @@ These input files will **remain unchanged**.
|
|
|
35
35
|
Installation
|
|
36
36
|
------------
|
|
37
37
|
|
|
38
|
-
|
|
39
|
-
|
|
38
|
+
### Install from PyPI with pip
|
|
40
39
|
|
|
41
|
-
|
|
40
|
+
Create and activate a virtual environment, then install the latest release from PyPI:
|
|
42
41
|
|
|
43
|
-
|
|
42
|
+
```bash
|
|
43
|
+
python -m venv .venv
|
|
44
44
|
|
|
45
|
-
|
|
45
|
+
# Linux/macOS
|
|
46
|
+
source .venv/bin/activate
|
|
47
|
+
|
|
48
|
+
# Windows
|
|
49
|
+
.venv\Scripts\activate
|
|
50
|
+
|
|
51
|
+
python -m pip install --upgrade bib_optimizer
|
|
52
|
+
```
|
|
53
|
+
|
|
54
|
+
Alternatively, install the command in an isolated environment with [uv](https://docs.astral.sh/uv/):
|
|
55
|
+
|
|
56
|
+
```bash
|
|
57
|
+
uv tool install bib_optimizer
|
|
58
|
+
```
|
|
59
|
+
|
|
60
|
+
After either installation method, the `bibopt` command is available in your terminal.
|
|
61
|
+
|
|
62
|
+
### Install from source for development
|
|
63
|
+
|
|
64
|
+
This repository uses uv for project and dependency management.
|
|
65
|
+
|
|
66
|
+
1. **Clone the repository**
|
|
67
|
+
|
|
68
|
+
```bash
|
|
69
|
+
git clone https://github.com/kwyip/bib_optimizer.git
|
|
70
|
+
cd bib_optimizer
|
|
71
|
+
```
|
|
72
|
+
|
|
73
|
+
2. **Install environment**
|
|
74
|
+
|
|
75
|
+
```bash
|
|
76
|
+
# This creates the virtual environment and installs all dependencies
|
|
77
|
+
uv sync
|
|
78
|
+
```
|
|
79
|
+
|
|
80
|
+
3. **Activate environment**
|
|
81
|
+
|
|
82
|
+
```bash
|
|
83
|
+
# Linux/MacOS
|
|
84
|
+
source .venv/bin/activate
|
|
85
|
+
|
|
86
|
+
# Windows
|
|
87
|
+
.venv\Scripts\activate
|
|
88
|
+
```
|
|
46
89
|
|
|
47
|
-
|
|
48
90
|
_🐍 This requires Python 3.8 or newer versions_
|
|
49
91
|
|
|
50
92
|
* * *
|
|
@@ -68,20 +110,33 @@ _🐍 This requires Python 3.8 or newer versions_
|
|
|
68
110
|
|
|
69
111
|
You may test the installation using the sample input files (`sample_main.tex` and `sample_ref.bib`) located in the test folder.
|
|
70
112
|
|
|
71
|
-
<img src="https://github.com/kwyip/bib_optimizer/blob/main/sample_main_shot.png?raw=True" alt="sample_main_shot"
|
|
113
|
+
<img src="https://github.com/kwyip/bib_optimizer/blob/main/sample_main_shot.png?raw=True" alt="sample_main_shot" width="34.83%"/> <img src="https://github.com/kwyip/bib_optimizer/blob/main/sample_ref_shot.png?raw=True" alt="sample_ref_shot" width="43%" />
|
|
72
114
|
|
|
73
|
-
|
|
115
|
+
`sample_main.tex` _and_ `sample_ref.bib`
|
|
74
116
|
|
|
75
|
-
<img src="https://github.com/kwyip/bib_optimizer/blob/main/sample_ref_opt_shot.png?raw=True" alt="sample_ref_opt_shot"
|
|
117
|
+
<img src="https://github.com/kwyip/bib_optimizer/blob/main/sample_ref_opt_shot.png?raw=True" alt="sample_ref_opt_shot" width="43%" />
|
|
76
118
|
|
|
77
|
-
_A
|
|
119
|
+
_A sample_ `ref_opt.bib` _created after running_ `bibopt sample_main.tex sample_ref.bib ref_opt.bib`
|
|
78
120
|
|
|
79
121
|
---
|
|
80
|
-
#### New feature (version 0.4)
|
|
122
|
+
#### New feature (version 0.4.0)
|
|
81
123
|
|
|
82
124
|
If the `main.tex` calls inputs from other `.tex` (e.g., with `\input{...}`), the newly generated `ref_opt.bib` will preserve the order of appearances in the `main.tex` with each inputted `.tex` as well. \
|
|
83
125
|
(The dependent `.tex` files need to be placed in the same directory as `main.tex`.)
|
|
84
126
|
|
|
85
127
|
---
|
|
128
|
+
#### New feature (version 0.4.1)
|
|
129
|
+
|
|
130
|
+
On top of version 0.4, skip any `\input` `.tex` file if not found.
|
|
131
|
+
|
|
132
|
+
---
|
|
133
|
+
#### New feature/Fix (version 0.4.2)
|
|
134
|
+
|
|
135
|
+
Added support for the `\include{...}` command in addition to `\input{...}`, fixing missing citations when a LaTeX project uses `\include` to split its content across files.
|
|
136
|
+
|
|
137
|
+
---
|
|
138
|
+
#### New feature/Fix (version 0.4.3)
|
|
139
|
+
|
|
140
|
+
Added Python 3.14 support and constrained `bibtexparser` to the compatible 1.x release series, fixing `ModuleNotFoundError: No module named 'bibtexparser.bwriter'` during fresh installations.
|
|
86
141
|
|
|
87
|
-
♥ Lastly executed on Python `3.
|
|
142
|
+
♥ Lastly executed on Python `3.14` on 2026-09-29.
|
|
@@ -6,7 +6,7 @@ build-backend = "setuptools.build_meta"
|
|
|
6
6
|
|
|
7
7
|
[project]
|
|
8
8
|
name = "bib_optimizer"
|
|
9
|
-
version = "0.4.
|
|
9
|
+
version = "0.4.3"
|
|
10
10
|
description = "Clean and optimize bib file."
|
|
11
11
|
authors = [
|
|
12
12
|
{ name="Ka Wa Yip", email="yipkawa@gmail.com" },
|
|
@@ -14,7 +14,7 @@ authors = [
|
|
|
14
14
|
license = { file = "LICENSE" }
|
|
15
15
|
readme = "README.md"
|
|
16
16
|
requires-python = ">=3.8"
|
|
17
|
-
dependencies = ["bibtexparser>=1.4.3"]
|
|
17
|
+
dependencies = ["bibtexparser>=1.4.3,<2"]
|
|
18
18
|
classifiers = [
|
|
19
19
|
"License :: OSI Approved :: MIT License",
|
|
20
20
|
"Programming Language :: Python",
|
|
@@ -24,7 +24,8 @@ classifiers = [
|
|
|
24
24
|
"Programming Language :: Python :: 3.10",
|
|
25
25
|
"Programming Language :: Python :: 3.11",
|
|
26
26
|
"Programming Language :: Python :: 3.12",
|
|
27
|
-
"Programming Language :: Python :: 3.13"
|
|
27
|
+
"Programming Language :: Python :: 3.13",
|
|
28
|
+
"Programming Language :: Python :: 3.14"
|
|
28
29
|
]
|
|
29
30
|
keywords = ["latex", "bib", "bibliography"]
|
|
30
31
|
|
|
@@ -40,7 +41,7 @@ dev = ["black", "bumpver", "isort", "mypy", "pytest"]
|
|
|
40
41
|
bibopt = "bib_optimizer.__main__:main"
|
|
41
42
|
|
|
42
43
|
[tool.bumpver]
|
|
43
|
-
current_version = "0.4.
|
|
44
|
+
current_version = "0.4.3"
|
|
44
45
|
version_pattern = "MAJOR.MINOR.PATCH"
|
|
45
46
|
commit_message = "bump version {old_version} -> {new_version}"
|
|
46
47
|
commit = true
|
|
@@ -61,5 +62,3 @@ import_heading_stdlib = "Standard library imports"
|
|
|
61
62
|
import_heading_thirdparty = "Third party imports"
|
|
62
63
|
import_heading_firstparty = "Reader imports"
|
|
63
64
|
|
|
64
|
-
|
|
65
|
-
|
|
@@ -25,11 +25,11 @@ def bib_opt(filename, input_bib, output_bib):
|
|
|
25
25
|
all_keys = []
|
|
26
26
|
temp_citations = set()
|
|
27
27
|
|
|
28
|
-
split_pattern = r'(.*?)(\\input[^\n]*\n)(.*?)((?=\\input)|\Z)'
|
|
28
|
+
split_pattern = r'(.*?)(\\(?:input|include)[^\n]*\n)(.*?)((?=\\(?:input|include))|\Z)'
|
|
29
29
|
matches = re.findall(split_pattern, filecontent, flags=re.DOTALL)
|
|
30
30
|
split_results = [(before, after.strip()) for before, input_line, after, _ in matches]
|
|
31
31
|
|
|
32
|
-
input_pattern_extended = r'\\input\s*(?:{([^}]+)}|([^\s\n]+))'
|
|
32
|
+
input_pattern_extended = r'\\(?:input|include)\s*(?:{([^}]+)}|([^\s\n]+))'
|
|
33
33
|
matches = re.findall(input_pattern_extended, filecontent)
|
|
34
34
|
input_files_extended = [m[0] if m[0] else m[1] for m in matches]
|
|
35
35
|
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: bib_optimizer
|
|
3
|
-
Version: 0.4.
|
|
3
|
+
Version: 0.4.3
|
|
4
4
|
Summary: Clean and optimize bib file.
|
|
5
5
|
Author-email: Ka Wa Yip <yipkawa@gmail.com>
|
|
6
6
|
License: MIT License
|
|
@@ -37,10 +37,11 @@ Classifier: Programming Language :: Python :: 3.10
|
|
|
37
37
|
Classifier: Programming Language :: Python :: 3.11
|
|
38
38
|
Classifier: Programming Language :: Python :: 3.12
|
|
39
39
|
Classifier: Programming Language :: Python :: 3.13
|
|
40
|
+
Classifier: Programming Language :: Python :: 3.14
|
|
40
41
|
Requires-Python: >=3.8
|
|
41
42
|
Description-Content-Type: text/markdown
|
|
42
43
|
License-File: LICENSE
|
|
43
|
-
Requires-Dist: bibtexparser
|
|
44
|
+
Requires-Dist: bibtexparser<2,>=1.4.3
|
|
44
45
|
Provides-Extra: build
|
|
45
46
|
Requires-Dist: build; extra == "build"
|
|
46
47
|
Requires-Dist: twine; extra == "build"
|
|
@@ -89,16 +90,58 @@ These input files will **remain unchanged**.
|
|
|
89
90
|
Installation
|
|
90
91
|
------------
|
|
91
92
|
|
|
92
|
-
|
|
93
|
-
|
|
93
|
+
### Install from PyPI with pip
|
|
94
94
|
|
|
95
|
-
|
|
95
|
+
Create and activate a virtual environment, then install the latest release from PyPI:
|
|
96
96
|
|
|
97
|
-
|
|
97
|
+
```bash
|
|
98
|
+
python -m venv .venv
|
|
98
99
|
|
|
99
|
-
|
|
100
|
+
# Linux/macOS
|
|
101
|
+
source .venv/bin/activate
|
|
102
|
+
|
|
103
|
+
# Windows
|
|
104
|
+
.venv\Scripts\activate
|
|
105
|
+
|
|
106
|
+
python -m pip install --upgrade bib_optimizer
|
|
107
|
+
```
|
|
108
|
+
|
|
109
|
+
Alternatively, install the command in an isolated environment with [uv](https://docs.astral.sh/uv/):
|
|
110
|
+
|
|
111
|
+
```bash
|
|
112
|
+
uv tool install bib_optimizer
|
|
113
|
+
```
|
|
114
|
+
|
|
115
|
+
After either installation method, the `bibopt` command is available in your terminal.
|
|
116
|
+
|
|
117
|
+
### Install from source for development
|
|
118
|
+
|
|
119
|
+
This repository uses uv for project and dependency management.
|
|
120
|
+
|
|
121
|
+
1. **Clone the repository**
|
|
122
|
+
|
|
123
|
+
```bash
|
|
124
|
+
git clone https://github.com/kwyip/bib_optimizer.git
|
|
125
|
+
cd bib_optimizer
|
|
126
|
+
```
|
|
127
|
+
|
|
128
|
+
2. **Install environment**
|
|
129
|
+
|
|
130
|
+
```bash
|
|
131
|
+
# This creates the virtual environment and installs all dependencies
|
|
132
|
+
uv sync
|
|
133
|
+
```
|
|
134
|
+
|
|
135
|
+
3. **Activate environment**
|
|
136
|
+
|
|
137
|
+
```bash
|
|
138
|
+
# Linux/MacOS
|
|
139
|
+
source .venv/bin/activate
|
|
140
|
+
|
|
141
|
+
# Windows
|
|
142
|
+
.venv\Scripts\activate
|
|
143
|
+
```
|
|
100
144
|
|
|
101
|
-
|
|
102
145
|
_🐍 This requires Python 3.8 or newer versions_
|
|
103
146
|
|
|
104
147
|
* * *
|
|
@@ -122,20 +165,33 @@ _🐍 This requires Python 3.8 or newer versions_
|
|
|
122
165
|
|
|
123
166
|
You may test the installation using the sample input files (`sample_main.tex` and `sample_ref.bib`) located in the test folder.
|
|
124
167
|
|
|
125
|
-
<img src="https://github.com/kwyip/bib_optimizer/blob/main/sample_main_shot.png?raw=True" alt="sample_main_shot"
|
|
168
|
+
<img src="https://github.com/kwyip/bib_optimizer/blob/main/sample_main_shot.png?raw=True" alt="sample_main_shot" width="34.83%"/> <img src="https://github.com/kwyip/bib_optimizer/blob/main/sample_ref_shot.png?raw=True" alt="sample_ref_shot" width="43%" />
|
|
126
169
|
|
|
127
|
-
|
|
170
|
+
`sample_main.tex` _and_ `sample_ref.bib`
|
|
128
171
|
|
|
129
|
-
<img src="https://github.com/kwyip/bib_optimizer/blob/main/sample_ref_opt_shot.png?raw=True" alt="sample_ref_opt_shot"
|
|
172
|
+
<img src="https://github.com/kwyip/bib_optimizer/blob/main/sample_ref_opt_shot.png?raw=True" alt="sample_ref_opt_shot" width="43%" />
|
|
130
173
|
|
|
131
|
-
_A
|
|
174
|
+
_A sample_ `ref_opt.bib` _created after running_ `bibopt sample_main.tex sample_ref.bib ref_opt.bib`
|
|
132
175
|
|
|
133
176
|
---
|
|
134
|
-
#### New feature (version 0.4)
|
|
177
|
+
#### New feature (version 0.4.0)
|
|
135
178
|
|
|
136
179
|
If the `main.tex` calls inputs from other `.tex` (e.g., with `\input{...}`), the newly generated `ref_opt.bib` will preserve the order of appearances in the `main.tex` with each inputted `.tex` as well. \
|
|
137
180
|
(The dependent `.tex` files need to be placed in the same directory as `main.tex`.)
|
|
138
181
|
|
|
139
182
|
---
|
|
183
|
+
#### New feature (version 0.4.1)
|
|
184
|
+
|
|
185
|
+
On top of version 0.4, skip any `\input` `.tex` file if not found.
|
|
186
|
+
|
|
187
|
+
---
|
|
188
|
+
#### New feature/Fix (version 0.4.2)
|
|
189
|
+
|
|
190
|
+
Added support for the `\include{...}` command in addition to `\input{...}`, fixing missing citations when a LaTeX project uses `\include` to split its content across files.
|
|
191
|
+
|
|
192
|
+
---
|
|
193
|
+
#### New feature/Fix (version 0.4.3)
|
|
194
|
+
|
|
195
|
+
Added Python 3.14 support and constrained `bibtexparser` to the compatible 1.x release series, fixing `ModuleNotFoundError: No module named 'bibtexparser.bwriter'` during fresh installations.
|
|
140
196
|
|
|
141
|
-
♥ Lastly executed on Python `3.
|
|
197
|
+
♥ Lastly executed on Python `3.14` on 2026-09-29.
|
|
@@ -1,11 +1,9 @@
|
|
|
1
1
|
LICENSE
|
|
2
|
-
MANIFEST.in
|
|
3
2
|
README.md
|
|
4
3
|
pyproject.toml
|
|
5
4
|
src/bib_optimizer/__init__.py
|
|
6
5
|
src/bib_optimizer/__main__.py
|
|
7
6
|
src/bib_optimizer/helpers.py
|
|
8
|
-
src/bib_optimizer/helpers_old.py
|
|
9
7
|
src/bib_optimizer.egg-info/PKG-INFO
|
|
10
8
|
src/bib_optimizer.egg-info/SOURCES.txt
|
|
11
9
|
src/bib_optimizer.egg-info/dependency_links.txt
|
bib_optimizer-0.4.1/MANIFEST.in
DELETED
|
File without changes
|
|
@@ -1,37 +0,0 @@
|
|
|
1
|
-
import bibtexparser
|
|
2
|
-
import re
|
|
3
|
-
from bibtexparser.bwriter import BibTexWriter
|
|
4
|
-
|
|
5
|
-
def bib_opt(filename, input_bib, output_bib):
|
|
6
|
-
with open(filename, 'r', encoding='utf-8') as file:
|
|
7
|
-
filecontent = file.read()
|
|
8
|
-
|
|
9
|
-
with open(input_bib, 'r', encoding='utf-8') as bibfile:
|
|
10
|
-
bib_database = bibtexparser.load(bibfile)
|
|
11
|
-
|
|
12
|
-
allowed_keys = []
|
|
13
|
-
all_keys = []
|
|
14
|
-
temp_citations = set()
|
|
15
|
-
|
|
16
|
-
for e in re.findall(r'\\cite[tp]?\{([^}]+)\}', filecontent):
|
|
17
|
-
for c in e.split(','):
|
|
18
|
-
c = c.strip()
|
|
19
|
-
if c not in temp_citations:
|
|
20
|
-
all_keys.append(c)
|
|
21
|
-
temp_citations.add(c)
|
|
22
|
-
|
|
23
|
-
for k in all_keys:
|
|
24
|
-
allowed_keys.append(k)
|
|
25
|
-
|
|
26
|
-
entry_dict = {entry.get('ID'): entry for entry in bib_database.entries}
|
|
27
|
-
filtered_entries = [entry_dict[key] for key in allowed_keys if key in entry_dict]
|
|
28
|
-
|
|
29
|
-
writer = BibTexWriter()
|
|
30
|
-
writer.indent = ' '
|
|
31
|
-
writer.order_entries_by = None
|
|
32
|
-
|
|
33
|
-
new_bib_database = bibtexparser.bibdatabase.BibDatabase()
|
|
34
|
-
new_bib_database.entries = filtered_entries
|
|
35
|
-
|
|
36
|
-
with open(output_bib, 'w', encoding='utf-8') as bibfile:
|
|
37
|
-
bibfile.write(writer.write(new_bib_database))
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|