bib-optimizer 0.4.2__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.
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: bib_optimizer
3
- Version: 0.4.2
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>=1.4.3
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
- It can be installed with `pip`, ideally by using a [virtual environment](https://realpython.com/what-is-pip/#using-pip-in-a-python-virtual-environment). Open up a terminal and install the package and the dependencies with:
93
-
93
+ ### Install from PyPI with pip
94
94
 
95
-     `pip install bib_optimizer`
95
+ Create and activate a virtual environment, then install the latest release from PyPI:
96
96
 
97
- _or_
97
+ ```bash
98
+ python -m venv .venv
98
99
 
99
-     `python -m pip install bib_optimizer`
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
  * * *
@@ -142,8 +185,13 @@ If the `main.tex` calls inputs from other `.tex` (e.g., with `\input{...}`), the
142
185
  On top of version 0.4, skip any `\input` `.tex` file if not found.
143
186
 
144
187
  ---
145
- #### New feature (version 0.4.2)
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)
146
194
 
147
- In addition to handling the `\input{...}` command, it also supports the `\include{...}` command.
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.
148
196
 
149
- ♥ Lastly executed on Python `3.10` on 2025-07-14.
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
- It can be installed with `pip`, ideally by using a [virtual environment](https://realpython.com/what-is-pip/#using-pip-in-a-python-virtual-environment). Open up a terminal and install the package and the dependencies with:
39
-
38
+ ### Install from PyPI with pip
40
39
 
41
-     `pip install bib_optimizer`
40
+ Create and activate a virtual environment, then install the latest release from PyPI:
42
41
 
43
- _or_
42
+ ```bash
43
+ python -m venv .venv
44
44
 
45
-     `python -m pip install bib_optimizer`
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
  * * *
@@ -88,8 +130,13 @@ If the `main.tex` calls inputs from other `.tex` (e.g., with `\input{...}`), the
88
130
  On top of version 0.4, skip any `\input` `.tex` file if not found.
89
131
 
90
132
  ---
91
- #### New feature (version 0.4.2)
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)
92
139
 
93
- In addition to handling the `\input{...}` command, it also supports the `\include{...}` command.
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.
94
141
 
95
- ♥ Lastly executed on Python `3.10` on 2025-07-14.
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.2"
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.2"
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
-
@@ -0,0 +1,2 @@
1
+ # Version
2
+ __version__ = "0.4.3"
@@ -1,7 +1,7 @@
1
1
  """Version:
2
2
  --------
3
3
 
4
- - bib_optimizer v0.4.2
4
+ - bib_optimizer v0.4.3
5
5
  """
6
6
  import sys
7
7
  from bib_optimizer import helpers
@@ -21,4 +21,3 @@ if __name__ == '__main__':
21
21
  main()
22
22
 
23
23
 
24
-
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: bib_optimizer
3
- Version: 0.4.2
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>=1.4.3
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
- It can be installed with `pip`, ideally by using a [virtual environment](https://realpython.com/what-is-pip/#using-pip-in-a-python-virtual-environment). Open up a terminal and install the package and the dependencies with:
93
-
93
+ ### Install from PyPI with pip
94
94
 
95
-     `pip install bib_optimizer`
95
+ Create and activate a virtual environment, then install the latest release from PyPI:
96
96
 
97
- _or_
97
+ ```bash
98
+ python -m venv .venv
98
99
 
99
-     `python -m pip install bib_optimizer`
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
  * * *
@@ -142,8 +185,13 @@ If the `main.tex` calls inputs from other `.tex` (e.g., with `\input{...}`), the
142
185
  On top of version 0.4, skip any `\input` `.tex` file if not found.
143
186
 
144
187
  ---
145
- #### New feature (version 0.4.2)
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)
146
194
 
147
- In addition to handling the `\input{...}` command, it also supports the `\include{...}` command.
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.
148
196
 
149
- ♥ Lastly executed on Python `3.10` on 2025-07-14.
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
@@ -1,4 +1,4 @@
1
- bibtexparser>=1.4.3
1
+ bibtexparser<2,>=1.4.3
2
2
 
3
3
  [build]
4
4
  build
File without changes
@@ -1,2 +0,0 @@
1
- # Version
2
- __version__ = "0.4.2"
@@ -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