academicflow 0.1.0.dev0__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.
- academicflow-0.1.0.dev0/.gitignore +223 -0
- academicflow-0.1.0.dev0/CHANGELOG.md +11 -0
- academicflow-0.1.0.dev0/LICENSE +21 -0
- academicflow-0.1.0.dev0/PKG-INFO +105 -0
- academicflow-0.1.0.dev0/README.md +57 -0
- academicflow-0.1.0.dev0/pyproject.toml +77 -0
- academicflow-0.1.0.dev0/src/academicflow/__init__.py +43 -0
- academicflow-0.1.0.dev0/src/academicflow/cite/__init__.py +14 -0
- academicflow-0.1.0.dev0/src/academicflow/cite/bib.py +64 -0
- academicflow-0.1.0.dev0/src/academicflow/cite/integrity.py +17 -0
- academicflow-0.1.0.dev0/src/academicflow/cite/render.py +38 -0
- academicflow-0.1.0.dev0/src/academicflow/cite/styles.py +15 -0
- academicflow-0.1.0.dev0/src/academicflow/core/__init__.py +22 -0
- academicflow-0.1.0.dev0/src/academicflow/core/data/stopwords.txt +24 -0
- academicflow-0.1.0.dev0/src/academicflow/core/keywords.py +21 -0
- academicflow-0.1.0.dev0/src/academicflow/core/passive.py +19 -0
- academicflow-0.1.0.dev0/src/academicflow/core/readability.py +57 -0
- academicflow-0.1.0.dev0/src/academicflow/core/text.py +60 -0
- academicflow-0.1.0.dev0/src/academicflow/export/__init__.py +58 -0
- academicflow-0.1.0.dev0/src/academicflow/magics/__init__.py +18 -0
- academicflow-0.1.0.dev0/src/academicflow/magics/display.py +30 -0
- academicflow-0.1.0.dev0/src/academicflow/magics/magics.py +86 -0
- academicflow-0.1.0.dev0/src/academicflow/magics/session.py +49 -0
- academicflow-0.1.0.dev0/src/academicflow/profiles/__init__.py +1 -0
- academicflow-0.1.0.dev0/src/academicflow/profiles/apa.yaml +17 -0
- academicflow-0.1.0.dev0/src/academicflow/profiles/ieee.yaml +13 -0
- academicflow-0.1.0.dev0/src/academicflow/profiles/nature.yaml +13 -0
- academicflow-0.1.0.dev0/src/academicflow/style/__init__.py +12 -0
- academicflow-0.1.0.dev0/src/academicflow/style/data/informal.yaml +5 -0
- academicflow-0.1.0.dev0/src/academicflow/style/profiles.py +52 -0
- academicflow-0.1.0.dev0/src/academicflow/style/rules.py +25 -0
- academicflow-0.1.0.dev0/src/academicflow/style/terminology.py +29 -0
- academicflow-0.1.0.dev0/src/academicflow/summarize/__init__.py +10 -0
- academicflow-0.1.0.dev0/src/academicflow/summarize/extractive.py +38 -0
- academicflow-0.1.0.dev0/src/academicflow/summarize/llm.py +14 -0
- academicflow-0.1.0.dev0/src/academicflow/types.py +51 -0
- academicflow-0.1.0.dev0/tests/test_cite.py +24 -0
- academicflow-0.1.0.dev0/tests/test_core.py +17 -0
- academicflow-0.1.0.dev0/tests/test_export.py +12 -0
- academicflow-0.1.0.dev0/tests/test_magics.py +22 -0
- academicflow-0.1.0.dev0/tests/test_style.py +19 -0
- academicflow-0.1.0.dev0/tests/test_summarize.py +11 -0
|
@@ -0,0 +1,223 @@
|
|
|
1
|
+
# Byte-compiled / optimized / DLL files
|
|
2
|
+
__pycache__/
|
|
3
|
+
*.py[codz]
|
|
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
|
+
share/python-wheels/
|
|
24
|
+
*.egg-info/
|
|
25
|
+
.installed.cfg
|
|
26
|
+
*.egg
|
|
27
|
+
MANIFEST
|
|
28
|
+
|
|
29
|
+
# PyInstaller
|
|
30
|
+
# Usually these files are written by a python script from a template
|
|
31
|
+
# before PyInstaller builds the exe, so as to inject date/other infos into it.
|
|
32
|
+
*.manifest
|
|
33
|
+
*.spec
|
|
34
|
+
|
|
35
|
+
# Installer logs
|
|
36
|
+
pip-log.txt
|
|
37
|
+
pip-delete-this-directory.txt
|
|
38
|
+
|
|
39
|
+
# Unit test / coverage reports
|
|
40
|
+
htmlcov/
|
|
41
|
+
.tox/
|
|
42
|
+
.nox/
|
|
43
|
+
.coverage
|
|
44
|
+
.coverage.*
|
|
45
|
+
.cache
|
|
46
|
+
nosetests.xml
|
|
47
|
+
coverage.xml
|
|
48
|
+
*.cover
|
|
49
|
+
*.py.cover
|
|
50
|
+
*.lcov
|
|
51
|
+
.hypothesis/
|
|
52
|
+
.pytest_cache/
|
|
53
|
+
cover/
|
|
54
|
+
|
|
55
|
+
# Translations
|
|
56
|
+
*.mo
|
|
57
|
+
*.pot
|
|
58
|
+
|
|
59
|
+
# Django stuff:
|
|
60
|
+
*.log
|
|
61
|
+
local_settings.py
|
|
62
|
+
db.sqlite3
|
|
63
|
+
db.sqlite3-journal
|
|
64
|
+
|
|
65
|
+
# Flask stuff:
|
|
66
|
+
instance/
|
|
67
|
+
.webassets-cache
|
|
68
|
+
|
|
69
|
+
# Scrapy stuff:
|
|
70
|
+
.scrapy
|
|
71
|
+
|
|
72
|
+
# Sphinx documentation
|
|
73
|
+
docs/_build/
|
|
74
|
+
|
|
75
|
+
# PyBuilder
|
|
76
|
+
.pybuilder/
|
|
77
|
+
target/
|
|
78
|
+
|
|
79
|
+
# Jupyter Notebook
|
|
80
|
+
.ipynb_checkpoints
|
|
81
|
+
|
|
82
|
+
# IPython
|
|
83
|
+
profile_default/
|
|
84
|
+
ipython_config.py
|
|
85
|
+
|
|
86
|
+
# pyenv
|
|
87
|
+
# For a library or package, you might want to ignore these files since the code is
|
|
88
|
+
# intended to run in multiple environments; otherwise, check them in:
|
|
89
|
+
# .python-version
|
|
90
|
+
|
|
91
|
+
# pipenv
|
|
92
|
+
# According to pypa/pipenv#598, it is recommended to include Pipfile.lock in version control.
|
|
93
|
+
# However, in case of collaboration, if having platform-specific dependencies or dependencies
|
|
94
|
+
# having no cross-platform support, pipenv may install dependencies that don't work, or not
|
|
95
|
+
# install all needed dependencies.
|
|
96
|
+
# Pipfile.lock
|
|
97
|
+
|
|
98
|
+
# uv
|
|
99
|
+
# Similar to Pipfile.lock, it is generally recommended to include uv.lock in version control.
|
|
100
|
+
# This is especially recommended for binary packages to ensure reproducibility, and is more
|
|
101
|
+
# commonly ignored for libraries.
|
|
102
|
+
# uv.lock
|
|
103
|
+
|
|
104
|
+
# poetry
|
|
105
|
+
# Similar to Pipfile.lock, it is generally recommended to include poetry.lock in version control.
|
|
106
|
+
# This is especially recommended for binary packages to ensure reproducibility, and is more
|
|
107
|
+
# commonly ignored for libraries.
|
|
108
|
+
# https://python-poetry.org/docs/basic-usage/#commit-your-poetrylock-file-to-version-control
|
|
109
|
+
# poetry.lock
|
|
110
|
+
# poetry.toml
|
|
111
|
+
|
|
112
|
+
# pdm
|
|
113
|
+
# Similar to Pipfile.lock, it is generally recommended to include pdm.lock in version control.
|
|
114
|
+
# pdm recommends including project-wide configuration in pdm.toml, but excluding .pdm-python.
|
|
115
|
+
# https://pdm-project.org/en/latest/usage/project/#working-with-version-control
|
|
116
|
+
# pdm.lock
|
|
117
|
+
# pdm.toml
|
|
118
|
+
.pdm-python
|
|
119
|
+
.pdm-build/
|
|
120
|
+
|
|
121
|
+
# pixi
|
|
122
|
+
# Similar to Pipfile.lock, it is generally recommended to include pixi.lock in version control.
|
|
123
|
+
# pixi.lock
|
|
124
|
+
# Pixi creates a virtual environment in the .pixi directory, just like venv module creates one
|
|
125
|
+
# in the .venv directory. It is recommended not to include this directory in version control.
|
|
126
|
+
.pixi/*
|
|
127
|
+
!.pixi/config.toml
|
|
128
|
+
|
|
129
|
+
# PEP 582; used by e.g. github.com/David-OConnor/pyflow and github.com/pdm-project/pdm
|
|
130
|
+
__pypackages__/
|
|
131
|
+
|
|
132
|
+
# Celery stuff
|
|
133
|
+
celerybeat-schedule*
|
|
134
|
+
celerybeat.pid
|
|
135
|
+
|
|
136
|
+
# Redis
|
|
137
|
+
*.rdb
|
|
138
|
+
*.aof
|
|
139
|
+
*.pid
|
|
140
|
+
|
|
141
|
+
# RabbitMQ
|
|
142
|
+
mnesia/
|
|
143
|
+
rabbitmq/
|
|
144
|
+
rabbitmq-data/
|
|
145
|
+
|
|
146
|
+
# ActiveMQ
|
|
147
|
+
activemq-data/
|
|
148
|
+
|
|
149
|
+
# SageMath parsed files
|
|
150
|
+
*.sage.py
|
|
151
|
+
|
|
152
|
+
# Environments
|
|
153
|
+
.env
|
|
154
|
+
.envrc
|
|
155
|
+
.venv
|
|
156
|
+
env/
|
|
157
|
+
venv/
|
|
158
|
+
ENV/
|
|
159
|
+
env.bak/
|
|
160
|
+
venv.bak/
|
|
161
|
+
|
|
162
|
+
# Conda environments
|
|
163
|
+
conda-meta/
|
|
164
|
+
|
|
165
|
+
# Spyder project settings
|
|
166
|
+
.spyderproject
|
|
167
|
+
.spyproject
|
|
168
|
+
|
|
169
|
+
# Rope project settings
|
|
170
|
+
.ropeproject
|
|
171
|
+
|
|
172
|
+
# mkdocs/Zensical documentation
|
|
173
|
+
/site
|
|
174
|
+
|
|
175
|
+
# mypy
|
|
176
|
+
.mypy_cache/
|
|
177
|
+
.dmypy.json
|
|
178
|
+
dmypy.json
|
|
179
|
+
|
|
180
|
+
# Pyre type checker
|
|
181
|
+
.pyre/
|
|
182
|
+
|
|
183
|
+
# pytype static type analyzer
|
|
184
|
+
.pytype/
|
|
185
|
+
|
|
186
|
+
# Cython debug symbols
|
|
187
|
+
cython_debug/
|
|
188
|
+
|
|
189
|
+
# PyCharm
|
|
190
|
+
# JetBrains specific template is maintained in a separate JetBrains.gitignore that can
|
|
191
|
+
# be found at https://github.com/github/gitignore/blob/main/Global/JetBrains.gitignore
|
|
192
|
+
# and can be added to the global gitignore or merged into this file. For a more nuclear
|
|
193
|
+
# option (not recommended) you can uncomment the following to ignore the entire idea folder.
|
|
194
|
+
# .idea/
|
|
195
|
+
|
|
196
|
+
# Abstra
|
|
197
|
+
# Abstra is an AI-powered process automation framework.
|
|
198
|
+
# Ignore directories containing user credentials, local state, and settings.
|
|
199
|
+
# Learn more at https://abstra.io/docs
|
|
200
|
+
.abstra/
|
|
201
|
+
|
|
202
|
+
# Visual Studio Code
|
|
203
|
+
# Visual Studio Code specific template is maintained in a separate VisualStudioCode.gitignore that
|
|
204
|
+
# can be found at https://github.com/github/gitignore/blob/main/Global/VisualStudioCode.gitignore
|
|
205
|
+
# and can be added to the global gitignore or merged into this file. However, if you prefer, you
|
|
206
|
+
# could uncomment the following to ignore the entire vscode folder
|
|
207
|
+
# .vscode/
|
|
208
|
+
# Temporary file for partial code execution
|
|
209
|
+
tempCodeRunnerFile.py
|
|
210
|
+
|
|
211
|
+
# Ruff stuff:
|
|
212
|
+
.ruff_cache/
|
|
213
|
+
|
|
214
|
+
# PyPI configuration file
|
|
215
|
+
.pypirc
|
|
216
|
+
|
|
217
|
+
# Marimo
|
|
218
|
+
marimo/_static/
|
|
219
|
+
marimo/_lsp/
|
|
220
|
+
__marimo__/
|
|
221
|
+
|
|
222
|
+
# Streamlit
|
|
223
|
+
.streamlit/secrets.toml
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
# Changelog
|
|
2
|
+
|
|
3
|
+
All notable changes to this project are documented here. Versions follow [Semantic Versioning](https://semver.org/).
|
|
4
|
+
|
|
5
|
+
## [Unreleased]
|
|
6
|
+
|
|
7
|
+
### Added
|
|
8
|
+
- Project skeleton: package layout, shared types (`Issue`, `TextStats`), stub API for every module.
|
|
9
|
+
- `%load_ext academicflow` with `%acite`, `%%academic`, `%astats`, `%acheck`, `%aabstract`, `%aexport`.
|
|
10
|
+
- APA, IEEE and Nature venue profiles (initial).
|
|
11
|
+
- CI (tests on Python 3.9-3.12), PyPI trusted publishing on tags, docs deployment to GitHub Pages.
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026 Zhannur
|
|
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,105 @@
|
|
|
1
|
+
Metadata-Version: 2.5
|
|
2
|
+
Name: academicflow
|
|
3
|
+
Version: 0.1.0.dev0
|
|
4
|
+
Summary: An academic-writing pipeline for Jupyter: text analysis, style checks, BibTeX citations (APA/IEEE/Nature), abstract generation, and LaTeX/Word export.
|
|
5
|
+
Project-URL: Homepage, https://github.com/zhannurkali/academicflow
|
|
6
|
+
Project-URL: Documentation, https://zhannurkali.github.io/academicflow/
|
|
7
|
+
Project-URL: Source, https://github.com/zhannurkali/academicflow
|
|
8
|
+
Project-URL: Issues, https://github.com/zhannurkali/academicflow/issues
|
|
9
|
+
Author: Member 1, Member 2, Member 3, Member 4, Member 5
|
|
10
|
+
License-Expression: MIT
|
|
11
|
+
License-File: LICENSE
|
|
12
|
+
Keywords: academic-writing,bibtex,citations,jupyter,latex,nlp,readability
|
|
13
|
+
Classifier: Development Status :: 3 - Alpha
|
|
14
|
+
Classifier: Framework :: IPython
|
|
15
|
+
Classifier: Framework :: Jupyter
|
|
16
|
+
Classifier: Intended Audience :: Education
|
|
17
|
+
Classifier: Intended Audience :: Science/Research
|
|
18
|
+
Classifier: Operating System :: OS Independent
|
|
19
|
+
Classifier: Programming Language :: Python :: 3
|
|
20
|
+
Classifier: Programming Language :: Python :: 3.10
|
|
21
|
+
Classifier: Programming Language :: Python :: 3.11
|
|
22
|
+
Classifier: Programming Language :: Python :: 3.12
|
|
23
|
+
Classifier: Programming Language :: Python :: 3.13
|
|
24
|
+
Classifier: Topic :: Text Processing :: Linguistic
|
|
25
|
+
Classifier: Topic :: Text Processing :: Markup :: LaTeX
|
|
26
|
+
Requires-Python: >=3.10
|
|
27
|
+
Requires-Dist: ipython>=7.0
|
|
28
|
+
Requires-Dist: nbformat>=5.0
|
|
29
|
+
Requires-Dist: numpy>=1.21
|
|
30
|
+
Requires-Dist: pybtex>=0.24
|
|
31
|
+
Requires-Dist: pypandoc-binary>=1.11
|
|
32
|
+
Requires-Dist: python-docx>=0.8.11
|
|
33
|
+
Requires-Dist: pyyaml>=5.4
|
|
34
|
+
Provides-Extra: all
|
|
35
|
+
Requires-Dist: openai>=1.0; extra == 'all'
|
|
36
|
+
Requires-Dist: spacy>=3.5; extra == 'all'
|
|
37
|
+
Provides-Extra: dev
|
|
38
|
+
Requires-Dist: build>=1.0; extra == 'dev'
|
|
39
|
+
Requires-Dist: mkdocs-material>=9; extra == 'dev'
|
|
40
|
+
Requires-Dist: pytest>=7; extra == 'dev'
|
|
41
|
+
Requires-Dist: ruff>=0.4; extra == 'dev'
|
|
42
|
+
Requires-Dist: twine>=4; extra == 'dev'
|
|
43
|
+
Provides-Extra: llm
|
|
44
|
+
Requires-Dist: openai>=1.0; extra == 'llm'
|
|
45
|
+
Provides-Extra: nlp
|
|
46
|
+
Requires-Dist: spacy>=3.5; extra == 'nlp'
|
|
47
|
+
Description-Content-Type: text/markdown
|
|
48
|
+
|
|
49
|
+
# academicflow
|
|
50
|
+
|
|
51
|
+
[](https://pypi.org/project/academicflow/)
|
|
52
|
+
[](https://pypi.org/project/academicflow/)
|
|
53
|
+
[](https://github.com/zhannurkali/academicflow/actions/workflows/test.yml)
|
|
54
|
+
[](https://zhannurkali.github.io/academicflow/)
|
|
55
|
+
|
|
56
|
+
An academic-writing pipeline for Jupyter notebooks: text analysis, section-aware style checks,
|
|
57
|
+
terminology consistency, BibTeX citations in APA / IEEE / Nature style, abstract generation,
|
|
58
|
+
and one-command export to Word or LaTeX.
|
|
59
|
+
|
|
60
|
+
> Status: early development (4-day team project). APIs may change before 1.0.
|
|
61
|
+
|
|
62
|
+
## Install
|
|
63
|
+
|
|
64
|
+
```bash
|
|
65
|
+
pip install academicflow
|
|
66
|
+
```
|
|
67
|
+
|
|
68
|
+
## Quick start
|
|
69
|
+
|
|
70
|
+
```python
|
|
71
|
+
%load_ext academicflow
|
|
72
|
+
%acite refs.bib
|
|
73
|
+
```
|
|
74
|
+
|
|
75
|
+
```python
|
|
76
|
+
%%academic --style=apa --section=introduction
|
|
77
|
+
Transformers changed natural language processing [@vaswani2017].
|
|
78
|
+
```
|
|
79
|
+
|
|
80
|
+
```python
|
|
81
|
+
%astats # word count, reading time, readability, keywords, passive voice
|
|
82
|
+
%acheck # style + terminology + citation integrity across all sections
|
|
83
|
+
%aabstract # generate an abstract
|
|
84
|
+
%aexport paper.docx # or paper.tex
|
|
85
|
+
```
|
|
86
|
+
|
|
87
|
+
## Documentation
|
|
88
|
+
|
|
89
|
+
https://zhannurkali.github.io/academicflow/
|
|
90
|
+
|
|
91
|
+
## Development
|
|
92
|
+
|
|
93
|
+
```bash
|
|
94
|
+
git clone https://github.com/zhannurkali/academicflow.git
|
|
95
|
+
cd academicflow
|
|
96
|
+
python -m venv .venv && source .venv/bin/activate
|
|
97
|
+
pip install -e ".[dev]"
|
|
98
|
+
ruff check . && pytest
|
|
99
|
+
```
|
|
100
|
+
|
|
101
|
+
Contributors should read [AGENTS.md](AGENTS.md) for the module ownership, API contract and git workflow.
|
|
102
|
+
|
|
103
|
+
## License
|
|
104
|
+
|
|
105
|
+
MIT
|
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
# academicflow
|
|
2
|
+
|
|
3
|
+
[](https://pypi.org/project/academicflow/)
|
|
4
|
+
[](https://pypi.org/project/academicflow/)
|
|
5
|
+
[](https://github.com/zhannurkali/academicflow/actions/workflows/test.yml)
|
|
6
|
+
[](https://zhannurkali.github.io/academicflow/)
|
|
7
|
+
|
|
8
|
+
An academic-writing pipeline for Jupyter notebooks: text analysis, section-aware style checks,
|
|
9
|
+
terminology consistency, BibTeX citations in APA / IEEE / Nature style, abstract generation,
|
|
10
|
+
and one-command export to Word or LaTeX.
|
|
11
|
+
|
|
12
|
+
> Status: early development (4-day team project). APIs may change before 1.0.
|
|
13
|
+
|
|
14
|
+
## Install
|
|
15
|
+
|
|
16
|
+
```bash
|
|
17
|
+
pip install academicflow
|
|
18
|
+
```
|
|
19
|
+
|
|
20
|
+
## Quick start
|
|
21
|
+
|
|
22
|
+
```python
|
|
23
|
+
%load_ext academicflow
|
|
24
|
+
%acite refs.bib
|
|
25
|
+
```
|
|
26
|
+
|
|
27
|
+
```python
|
|
28
|
+
%%academic --style=apa --section=introduction
|
|
29
|
+
Transformers changed natural language processing [@vaswani2017].
|
|
30
|
+
```
|
|
31
|
+
|
|
32
|
+
```python
|
|
33
|
+
%astats # word count, reading time, readability, keywords, passive voice
|
|
34
|
+
%acheck # style + terminology + citation integrity across all sections
|
|
35
|
+
%aabstract # generate an abstract
|
|
36
|
+
%aexport paper.docx # or paper.tex
|
|
37
|
+
```
|
|
38
|
+
|
|
39
|
+
## Documentation
|
|
40
|
+
|
|
41
|
+
https://zhannurkali.github.io/academicflow/
|
|
42
|
+
|
|
43
|
+
## Development
|
|
44
|
+
|
|
45
|
+
```bash
|
|
46
|
+
git clone https://github.com/zhannurkali/academicflow.git
|
|
47
|
+
cd academicflow
|
|
48
|
+
python -m venv .venv && source .venv/bin/activate
|
|
49
|
+
pip install -e ".[dev]"
|
|
50
|
+
ruff check . && pytest
|
|
51
|
+
```
|
|
52
|
+
|
|
53
|
+
Contributors should read [AGENTS.md](AGENTS.md) for the module ownership, API contract and git workflow.
|
|
54
|
+
|
|
55
|
+
## License
|
|
56
|
+
|
|
57
|
+
MIT
|
|
@@ -0,0 +1,77 @@
|
|
|
1
|
+
[build-system]
|
|
2
|
+
requires = ["hatchling>=1.26"]
|
|
3
|
+
build-backend = "hatchling.build"
|
|
4
|
+
|
|
5
|
+
[project]
|
|
6
|
+
name = "academicflow"
|
|
7
|
+
dynamic = ["version"]
|
|
8
|
+
description = "An academic-writing pipeline for Jupyter: text analysis, style checks, BibTeX citations (APA/IEEE/Nature), abstract generation, and LaTeX/Word export."
|
|
9
|
+
readme = "README.md"
|
|
10
|
+
license = "MIT"
|
|
11
|
+
requires-python = ">=3.10"
|
|
12
|
+
# TODO(member 5): replace with the five members' real names
|
|
13
|
+
authors = [
|
|
14
|
+
{ name = "Member 1" },
|
|
15
|
+
{ name = "Member 2" },
|
|
16
|
+
{ name = "Member 3" },
|
|
17
|
+
{ name = "Member 4" },
|
|
18
|
+
{ name = "Member 5" },
|
|
19
|
+
]
|
|
20
|
+
keywords = ["jupyter", "academic-writing", "latex", "bibtex", "citations", "nlp", "readability"]
|
|
21
|
+
classifiers = [
|
|
22
|
+
"Development Status :: 3 - Alpha",
|
|
23
|
+
"Framework :: Jupyter",
|
|
24
|
+
"Framework :: IPython",
|
|
25
|
+
"Intended Audience :: Science/Research",
|
|
26
|
+
"Intended Audience :: Education",
|
|
27
|
+
"Operating System :: OS Independent",
|
|
28
|
+
"Programming Language :: Python :: 3",
|
|
29
|
+
"Programming Language :: Python :: 3.10",
|
|
30
|
+
"Programming Language :: Python :: 3.11",
|
|
31
|
+
"Programming Language :: Python :: 3.12",
|
|
32
|
+
"Programming Language :: Python :: 3.13",
|
|
33
|
+
"Topic :: Text Processing :: Linguistic",
|
|
34
|
+
"Topic :: Text Processing :: Markup :: LaTeX",
|
|
35
|
+
]
|
|
36
|
+
# Base dependencies: lower bounds only, no upper pins (avoids conflicts on JupyterHub).
|
|
37
|
+
dependencies = [
|
|
38
|
+
"pybtex>=0.24",
|
|
39
|
+
"pyyaml>=5.4",
|
|
40
|
+
"ipython>=7.0",
|
|
41
|
+
"nbformat>=5.0",
|
|
42
|
+
"numpy>=1.21",
|
|
43
|
+
"pypandoc_binary>=1.11",
|
|
44
|
+
"python-docx>=0.8.11",
|
|
45
|
+
]
|
|
46
|
+
|
|
47
|
+
[project.optional-dependencies]
|
|
48
|
+
nlp = ["spacy>=3.5"]
|
|
49
|
+
llm = ["openai>=1.0"]
|
|
50
|
+
dev = ["pytest>=7", "ruff>=0.4", "build>=1.0", "twine>=4", "mkdocs-material>=9"]
|
|
51
|
+
all = ["academicflow[nlp,llm]"]
|
|
52
|
+
|
|
53
|
+
[project.urls]
|
|
54
|
+
Homepage = "https://github.com/zhannurkali/academicflow"
|
|
55
|
+
Documentation = "https://zhannurkali.github.io/academicflow/"
|
|
56
|
+
Source = "https://github.com/zhannurkali/academicflow"
|
|
57
|
+
Issues = "https://github.com/zhannurkali/academicflow/issues"
|
|
58
|
+
|
|
59
|
+
[tool.hatch.version]
|
|
60
|
+
path = "src/academicflow/__init__.py"
|
|
61
|
+
|
|
62
|
+
[tool.hatch.build.targets.wheel]
|
|
63
|
+
packages = ["src/academicflow"]
|
|
64
|
+
|
|
65
|
+
[tool.hatch.build.targets.sdist]
|
|
66
|
+
include = ["src/academicflow", "tests", "README.md", "LICENSE", "CHANGELOG.md"]
|
|
67
|
+
|
|
68
|
+
[tool.pytest.ini_options]
|
|
69
|
+
testpaths = ["tests"]
|
|
70
|
+
|
|
71
|
+
[tool.ruff]
|
|
72
|
+
line-length = 100
|
|
73
|
+
target-version = "py310"
|
|
74
|
+
|
|
75
|
+
[tool.ruff.lint]
|
|
76
|
+
select = ["E", "F", "W", "I", "UP", "B"]
|
|
77
|
+
ignore = ["UP007", "UP045"]
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
"""academicflow: an academic-writing pipeline for Jupyter notebooks.
|
|
2
|
+
|
|
3
|
+
Quick start in a notebook::
|
|
4
|
+
|
|
5
|
+
%load_ext academicflow
|
|
6
|
+
%acite refs.bib
|
|
7
|
+
%%academic --style=apa --section=introduction
|
|
8
|
+
Transformers changed NLP [@vaswani2017].
|
|
9
|
+
"""
|
|
10
|
+
|
|
11
|
+
from __future__ import annotations
|
|
12
|
+
|
|
13
|
+
__version__ = "0.1.0.dev0"
|
|
14
|
+
|
|
15
|
+
from academicflow.cite import Bibliography, check_integrity, find_citations, render
|
|
16
|
+
from academicflow.core import analyze
|
|
17
|
+
from academicflow.style import check, check_document, load_profile
|
|
18
|
+
from academicflow.summarize import generate_abstract, summarize
|
|
19
|
+
from academicflow.types import Issue, TextStats
|
|
20
|
+
|
|
21
|
+
__all__ = [
|
|
22
|
+
"__version__",
|
|
23
|
+
"Issue",
|
|
24
|
+
"TextStats",
|
|
25
|
+
"analyze",
|
|
26
|
+
"check",
|
|
27
|
+
"check_document",
|
|
28
|
+
"load_profile",
|
|
29
|
+
"Bibliography",
|
|
30
|
+
"find_citations",
|
|
31
|
+
"render",
|
|
32
|
+
"check_integrity",
|
|
33
|
+
"summarize",
|
|
34
|
+
"generate_abstract",
|
|
35
|
+
"load_ipython_extension",
|
|
36
|
+
]
|
|
37
|
+
|
|
38
|
+
|
|
39
|
+
def load_ipython_extension(ipython): # pragma: no cover - thin wrapper
|
|
40
|
+
"""Enable ``%load_ext academicflow`` (implemented in academicflow.magics)."""
|
|
41
|
+
from academicflow.magics import load_ipython_extension as _load
|
|
42
|
+
|
|
43
|
+
_load(ipython)
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
"""Citation manager: BibTeX parsing, APA/IEEE/Nature formatting, integrity checks.
|
|
2
|
+
|
|
3
|
+
Owner: Member 3.
|
|
4
|
+
"""
|
|
5
|
+
|
|
6
|
+
from __future__ import annotations
|
|
7
|
+
|
|
8
|
+
from academicflow.cite.bib import Bibliography
|
|
9
|
+
from academicflow.cite.integrity import check_integrity
|
|
10
|
+
from academicflow.cite.render import find_citations, render
|
|
11
|
+
|
|
12
|
+
STYLES = ("apa", "ieee", "nature")
|
|
13
|
+
|
|
14
|
+
__all__ = ["Bibliography", "find_citations", "render", "check_integrity", "STYLES"]
|
|
@@ -0,0 +1,64 @@
|
|
|
1
|
+
"""BibTeX loading.
|
|
2
|
+
|
|
3
|
+
Owner: Member 3.
|
|
4
|
+
"""
|
|
5
|
+
|
|
6
|
+
from __future__ import annotations
|
|
7
|
+
|
|
8
|
+
from pathlib import Path
|
|
9
|
+
|
|
10
|
+
|
|
11
|
+
class Bibliography:
|
|
12
|
+
"""A collection of BibTeX entries, keyed by citation key."""
|
|
13
|
+
|
|
14
|
+
def __init__(self, entries: dict[str, dict] | None = None) -> None:
|
|
15
|
+
self.entries: dict[str, dict] = entries or {}
|
|
16
|
+
|
|
17
|
+
@classmethod
|
|
18
|
+
def from_string(cls, bibtex: str) -> Bibliography:
|
|
19
|
+
"""Parse BibTeX source text.
|
|
20
|
+
|
|
21
|
+
TODO(member 3): normalise authors/fields, LaTeX accents, clear errors.
|
|
22
|
+
"""
|
|
23
|
+
from pybtex.database import parse_string
|
|
24
|
+
|
|
25
|
+
data = parse_string(bibtex, "bibtex")
|
|
26
|
+
entries = {}
|
|
27
|
+
for key, entry in data.entries.items():
|
|
28
|
+
fields = {k.lower(): str(v) for k, v in entry.fields.items()}
|
|
29
|
+
authors = [
|
|
30
|
+
(" ".join(p.first_names + p.middle_names), " ".join(p.last_names))
|
|
31
|
+
for p in entry.persons.get("author", [])
|
|
32
|
+
]
|
|
33
|
+
entries[key] = {"type": entry.type, "authors": authors, **fields}
|
|
34
|
+
return cls(entries)
|
|
35
|
+
|
|
36
|
+
@classmethod
|
|
37
|
+
def from_file(cls, path: str | Path) -> Bibliography:
|
|
38
|
+
"""Load a ``.bib`` file."""
|
|
39
|
+
return cls.from_string(Path(path).read_text(encoding="utf-8"))
|
|
40
|
+
|
|
41
|
+
def keys(self) -> list[str]:
|
|
42
|
+
"""Return all citation keys in file order."""
|
|
43
|
+
return list(self.entries)
|
|
44
|
+
|
|
45
|
+
def get(self, key: str) -> dict:
|
|
46
|
+
"""Return the normalised entry for ``key``."""
|
|
47
|
+
if key not in self.entries:
|
|
48
|
+
raise KeyError(f"Citation key {key!r} not found in bibliography")
|
|
49
|
+
return self.entries[key]
|
|
50
|
+
|
|
51
|
+
def format_reference(self, key: str, style: str) -> str:
|
|
52
|
+
"""Format one reference in ``"apa"``, ``"ieee"`` or ``"nature"`` style.
|
|
53
|
+
|
|
54
|
+
TODO(member 3): implement in styles.py.
|
|
55
|
+
"""
|
|
56
|
+
from academicflow.cite.styles import format_entry
|
|
57
|
+
|
|
58
|
+
return format_entry(self.get(key), style)
|
|
59
|
+
|
|
60
|
+
def __contains__(self, key: object) -> bool:
|
|
61
|
+
return key in self.entries
|
|
62
|
+
|
|
63
|
+
def __len__(self) -> int:
|
|
64
|
+
return len(self.entries)
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
"""Citation integrity checks.
|
|
2
|
+
|
|
3
|
+
Owner: Member 3.
|
|
4
|
+
"""
|
|
5
|
+
|
|
6
|
+
from __future__ import annotations
|
|
7
|
+
|
|
8
|
+
from academicflow.cite.bib import Bibliography
|
|
9
|
+
from academicflow.types import Issue
|
|
10
|
+
|
|
11
|
+
|
|
12
|
+
def check_integrity(text: str, bib: Bibliography) -> list[Issue]:
|
|
13
|
+
"""Check citations against the bibliography.
|
|
14
|
+
|
|
15
|
+
TODO(member 3): cite-missing-key, cite-unused, cite-duplicate-doi, cite-incomplete.
|
|
16
|
+
"""
|
|
17
|
+
return []
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
"""Inline citation rendering.
|
|
2
|
+
|
|
3
|
+
Owner: Member 3. Citation syntax is pandoc-style: ``[@key]``, ``[@a; @b]``, ``[@key, p. 12]``.
|
|
4
|
+
"""
|
|
5
|
+
|
|
6
|
+
from __future__ import annotations
|
|
7
|
+
|
|
8
|
+
from academicflow.cite.bib import Bibliography
|
|
9
|
+
|
|
10
|
+
|
|
11
|
+
def find_citations(text: str) -> list[tuple[str, int, int]]:
|
|
12
|
+
"""Find every cited key.
|
|
13
|
+
|
|
14
|
+
Returns:
|
|
15
|
+
``(key, start, end)`` for each key occurrence.
|
|
16
|
+
|
|
17
|
+
TODO(member 3).
|
|
18
|
+
"""
|
|
19
|
+
return []
|
|
20
|
+
|
|
21
|
+
|
|
22
|
+
def render(
|
|
23
|
+
text: str, bib: Bibliography, style: str, target: str = "markdown"
|
|
24
|
+
) -> tuple[str, list[str]]:
|
|
25
|
+
"""Replace citations with formatted inline citations.
|
|
26
|
+
|
|
27
|
+
Args:
|
|
28
|
+
text: Text containing ``[@key]`` citations.
|
|
29
|
+
bib: The bibliography.
|
|
30
|
+
style: ``"apa"``, ``"ieee"`` or ``"nature"``.
|
|
31
|
+
target: ``"markdown"``, ``"pandoc"`` or ``"latex"``.
|
|
32
|
+
|
|
33
|
+
Returns:
|
|
34
|
+
``(rendered_text, ordered_reference_list)``.
|
|
35
|
+
|
|
36
|
+
TODO(member 3).
|
|
37
|
+
"""
|
|
38
|
+
return text, []
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
"""Reference formatters for APA 7, IEEE and Nature.
|
|
2
|
+
|
|
3
|
+
Owner: Member 3.
|
|
4
|
+
"""
|
|
5
|
+
|
|
6
|
+
from __future__ import annotations
|
|
7
|
+
|
|
8
|
+
|
|
9
|
+
def format_entry(entry: dict, style: str) -> str:
|
|
10
|
+
"""Format a normalised entry as a markdown reference string.
|
|
11
|
+
|
|
12
|
+
TODO(member 3): real APA / IEEE / Nature formatting per entry type.
|
|
13
|
+
"""
|
|
14
|
+
authors = ", ".join(last for _, last in entry.get("authors", []))
|
|
15
|
+
return f"{authors} ({entry.get('year', 'n.d.')}). {entry.get('title', '')}."
|