bib-optimizer 0.0.1__tar.gz → 0.3.0__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.3.0/LICENSE +21 -0
- bib_optimizer-0.3.0/PKG-INFO +99 -0
- bib_optimizer-0.3.0/README.md +45 -0
- bib_optimizer-0.3.0/pyproject.toml +65 -0
- bib_optimizer-0.3.0/src/bib_optimizer/__init__.py +2 -0
- bib_optimizer-0.3.0/src/bib_optimizer/__main__.py +24 -0
- bib_optimizer-0.3.0/src/bib_optimizer/helpers.py +37 -0
- bib_optimizer-0.3.0/src/bib_optimizer.egg-info/PKG-INFO +99 -0
- bib_optimizer-0.3.0/src/bib_optimizer.egg-info/SOURCES.txt +13 -0
- bib_optimizer-0.3.0/src/bib_optimizer.egg-info/entry_points.txt +2 -0
- bib_optimizer-0.3.0/src/bib_optimizer.egg-info/requires.txt +12 -0
- bib_optimizer-0.3.0/src/bib_optimizer.egg-info/top_level.txt +1 -0
- bib_optimizer-0.0.1/PKG-INFO +0 -43
- bib_optimizer-0.0.1/README.md +0 -30
- bib_optimizer-0.0.1/bib_optimizer.egg-info/PKG-INFO +0 -43
- bib_optimizer-0.0.1/bib_optimizer.egg-info/SOURCES.txt +0 -7
- bib_optimizer-0.0.1/bib_optimizer.egg-info/top_level.txt +0 -1
- bib_optimizer-0.0.1/pyproject.toml +0 -18
- /bib_optimizer-0.0.1/bib_cleaner/__init__.py → /bib_optimizer-0.3.0/MANIFEST.in +0 -0
- {bib_optimizer-0.0.1 → bib_optimizer-0.3.0}/setup.cfg +0 -0
- {bib_optimizer-0.0.1 → bib_optimizer-0.3.0/src}/bib_optimizer.egg-info/dependency_links.txt +0 -0
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2025 Ka Wa Yip
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
|
@@ -0,0 +1,99 @@
|
|
|
1
|
+
Metadata-Version: 2.4
|
|
2
|
+
Name: bib_optimizer
|
|
3
|
+
Version: 0.3.0
|
|
4
|
+
Summary: Clean and optimize bib file.
|
|
5
|
+
Author-email: Ka Wa Yip <yipkawa@gmail.com>
|
|
6
|
+
License: MIT License
|
|
7
|
+
|
|
8
|
+
Copyright (c) 2025 Ka Wa Yip
|
|
9
|
+
|
|
10
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
11
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
12
|
+
in the Software without restriction, including without limitation the rights
|
|
13
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
14
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
15
|
+
furnished to do so, subject to the following conditions:
|
|
16
|
+
|
|
17
|
+
The above copyright notice and this permission notice shall be included in all
|
|
18
|
+
copies or substantial portions of the Software.
|
|
19
|
+
|
|
20
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
21
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
22
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
23
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
24
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
25
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
26
|
+
SOFTWARE.
|
|
27
|
+
|
|
28
|
+
Project-URL: Homepage, https://github.com/kwyip/bib_optimizer
|
|
29
|
+
Project-URL: Issues, https://github.com/kwyip/bib_optimizer/issues
|
|
30
|
+
Keywords: latex,bib,bibliography
|
|
31
|
+
Classifier: License :: OSI Approved :: MIT License
|
|
32
|
+
Classifier: Programming Language :: Python
|
|
33
|
+
Classifier: Programming Language :: Python :: 3
|
|
34
|
+
Classifier: Programming Language :: Python :: 3.8
|
|
35
|
+
Classifier: Programming Language :: Python :: 3.9
|
|
36
|
+
Classifier: Programming Language :: Python :: 3.10
|
|
37
|
+
Classifier: Programming Language :: Python :: 3.11
|
|
38
|
+
Classifier: Programming Language :: Python :: 3.12
|
|
39
|
+
Classifier: Programming Language :: Python :: 3.13
|
|
40
|
+
Requires-Python: >=3.8
|
|
41
|
+
Description-Content-Type: text/markdown
|
|
42
|
+
License-File: LICENSE
|
|
43
|
+
Requires-Dist: bibtexparser>=1.4.3
|
|
44
|
+
Provides-Extra: build
|
|
45
|
+
Requires-Dist: build; extra == "build"
|
|
46
|
+
Requires-Dist: twine; extra == "build"
|
|
47
|
+
Provides-Extra: dev
|
|
48
|
+
Requires-Dist: black; extra == "dev"
|
|
49
|
+
Requires-Dist: bumpver; extra == "dev"
|
|
50
|
+
Requires-Dist: isort; extra == "dev"
|
|
51
|
+
Requires-Dist: mypy; extra == "dev"
|
|
52
|
+
Requires-Dist: pytest; extra == "dev"
|
|
53
|
+
Dynamic: license-file
|
|
54
|
+
|
|
55
|
+
bib-optimizer
|
|
56
|
+
=============
|
|
57
|
+
|
|
58
|
+
Oh, sure, because who doesn't love manually cleaning up messy `.bib` files? `bib_optimizer.py` heroically steps in to remove those lazy, _unused_ citations and _reorder_ the survivors exactly as they appear in the `.tex` file—because, clearly, chaos is the default setting for bibliographies.
|
|
59
|
+
|
|
60
|
+
In layman's terms, it automates bibliography management by:
|
|
61
|
+
|
|
62
|
+
1. removing unused citations,
|
|
63
|
+
2. reordering the remaining ones to match their order of appearance in the `.tex` file.
|
|
64
|
+
|
|
65
|
+
**Input Files:**
|
|
66
|
+
|
|
67
|
+
* `main.tex` – The LaTeX source file.
|
|
68
|
+
* `ref.bib` – The original bibliography file.
|
|
69
|
+
|
|
70
|
+
These input files will **remain unchanged**.
|
|
71
|
+
|
|
72
|
+
**Output File:**
|
|
73
|
+
|
|
74
|
+
* `ref_opt.bib` – The newly generated, cleaned and ordered bibliography file.
|
|
75
|
+
|
|
76
|
+
* * *
|
|
77
|
+
|
|
78
|
+
Installation
|
|
79
|
+
------------
|
|
80
|
+
|
|
81
|
+
`pip install bib_optimizer`
|
|
82
|
+
or
|
|
83
|
+
`python -m pip install bib_optimizer`
|
|
84
|
+
|
|
85
|
+
_🐍 This requires Python 3.8 or newer versions_
|
|
86
|
+
|
|
87
|
+
* * *
|
|
88
|
+
|
|
89
|
+
### Steps to Clean Your Bibliography
|
|
90
|
+
|
|
91
|
+
1. **Prepare the input files (e.g., by downloading them from Overleaf)**.
|
|
92
|
+
2. **Run the command to generate a new `.bib` file (for example, you may name it `ref_opt.bib`)**:
|
|
93
|
+
`bibopt main.tex ref.bib ref_opt.bib`
|
|
94
|
+
3. **Use the Cleaned Bibliography**
|
|
95
|
+
Replace `ref.bib` with `ref_opt.bib` in your LaTeX project.
|
|
96
|
+
|
|
97
|
+
* * *
|
|
98
|
+
|
|
99
|
+
♥ Lastly executed on Python `3.10` and bibtexparser `1.4.3`
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
bib-optimizer
|
|
2
|
+
=============
|
|
3
|
+
|
|
4
|
+
Oh, sure, because who doesn't love manually cleaning up messy `.bib` files? `bib_optimizer.py` heroically steps in to remove those lazy, _unused_ citations and _reorder_ the survivors exactly as they appear in the `.tex` file—because, clearly, chaos is the default setting for bibliographies.
|
|
5
|
+
|
|
6
|
+
In layman's terms, it automates bibliography management by:
|
|
7
|
+
|
|
8
|
+
1. removing unused citations,
|
|
9
|
+
2. reordering the remaining ones to match their order of appearance in the `.tex` file.
|
|
10
|
+
|
|
11
|
+
**Input Files:**
|
|
12
|
+
|
|
13
|
+
* `main.tex` – The LaTeX source file.
|
|
14
|
+
* `ref.bib` – The original bibliography file.
|
|
15
|
+
|
|
16
|
+
These input files will **remain unchanged**.
|
|
17
|
+
|
|
18
|
+
**Output File:**
|
|
19
|
+
|
|
20
|
+
* `ref_opt.bib` – The newly generated, cleaned and ordered bibliography file.
|
|
21
|
+
|
|
22
|
+
* * *
|
|
23
|
+
|
|
24
|
+
Installation
|
|
25
|
+
------------
|
|
26
|
+
|
|
27
|
+
`pip install bib_optimizer`
|
|
28
|
+
or
|
|
29
|
+
`python -m pip install bib_optimizer`
|
|
30
|
+
|
|
31
|
+
_🐍 This requires Python 3.8 or newer versions_
|
|
32
|
+
|
|
33
|
+
* * *
|
|
34
|
+
|
|
35
|
+
### Steps to Clean Your Bibliography
|
|
36
|
+
|
|
37
|
+
1. **Prepare the input files (e.g., by downloading them from Overleaf)**.
|
|
38
|
+
2. **Run the command to generate a new `.bib` file (for example, you may name it `ref_opt.bib`)**:
|
|
39
|
+
`bibopt main.tex ref.bib ref_opt.bib`
|
|
40
|
+
3. **Use the Cleaned Bibliography**
|
|
41
|
+
Replace `ref.bib` with `ref_opt.bib` in your LaTeX project.
|
|
42
|
+
|
|
43
|
+
* * *
|
|
44
|
+
|
|
45
|
+
♥ Lastly executed on Python `3.10` and bibtexparser `1.4.3`
|
|
@@ -0,0 +1,65 @@
|
|
|
1
|
+
# pyproject.toml
|
|
2
|
+
|
|
3
|
+
[build-system]
|
|
4
|
+
requires = ["setuptools>=75.3.0", "wheel"]
|
|
5
|
+
build-backend = "setuptools.build_meta"
|
|
6
|
+
|
|
7
|
+
[project]
|
|
8
|
+
name = "bib_optimizer"
|
|
9
|
+
version = "0.3.0"
|
|
10
|
+
description = "Clean and optimize bib file."
|
|
11
|
+
authors = [
|
|
12
|
+
{ name="Ka Wa Yip", email="yipkawa@gmail.com" },
|
|
13
|
+
]
|
|
14
|
+
license = { file = "LICENSE" }
|
|
15
|
+
readme = "README.md"
|
|
16
|
+
requires-python = ">=3.8"
|
|
17
|
+
dependencies = ["bibtexparser>=1.4.3"]
|
|
18
|
+
classifiers = [
|
|
19
|
+
"License :: OSI Approved :: MIT License",
|
|
20
|
+
"Programming Language :: Python",
|
|
21
|
+
"Programming Language :: Python :: 3",
|
|
22
|
+
"Programming Language :: Python :: 3.8",
|
|
23
|
+
"Programming Language :: Python :: 3.9",
|
|
24
|
+
"Programming Language :: Python :: 3.10",
|
|
25
|
+
"Programming Language :: Python :: 3.11",
|
|
26
|
+
"Programming Language :: Python :: 3.12",
|
|
27
|
+
"Programming Language :: Python :: 3.13"
|
|
28
|
+
]
|
|
29
|
+
keywords = ["latex", "bib", "bibliography"]
|
|
30
|
+
|
|
31
|
+
[project.urls]
|
|
32
|
+
Homepage = "https://github.com/kwyip/bib_optimizer"
|
|
33
|
+
Issues = "https://github.com/kwyip/bib_optimizer/issues"
|
|
34
|
+
|
|
35
|
+
[project.optional-dependencies]
|
|
36
|
+
build = ["build", "twine"]
|
|
37
|
+
dev = ["black", "bumpver", "isort", "mypy", "pytest"]
|
|
38
|
+
|
|
39
|
+
[project.scripts]
|
|
40
|
+
bibopt = "bib_optimizer.__main__:main"
|
|
41
|
+
|
|
42
|
+
[tool.bumpver]
|
|
43
|
+
current_version = "0.3.0"
|
|
44
|
+
version_pattern = "MAJOR.MINOR.PATCH"
|
|
45
|
+
commit_message = "bump version {old_version} -> {new_version}"
|
|
46
|
+
commit = true
|
|
47
|
+
tag = true
|
|
48
|
+
push = false
|
|
49
|
+
|
|
50
|
+
[tool.bumpver.file_patterns]
|
|
51
|
+
"pyproject.toml" = [
|
|
52
|
+
'current_version = "{version}"',
|
|
53
|
+
'version = "{version}"',
|
|
54
|
+
]
|
|
55
|
+
"src/bib_optimizer/__init__.py" = ["{version}"]
|
|
56
|
+
"src/bib_optimizer/__main__.py" = ["- bib_optimizer v{version}"]
|
|
57
|
+
|
|
58
|
+
[tool.isort]
|
|
59
|
+
profile = "black"
|
|
60
|
+
import_heading_stdlib = "Standard library imports"
|
|
61
|
+
import_heading_thirdparty = "Third party imports"
|
|
62
|
+
import_heading_firstparty = "Reader imports"
|
|
63
|
+
|
|
64
|
+
|
|
65
|
+
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
"""Version:
|
|
2
|
+
--------
|
|
3
|
+
|
|
4
|
+
- bib_optimizer v0.3.0
|
|
5
|
+
"""
|
|
6
|
+
import sys
|
|
7
|
+
from bib_optimizer import helpers
|
|
8
|
+
|
|
9
|
+
def main():
|
|
10
|
+
if len(sys.argv[1:]) != 3:
|
|
11
|
+
raise Exception("Sorry, please input three files: your tex filename, bib filename, and the desired new bib filename")
|
|
12
|
+
tex = sys.argv[1:][0]
|
|
13
|
+
old_bib = sys.argv[1:][1]
|
|
14
|
+
new_bib = sys.argv[1:][2]
|
|
15
|
+
|
|
16
|
+
helpers.bib_opt(tex, old_bib, new_bib)
|
|
17
|
+
|
|
18
|
+
|
|
19
|
+
|
|
20
|
+
if __name__ == '__main__':
|
|
21
|
+
main()
|
|
22
|
+
|
|
23
|
+
|
|
24
|
+
|
|
@@ -0,0 +1,37 @@
|
|
|
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))
|
|
@@ -0,0 +1,99 @@
|
|
|
1
|
+
Metadata-Version: 2.4
|
|
2
|
+
Name: bib_optimizer
|
|
3
|
+
Version: 0.3.0
|
|
4
|
+
Summary: Clean and optimize bib file.
|
|
5
|
+
Author-email: Ka Wa Yip <yipkawa@gmail.com>
|
|
6
|
+
License: MIT License
|
|
7
|
+
|
|
8
|
+
Copyright (c) 2025 Ka Wa Yip
|
|
9
|
+
|
|
10
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
11
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
12
|
+
in the Software without restriction, including without limitation the rights
|
|
13
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
14
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
15
|
+
furnished to do so, subject to the following conditions:
|
|
16
|
+
|
|
17
|
+
The above copyright notice and this permission notice shall be included in all
|
|
18
|
+
copies or substantial portions of the Software.
|
|
19
|
+
|
|
20
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
21
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
22
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
23
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
24
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
25
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
26
|
+
SOFTWARE.
|
|
27
|
+
|
|
28
|
+
Project-URL: Homepage, https://github.com/kwyip/bib_optimizer
|
|
29
|
+
Project-URL: Issues, https://github.com/kwyip/bib_optimizer/issues
|
|
30
|
+
Keywords: latex,bib,bibliography
|
|
31
|
+
Classifier: License :: OSI Approved :: MIT License
|
|
32
|
+
Classifier: Programming Language :: Python
|
|
33
|
+
Classifier: Programming Language :: Python :: 3
|
|
34
|
+
Classifier: Programming Language :: Python :: 3.8
|
|
35
|
+
Classifier: Programming Language :: Python :: 3.9
|
|
36
|
+
Classifier: Programming Language :: Python :: 3.10
|
|
37
|
+
Classifier: Programming Language :: Python :: 3.11
|
|
38
|
+
Classifier: Programming Language :: Python :: 3.12
|
|
39
|
+
Classifier: Programming Language :: Python :: 3.13
|
|
40
|
+
Requires-Python: >=3.8
|
|
41
|
+
Description-Content-Type: text/markdown
|
|
42
|
+
License-File: LICENSE
|
|
43
|
+
Requires-Dist: bibtexparser>=1.4.3
|
|
44
|
+
Provides-Extra: build
|
|
45
|
+
Requires-Dist: build; extra == "build"
|
|
46
|
+
Requires-Dist: twine; extra == "build"
|
|
47
|
+
Provides-Extra: dev
|
|
48
|
+
Requires-Dist: black; extra == "dev"
|
|
49
|
+
Requires-Dist: bumpver; extra == "dev"
|
|
50
|
+
Requires-Dist: isort; extra == "dev"
|
|
51
|
+
Requires-Dist: mypy; extra == "dev"
|
|
52
|
+
Requires-Dist: pytest; extra == "dev"
|
|
53
|
+
Dynamic: license-file
|
|
54
|
+
|
|
55
|
+
bib-optimizer
|
|
56
|
+
=============
|
|
57
|
+
|
|
58
|
+
Oh, sure, because who doesn't love manually cleaning up messy `.bib` files? `bib_optimizer.py` heroically steps in to remove those lazy, _unused_ citations and _reorder_ the survivors exactly as they appear in the `.tex` file—because, clearly, chaos is the default setting for bibliographies.
|
|
59
|
+
|
|
60
|
+
In layman's terms, it automates bibliography management by:
|
|
61
|
+
|
|
62
|
+
1. removing unused citations,
|
|
63
|
+
2. reordering the remaining ones to match their order of appearance in the `.tex` file.
|
|
64
|
+
|
|
65
|
+
**Input Files:**
|
|
66
|
+
|
|
67
|
+
* `main.tex` – The LaTeX source file.
|
|
68
|
+
* `ref.bib` – The original bibliography file.
|
|
69
|
+
|
|
70
|
+
These input files will **remain unchanged**.
|
|
71
|
+
|
|
72
|
+
**Output File:**
|
|
73
|
+
|
|
74
|
+
* `ref_opt.bib` – The newly generated, cleaned and ordered bibliography file.
|
|
75
|
+
|
|
76
|
+
* * *
|
|
77
|
+
|
|
78
|
+
Installation
|
|
79
|
+
------------
|
|
80
|
+
|
|
81
|
+
`pip install bib_optimizer`
|
|
82
|
+
or
|
|
83
|
+
`python -m pip install bib_optimizer`
|
|
84
|
+
|
|
85
|
+
_🐍 This requires Python 3.8 or newer versions_
|
|
86
|
+
|
|
87
|
+
* * *
|
|
88
|
+
|
|
89
|
+
### Steps to Clean Your Bibliography
|
|
90
|
+
|
|
91
|
+
1. **Prepare the input files (e.g., by downloading them from Overleaf)**.
|
|
92
|
+
2. **Run the command to generate a new `.bib` file (for example, you may name it `ref_opt.bib`)**:
|
|
93
|
+
`bibopt main.tex ref.bib ref_opt.bib`
|
|
94
|
+
3. **Use the Cleaned Bibliography**
|
|
95
|
+
Replace `ref.bib` with `ref_opt.bib` in your LaTeX project.
|
|
96
|
+
|
|
97
|
+
* * *
|
|
98
|
+
|
|
99
|
+
♥ Lastly executed on Python `3.10` and bibtexparser `1.4.3`
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
LICENSE
|
|
2
|
+
MANIFEST.in
|
|
3
|
+
README.md
|
|
4
|
+
pyproject.toml
|
|
5
|
+
src/bib_optimizer/__init__.py
|
|
6
|
+
src/bib_optimizer/__main__.py
|
|
7
|
+
src/bib_optimizer/helpers.py
|
|
8
|
+
src/bib_optimizer.egg-info/PKG-INFO
|
|
9
|
+
src/bib_optimizer.egg-info/SOURCES.txt
|
|
10
|
+
src/bib_optimizer.egg-info/dependency_links.txt
|
|
11
|
+
src/bib_optimizer.egg-info/entry_points.txt
|
|
12
|
+
src/bib_optimizer.egg-info/requires.txt
|
|
13
|
+
src/bib_optimizer.egg-info/top_level.txt
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
bib_optimizer
|
bib_optimizer-0.0.1/PKG-INFO
DELETED
|
@@ -1,43 +0,0 @@
|
|
|
1
|
-
Metadata-Version: 2.4
|
|
2
|
-
Name: bib_optimizer
|
|
3
|
-
Version: 0.0.1
|
|
4
|
-
Summary: bib_cleaner
|
|
5
|
-
Author-email: Ka Wa Yip <yipkawa@gmail.com>
|
|
6
|
-
Project-URL: Homepage, https://github.com/kwyip/bib_optimizer
|
|
7
|
-
Project-URL: Issues, https://github.com/kwyip/bib_optimizer/issues
|
|
8
|
-
Classifier: Programming Language :: Python :: 3
|
|
9
|
-
Classifier: Operating System :: OS Independent
|
|
10
|
-
Classifier: License :: OSI Approved :: MIT License
|
|
11
|
-
Requires-Python: >=3.8
|
|
12
|
-
Description-Content-Type: text/markdown
|
|
13
|
-
|
|
14
|
-
# bib-cleaner
|
|
15
|
-
Oh, sure, because who doesn't love manually cleaning up messy `.bib` files? `bib_cleaner.py` heroically steps in to remove those lazy, *unused* citations and *reorder* the survivors exactly as they appear in the `.tex` file—because, clearly, chaos is the default setting for bibliographies.
|
|
16
|
-
|
|
17
|
-
In layman's terms, it automates bibliography management by removing unused citations and reordering the remaining ones to match their appearance in the `.tex` file.
|
|
18
|
-
|
|
19
|
-
**Input Files:**
|
|
20
|
-
- `main.tex` – The LaTeX source file.
|
|
21
|
-
- `ref.bib` – The original bibliography file.
|
|
22
|
-
|
|
23
|
-
These input files will **remain unchanged**.
|
|
24
|
-
|
|
25
|
-
**Output File:**
|
|
26
|
-
- `ref_clean.bib` – The newly generated, cleaned bibliography file.
|
|
27
|
-
|
|
28
|
-
------------------------------------------------------------------------------
|
|
29
|
-
### Steps to Clean Your Bibliography
|
|
30
|
-
|
|
31
|
-
1. **Install Dependencies**
|
|
32
|
-
```sh
|
|
33
|
-
pip install bibtexparser # Requires Python 3
|
|
34
|
-
2. **Run the Script**
|
|
35
|
-
```sh
|
|
36
|
-
python bib_cleaner.py main.tex ref.bib ref_clean.bib
|
|
37
|
-
3. **Use the Cleaned Bibliography**
|
|
38
|
-
Replace `ref.bib` with `ref_clean.bib` in your LaTeX project.
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
_____________
|
|
43
|
-
Lastly executed on Python `3.10` and bibtexparser `4.3`
|
bib_optimizer-0.0.1/README.md
DELETED
|
@@ -1,30 +0,0 @@
|
|
|
1
|
-
# bib-cleaner
|
|
2
|
-
Oh, sure, because who doesn't love manually cleaning up messy `.bib` files? `bib_cleaner.py` heroically steps in to remove those lazy, *unused* citations and *reorder* the survivors exactly as they appear in the `.tex` file—because, clearly, chaos is the default setting for bibliographies.
|
|
3
|
-
|
|
4
|
-
In layman's terms, it automates bibliography management by removing unused citations and reordering the remaining ones to match their appearance in the `.tex` file.
|
|
5
|
-
|
|
6
|
-
**Input Files:**
|
|
7
|
-
- `main.tex` – The LaTeX source file.
|
|
8
|
-
- `ref.bib` – The original bibliography file.
|
|
9
|
-
|
|
10
|
-
These input files will **remain unchanged**.
|
|
11
|
-
|
|
12
|
-
**Output File:**
|
|
13
|
-
- `ref_clean.bib` – The newly generated, cleaned bibliography file.
|
|
14
|
-
|
|
15
|
-
------------------------------------------------------------------------------
|
|
16
|
-
### Steps to Clean Your Bibliography
|
|
17
|
-
|
|
18
|
-
1. **Install Dependencies**
|
|
19
|
-
```sh
|
|
20
|
-
pip install bibtexparser # Requires Python 3
|
|
21
|
-
2. **Run the Script**
|
|
22
|
-
```sh
|
|
23
|
-
python bib_cleaner.py main.tex ref.bib ref_clean.bib
|
|
24
|
-
3. **Use the Cleaned Bibliography**
|
|
25
|
-
Replace `ref.bib` with `ref_clean.bib` in your LaTeX project.
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
_____________
|
|
30
|
-
Lastly executed on Python `3.10` and bibtexparser `4.3`
|
|
@@ -1,43 +0,0 @@
|
|
|
1
|
-
Metadata-Version: 2.4
|
|
2
|
-
Name: bib_optimizer
|
|
3
|
-
Version: 0.0.1
|
|
4
|
-
Summary: bib_cleaner
|
|
5
|
-
Author-email: Ka Wa Yip <yipkawa@gmail.com>
|
|
6
|
-
Project-URL: Homepage, https://github.com/kwyip/bib_optimizer
|
|
7
|
-
Project-URL: Issues, https://github.com/kwyip/bib_optimizer/issues
|
|
8
|
-
Classifier: Programming Language :: Python :: 3
|
|
9
|
-
Classifier: Operating System :: OS Independent
|
|
10
|
-
Classifier: License :: OSI Approved :: MIT License
|
|
11
|
-
Requires-Python: >=3.8
|
|
12
|
-
Description-Content-Type: text/markdown
|
|
13
|
-
|
|
14
|
-
# bib-cleaner
|
|
15
|
-
Oh, sure, because who doesn't love manually cleaning up messy `.bib` files? `bib_cleaner.py` heroically steps in to remove those lazy, *unused* citations and *reorder* the survivors exactly as they appear in the `.tex` file—because, clearly, chaos is the default setting for bibliographies.
|
|
16
|
-
|
|
17
|
-
In layman's terms, it automates bibliography management by removing unused citations and reordering the remaining ones to match their appearance in the `.tex` file.
|
|
18
|
-
|
|
19
|
-
**Input Files:**
|
|
20
|
-
- `main.tex` – The LaTeX source file.
|
|
21
|
-
- `ref.bib` – The original bibliography file.
|
|
22
|
-
|
|
23
|
-
These input files will **remain unchanged**.
|
|
24
|
-
|
|
25
|
-
**Output File:**
|
|
26
|
-
- `ref_clean.bib` – The newly generated, cleaned bibliography file.
|
|
27
|
-
|
|
28
|
-
------------------------------------------------------------------------------
|
|
29
|
-
### Steps to Clean Your Bibliography
|
|
30
|
-
|
|
31
|
-
1. **Install Dependencies**
|
|
32
|
-
```sh
|
|
33
|
-
pip install bibtexparser # Requires Python 3
|
|
34
|
-
2. **Run the Script**
|
|
35
|
-
```sh
|
|
36
|
-
python bib_cleaner.py main.tex ref.bib ref_clean.bib
|
|
37
|
-
3. **Use the Cleaned Bibliography**
|
|
38
|
-
Replace `ref.bib` with `ref_clean.bib` in your LaTeX project.
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
_____________
|
|
43
|
-
Lastly executed on Python `3.10` and bibtexparser `4.3`
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
bib_cleaner
|
|
@@ -1,18 +0,0 @@
|
|
|
1
|
-
[project]
|
|
2
|
-
name = "bib_optimizer"
|
|
3
|
-
version = "0.0.1"
|
|
4
|
-
authors = [
|
|
5
|
-
{ name="Ka Wa Yip", email="yipkawa@gmail.com" },
|
|
6
|
-
]
|
|
7
|
-
description = "bib_cleaner"
|
|
8
|
-
readme = "README.md"
|
|
9
|
-
requires-python = ">=3.8"
|
|
10
|
-
classifiers = [
|
|
11
|
-
"Programming Language :: Python :: 3",
|
|
12
|
-
"Operating System :: OS Independent",
|
|
13
|
-
"License :: OSI Approved :: MIT License",
|
|
14
|
-
]
|
|
15
|
-
|
|
16
|
-
[project.urls]
|
|
17
|
-
Homepage = "https://github.com/kwyip/bib_optimizer"
|
|
18
|
-
Issues = "https://github.com/kwyip/bib_optimizer/issues"
|
|
File without changes
|
|
File without changes
|
|
File without changes
|