article-cli 1.0.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.
@@ -0,0 +1,142 @@
1
+ # Byte-compiled / optimized / DLL files
2
+ __pycache__/
3
+ *.py[cod]
4
+ *$py.class
5
+
6
+ # C extensions
7
+ *.so
8
+
9
+ # Distribution / packaging
10
+ .Python
11
+ build/
12
+ develop-eggs/
13
+ dist/
14
+ downloads/
15
+ eggs/
16
+ .eggs/
17
+ lib/
18
+ lib64/
19
+ parts/
20
+ sdist/
21
+ var/
22
+ wheels/
23
+ pip-wheel-metadata/
24
+ share/python-wheels/
25
+ *.egg-info/
26
+ .installed.cfg
27
+ *.egg
28
+ MANIFEST
29
+
30
+ # PyInstaller
31
+ # Usually these files are written by a python script from a template
32
+ # before PyInstaller builds the exe, so as to inject date/other infos into it.
33
+ *.manifest
34
+ *.spec
35
+
36
+ # Installer logs
37
+ pip-log.txt
38
+ pip-delete-this-directory.txt
39
+
40
+ # Unit test / coverage reports
41
+ htmlcov/
42
+ .tox/
43
+ .nox/
44
+ .coverage
45
+ .coverage.*
46
+ .cache
47
+ nosetests.xml
48
+ coverage.xml
49
+ *.cover
50
+ *.py,cover
51
+ .hypothesis/
52
+ .pytest_cache/
53
+
54
+ # Translations
55
+ *.mo
56
+ *.pot
57
+
58
+ # Django stuff:
59
+ *.log
60
+ local_settings.py
61
+ db.sqlite3
62
+ db.sqlite3-journal
63
+
64
+ # Flask stuff:
65
+ instance/
66
+ .webassets-cache
67
+
68
+ # Scrapy stuff:
69
+ .scrapy
70
+
71
+ # Sphinx documentation
72
+ docs/_build/
73
+
74
+ # PyBuilder
75
+ target/
76
+
77
+ # Jupyter Notebook
78
+ .ipynb_checkpoints
79
+
80
+ # IPython
81
+ profile_default/
82
+ ipython_config.py
83
+
84
+ # pyenv
85
+ .python-version
86
+
87
+ # pipenv
88
+ # According to pypa/pipenv#598, it is recommended to include Pipfile.lock in version control.
89
+ # However, in case of collaboration, if having platform-specific dependencies or dependencies
90
+ # having no cross-platform support, pipenv may install dependencies that don't work, or not
91
+ # install all needed dependencies.
92
+ #Pipfile.lock
93
+
94
+ # PEP 582; used by e.g. github.com/David-OConnor/pyflow
95
+ __pypackages__/
96
+
97
+ # Celery stuff
98
+ celerybeat-schedule
99
+ celerybeat.pid
100
+
101
+ # SageMath parsed files
102
+ *.sage.py
103
+
104
+ # Environments
105
+ .env
106
+ .venv
107
+ env/
108
+ venv/
109
+ ENV/
110
+ env.bak/
111
+ venv.bak/
112
+
113
+ # Spyder project settings
114
+ .spyderproject
115
+ .spyproject
116
+
117
+ # Rope project settings
118
+ .ropeproject
119
+
120
+ # mkdocs documentation
121
+ /site
122
+
123
+ # mypy
124
+ .mypy_cache/
125
+ .dmypy.json
126
+ dmypy.json
127
+
128
+ # Pyre type checker
129
+ .pyre/
130
+
131
+ # IDEs
132
+ .vscode/
133
+ .idea/
134
+ *.swp
135
+ *.swo
136
+
137
+ # OS
138
+ .DS_Store
139
+ Thumbs.db
140
+
141
+ # Test configurations
142
+ test-config.toml
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2024 Christophe Prud'homme
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,215 @@
1
+ Metadata-Version: 2.4
2
+ Name: article-cli
3
+ Version: 1.0.0
4
+ Summary: CLI tool for managing LaTeX articles with git integration and Zotero bibliography
5
+ Project-URL: Homepage, https://github.com/feelpp/article.cli
6
+ Project-URL: Documentation, https://github.com/feelpp/article.cli#readme
7
+ Project-URL: Repository, https://github.com/feelpp/article.cli.git
8
+ Project-URL: Issues, https://github.com/feelpp/article.cli/issues
9
+ Author-email: Christophe Prud'homme <prudhomm@cemosis.fr>
10
+ License: MIT License
11
+
12
+ Copyright (c) 2024 Christophe Prud'homme
13
+
14
+ Permission is hereby granted, free of charge, to any person obtaining a copy
15
+ of this software and associated documentation files (the "Software"), to deal
16
+ in the Software without restriction, including without limitation the rights
17
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
18
+ copies of the Software, and to permit persons to whom the Software is
19
+ furnished to do so, subject to the following conditions:
20
+
21
+ The above copyright notice and this permission notice shall be included in all
22
+ copies or substantial portions of the Software.
23
+
24
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
25
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
26
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
27
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
28
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
29
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
30
+ SOFTWARE.
31
+ License-File: LICENSE
32
+ Keywords: academic,bibliography,git,latex,research,zotero
33
+ Classifier: Development Status :: 4 - Beta
34
+ Classifier: Intended Audience :: Science/Research
35
+ Classifier: License :: OSI Approved :: MIT License
36
+ Classifier: Operating System :: OS Independent
37
+ Classifier: Programming Language :: Python :: 3
38
+ Classifier: Programming Language :: Python :: 3.8
39
+ Classifier: Programming Language :: Python :: 3.9
40
+ Classifier: Programming Language :: Python :: 3.10
41
+ Classifier: Programming Language :: Python :: 3.11
42
+ Classifier: Programming Language :: Python :: 3.12
43
+ Classifier: Topic :: Scientific/Engineering
44
+ Classifier: Topic :: Text Processing :: Markup :: LaTeX
45
+ Requires-Python: >=3.8
46
+ Requires-Dist: requests>=2.28.0
47
+ Provides-Extra: dev
48
+ Requires-Dist: black>=23.0; extra == 'dev'
49
+ Requires-Dist: flake8>=6.0; extra == 'dev'
50
+ Requires-Dist: pytest-cov; extra == 'dev'
51
+ Requires-Dist: pytest>=7.0; extra == 'dev'
52
+ Description-Content-Type: text/markdown
53
+
54
+ # Article CLI
55
+
56
+ [![CI](https://github.com/feelpp/article.cli/actions/workflows/ci.yml/badge.svg)](https://github.com/feelpp/article.cli/actions/workflows/ci.yml)
57
+ [![PyPI version](https://badge.fury.io/py/article-cli.svg)](https://badge.fury.io/py/article-cli)
58
+ [![Python Support](https://img.shields.io/pypi/pyversions/article-cli.svg)](https://pypi.org/project/article-cli/)
59
+
60
+ A command-line tool for managing LaTeX articles with git integration and Zotero bibliography synchronization.
61
+
62
+ ## Features
63
+
64
+ - **Git Release Management**: Create, list, and delete releases with gitinfo2 support
65
+ - **Zotero Integration**: Synchronize bibliography from Zotero with robust pagination and error handling
66
+ - **LaTeX Build Management**: Clean build files and manage LaTeX compilation artifacts
67
+ - **Git Hooks Setup**: Automated setup of git hooks for gitinfo2 integration
68
+ - **Local Configuration**: Support for project-specific configuration files
69
+
70
+ ## Installation
71
+
72
+ ### From PyPI (recommended)
73
+
74
+ ```bash
75
+ pip install article-cli
76
+ ```
77
+
78
+ ### From Source
79
+
80
+ ```bash
81
+ git clone https://github.com/feelpp/article.cli.git
82
+ cd article.cli
83
+ pip install -e .
84
+ ```
85
+
86
+ ## Quick Start
87
+
88
+ 1. **Setup git hooks** (run once per repository):
89
+ ```bash
90
+ article-cli setup
91
+ ```
92
+
93
+ 2. **Configure Zotero credentials** (one-time setup):
94
+ ```bash
95
+ export ZOTERO_API_KEY="your_api_key_here"
96
+ export ZOTERO_GROUP_ID="your_group_id" # or ZOTERO_USER_ID
97
+ ```
98
+
99
+ 3. **Update bibliography from Zotero**:
100
+ ```bash
101
+ article-cli update-bibtex
102
+ ```
103
+
104
+ 4. **Create a release**:
105
+ ```bash
106
+ article-cli create v1.0.0
107
+ ```
108
+
109
+ ## Configuration
110
+
111
+ ### Environment Variables
112
+
113
+ - `ZOTERO_API_KEY`: Your Zotero API key (required for bibliography updates)
114
+ - `ZOTERO_USER_ID`: Your Zotero user ID (alternative to group ID)
115
+ - `ZOTERO_GROUP_ID`: Your Zotero group ID (alternative to user ID)
116
+
117
+ ### Local Configuration File
118
+
119
+ Create a `.article-cli.toml` file in your project root for project-specific settings:
120
+
121
+ ```toml
122
+ [zotero]
123
+ api_key = "your_api_key_here"
124
+ group_id = "6219333"
125
+ # user_id = "your_user_id" # alternative to group_id
126
+ output_file = "references.bib"
127
+
128
+ [git]
129
+ auto_push = true
130
+ default_branch = "main"
131
+
132
+ [latex]
133
+ clean_extensions = [".aux", ".bbl", ".blg", ".log", ".out", ".synctex.gz"]
134
+ ```
135
+
136
+ ## Usage
137
+
138
+ ### Git Release Management
139
+
140
+ ```bash
141
+ # Create a new release
142
+ article-cli create v1.2.3
143
+
144
+ # List recent releases
145
+ article-cli list --count 10
146
+
147
+ # Delete a release
148
+ article-cli delete v1.2.3
149
+ ```
150
+
151
+ ### Bibliography Management
152
+
153
+ ```bash
154
+ # Update bibliography from Zotero
155
+ article-cli update-bibtex
156
+
157
+ # Specify custom output file
158
+ article-cli update-bibtex --output my-refs.bib
159
+
160
+ # Skip backup creation
161
+ article-cli update-bibtex --no-backup
162
+ ```
163
+
164
+ ### Project Setup
165
+
166
+ ```bash
167
+ # Setup git hooks for gitinfo2
168
+ article-cli setup
169
+
170
+ # Clean LaTeX build files
171
+ article-cli clean
172
+ ```
173
+
174
+ ### Advanced Usage
175
+
176
+ ```bash
177
+ # Override configuration via command line
178
+ article-cli update-bibtex --api-key YOUR_KEY --group-id YOUR_GROUP
179
+
180
+ # Specify custom configuration file
181
+ article-cli --config custom-config.toml update-bibtex
182
+ ```
183
+
184
+ ## Version Format
185
+
186
+ Release versions must follow the semantic versioning format:
187
+ - `vX.Y.Z` for stable releases (e.g., `v1.2.3`)
188
+ - `vX.Y.Z-pre.N` for pre-releases (e.g., `v1.2.3-pre.1`)
189
+
190
+ ## Requirements
191
+
192
+ - Python 3.8+
193
+ - Git repository with gitinfo2 package (for LaTeX integration)
194
+ - Zotero account with API access (for bibliography features)
195
+
196
+ ## License
197
+
198
+ MIT License - see LICENSE file for details.
199
+
200
+ ## Contributing
201
+
202
+ 1. Fork the repository
203
+ 2. Create a feature branch (`git checkout -b feature/amazing-feature`)
204
+ 3. Commit your changes (`git commit -m 'Add amazing feature'`)
205
+ 4. Push to the branch (`git push origin feature/amazing-feature`)
206
+ 5. Open a Pull Request
207
+
208
+ ## Changelog
209
+
210
+ ### v1.0.0
211
+ - Initial release
212
+ - Git release management
213
+ - Zotero bibliography synchronization
214
+ - LaTeX build file cleanup
215
+ - Configuration file support
@@ -0,0 +1,162 @@
1
+ # Article CLI
2
+
3
+ [![CI](https://github.com/feelpp/article.cli/actions/workflows/ci.yml/badge.svg)](https://github.com/feelpp/article.cli/actions/workflows/ci.yml)
4
+ [![PyPI version](https://badge.fury.io/py/article-cli.svg)](https://badge.fury.io/py/article-cli)
5
+ [![Python Support](https://img.shields.io/pypi/pyversions/article-cli.svg)](https://pypi.org/project/article-cli/)
6
+
7
+ A command-line tool for managing LaTeX articles with git integration and Zotero bibliography synchronization.
8
+
9
+ ## Features
10
+
11
+ - **Git Release Management**: Create, list, and delete releases with gitinfo2 support
12
+ - **Zotero Integration**: Synchronize bibliography from Zotero with robust pagination and error handling
13
+ - **LaTeX Build Management**: Clean build files and manage LaTeX compilation artifacts
14
+ - **Git Hooks Setup**: Automated setup of git hooks for gitinfo2 integration
15
+ - **Local Configuration**: Support for project-specific configuration files
16
+
17
+ ## Installation
18
+
19
+ ### From PyPI (recommended)
20
+
21
+ ```bash
22
+ pip install article-cli
23
+ ```
24
+
25
+ ### From Source
26
+
27
+ ```bash
28
+ git clone https://github.com/feelpp/article.cli.git
29
+ cd article.cli
30
+ pip install -e .
31
+ ```
32
+
33
+ ## Quick Start
34
+
35
+ 1. **Setup git hooks** (run once per repository):
36
+ ```bash
37
+ article-cli setup
38
+ ```
39
+
40
+ 2. **Configure Zotero credentials** (one-time setup):
41
+ ```bash
42
+ export ZOTERO_API_KEY="your_api_key_here"
43
+ export ZOTERO_GROUP_ID="your_group_id" # or ZOTERO_USER_ID
44
+ ```
45
+
46
+ 3. **Update bibliography from Zotero**:
47
+ ```bash
48
+ article-cli update-bibtex
49
+ ```
50
+
51
+ 4. **Create a release**:
52
+ ```bash
53
+ article-cli create v1.0.0
54
+ ```
55
+
56
+ ## Configuration
57
+
58
+ ### Environment Variables
59
+
60
+ - `ZOTERO_API_KEY`: Your Zotero API key (required for bibliography updates)
61
+ - `ZOTERO_USER_ID`: Your Zotero user ID (alternative to group ID)
62
+ - `ZOTERO_GROUP_ID`: Your Zotero group ID (alternative to user ID)
63
+
64
+ ### Local Configuration File
65
+
66
+ Create a `.article-cli.toml` file in your project root for project-specific settings:
67
+
68
+ ```toml
69
+ [zotero]
70
+ api_key = "your_api_key_here"
71
+ group_id = "6219333"
72
+ # user_id = "your_user_id" # alternative to group_id
73
+ output_file = "references.bib"
74
+
75
+ [git]
76
+ auto_push = true
77
+ default_branch = "main"
78
+
79
+ [latex]
80
+ clean_extensions = [".aux", ".bbl", ".blg", ".log", ".out", ".synctex.gz"]
81
+ ```
82
+
83
+ ## Usage
84
+
85
+ ### Git Release Management
86
+
87
+ ```bash
88
+ # Create a new release
89
+ article-cli create v1.2.3
90
+
91
+ # List recent releases
92
+ article-cli list --count 10
93
+
94
+ # Delete a release
95
+ article-cli delete v1.2.3
96
+ ```
97
+
98
+ ### Bibliography Management
99
+
100
+ ```bash
101
+ # Update bibliography from Zotero
102
+ article-cli update-bibtex
103
+
104
+ # Specify custom output file
105
+ article-cli update-bibtex --output my-refs.bib
106
+
107
+ # Skip backup creation
108
+ article-cli update-bibtex --no-backup
109
+ ```
110
+
111
+ ### Project Setup
112
+
113
+ ```bash
114
+ # Setup git hooks for gitinfo2
115
+ article-cli setup
116
+
117
+ # Clean LaTeX build files
118
+ article-cli clean
119
+ ```
120
+
121
+ ### Advanced Usage
122
+
123
+ ```bash
124
+ # Override configuration via command line
125
+ article-cli update-bibtex --api-key YOUR_KEY --group-id YOUR_GROUP
126
+
127
+ # Specify custom configuration file
128
+ article-cli --config custom-config.toml update-bibtex
129
+ ```
130
+
131
+ ## Version Format
132
+
133
+ Release versions must follow the semantic versioning format:
134
+ - `vX.Y.Z` for stable releases (e.g., `v1.2.3`)
135
+ - `vX.Y.Z-pre.N` for pre-releases (e.g., `v1.2.3-pre.1`)
136
+
137
+ ## Requirements
138
+
139
+ - Python 3.8+
140
+ - Git repository with gitinfo2 package (for LaTeX integration)
141
+ - Zotero account with API access (for bibliography features)
142
+
143
+ ## License
144
+
145
+ MIT License - see LICENSE file for details.
146
+
147
+ ## Contributing
148
+
149
+ 1. Fork the repository
150
+ 2. Create a feature branch (`git checkout -b feature/amazing-feature`)
151
+ 3. Commit your changes (`git commit -m 'Add amazing feature'`)
152
+ 4. Push to the branch (`git push origin feature/amazing-feature`)
153
+ 5. Open a Pull Request
154
+
155
+ ## Changelog
156
+
157
+ ### v1.0.0
158
+ - Initial release
159
+ - Git release management
160
+ - Zotero bibliography synchronization
161
+ - LaTeX build file cleanup
162
+ - Configuration file support
@@ -0,0 +1,104 @@
1
+ [build-system]
2
+ requires = ["hatchling"]
3
+ build-backend = "hatchling.build"
4
+
5
+ [project]
6
+ name = "article-cli"
7
+ version = "1.0.0"
8
+ authors = [
9
+ {name = "Christophe Prud'homme", email = "prudhomm@cemosis.fr"},
10
+ ]
11
+ description = "CLI tool for managing LaTeX articles with git integration and Zotero bibliography"
12
+ readme = "README.md"
13
+ license = {file = "LICENSE"}
14
+ requires-python = ">=3.8"
15
+ classifiers = [
16
+ "Development Status :: 4 - Beta",
17
+ "Intended Audience :: Science/Research",
18
+ "License :: OSI Approved :: MIT License",
19
+ "Operating System :: OS Independent",
20
+ "Programming Language :: Python :: 3",
21
+ "Programming Language :: Python :: 3.8",
22
+ "Programming Language :: Python :: 3.9",
23
+ "Programming Language :: Python :: 3.10",
24
+ "Programming Language :: Python :: 3.11",
25
+ "Programming Language :: Python :: 3.12",
26
+ "Topic :: Scientific/Engineering",
27
+ "Topic :: Text Processing :: Markup :: LaTeX",
28
+ ]
29
+ keywords = ["latex", "git", "zotero", "bibliography", "academic", "research"]
30
+ dependencies = [
31
+ "requests>=2.28.0",
32
+ ]
33
+
34
+ [project.optional-dependencies]
35
+ dev = [
36
+ "pytest>=7.0",
37
+ "pytest-cov",
38
+ "black>=23.0",
39
+ "flake8>=6.0",
40
+ ]
41
+
42
+ [project.urls]
43
+ Homepage = "https://github.com/feelpp/article.cli"
44
+ Documentation = "https://github.com/feelpp/article.cli#readme"
45
+ Repository = "https://github.com/feelpp/article.cli.git"
46
+ Issues = "https://github.com/feelpp/article.cli/issues"
47
+
48
+ [project.scripts]
49
+ article-cli = "article_cli.cli:main"
50
+
51
+ [tool.hatch.build.targets.wheel]
52
+ packages = ["src/article_cli"]
53
+
54
+ [tool.hatch.build.targets.sdist]
55
+ include = [
56
+ "/src",
57
+ "/tests",
58
+ "/README.md",
59
+ "/LICENSE",
60
+ ]
61
+
62
+ [tool.black]
63
+ line-length = 88
64
+ target-version = ['py38']
65
+ include = '\.pyi?$'
66
+ extend-exclude = '''
67
+ /(
68
+ # directories
69
+ \.eggs
70
+ | \.git
71
+ | \.hg
72
+ | \.mypy_cache
73
+ | \.tox
74
+ | \.venv
75
+ | build
76
+ | dist
77
+ )/
78
+ '''
79
+
80
+ [tool.mypy]
81
+ python_version = "3.8"
82
+ warn_return_any = true
83
+ warn_unused_configs = true
84
+ disallow_untyped_defs = true
85
+ disallow_incomplete_defs = true
86
+ check_untyped_defs = true
87
+ disallow_untyped_decorators = true
88
+ no_implicit_optional = true
89
+ warn_redundant_casts = true
90
+ warn_unused_ignores = true
91
+ warn_no_return = true
92
+ warn_unreachable = true
93
+ strict_equality = true
94
+
95
+ [tool.pytest.ini_options]
96
+ testpaths = ["tests"]
97
+ python_files = ["test_*.py"]
98
+ python_classes = ["Test*"]
99
+ python_functions = ["test_*"]
100
+ addopts = [
101
+ "--strict-markers",
102
+ "--strict-config",
103
+ "--verbose",
104
+ ]
@@ -0,0 +1,20 @@
1
+ """
2
+ Article CLI - A command-line tool for managing LaTeX articles
3
+
4
+ This package provides tools for:
5
+ - Git release management with gitinfo2 support
6
+ - Zotero bibliography synchronization
7
+ - LaTeX build file cleanup
8
+ - Git hooks setup
9
+ """
10
+
11
+ __version__ = "1.0.0"
12
+ __author__ = "Christophe Prud'homme"
13
+ __email__ = "prudhomm@cemosis.fr"
14
+
15
+ from .cli import main
16
+ from .config import Config
17
+ from .zotero import ZoteroBibTexUpdater
18
+ from .git_manager import GitManager
19
+
20
+ __all__ = ["main", "Config", "ZoteroBibTexUpdater", "GitManager"]
@@ -0,0 +1,8 @@
1
+ """
2
+ Allow running article-cli as a module with python -m article_cli
3
+ """
4
+
5
+ from .cli import main
6
+
7
+ if __name__ == "__main__":
8
+ main()