audioarxiv 0.1.1rc56.post1__py3-none-any.whl → 0.1.2__py3-none-any.whl
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.
- audioarxiv/__init__.py +6 -6
- audioarxiv/audio/base.py +1 -0
- audioarxiv/resources/paper.py +3 -0
- audioarxiv/tools/main.py +31 -33
- {audioarxiv-0.1.1rc56.post1.dist-info → audioarxiv-0.1.2.dist-info}/METADATA +18 -3
- audioarxiv-0.1.2.dist-info/RECORD +15 -0
- {audioarxiv-0.1.1rc56.post1.dist-info → audioarxiv-0.1.2.dist-info}/licenses/LICENSE +1 -1
- audioarxiv-0.1.1rc56.post1.dist-info/RECORD +0 -15
- {audioarxiv-0.1.1rc56.post1.dist-info → audioarxiv-0.1.2.dist-info}/WHEEL +0 -0
- {audioarxiv-0.1.1rc56.post1.dist-info → audioarxiv-0.1.2.dist-info}/entry_points.txt +0 -0
audioarxiv/__init__.py
CHANGED
@@ -24,7 +24,7 @@ from pandas import DataFrame
|
|
24
24
|
|
25
25
|
from . import audio, preprocess, resources
|
26
26
|
|
27
|
-
__version__ = "0.1.
|
27
|
+
__version__ = "0.1.2"
|
28
28
|
|
29
29
|
|
30
30
|
def get_version_information() -> str:
|
@@ -111,11 +111,11 @@ def env_package_list(as_dataframe: bool = False) -> list | DataFrame:
|
|
111
111
|
|
112
112
|
Returns:
|
113
113
|
Union[list, DataFrame]:
|
114
|
-
|
115
|
-
|
116
|
-
|
117
|
-
|
118
|
-
|
114
|
+
If ``as_dataframe=False`` is given, the output is a `list` of `dict`,
|
115
|
+
one for each package, at least with ``'name'`` and ``'version'`` keys
|
116
|
+
(more if `conda` is used).
|
117
|
+
If ``as_dataframe=True`` is given, the output is a `DataFrame`
|
118
|
+
created from the `list` of `dicts`.
|
119
119
|
"""
|
120
120
|
prefix = sys.prefix
|
121
121
|
pkgs = []
|
audioarxiv/audio/base.py
CHANGED
@@ -43,6 +43,7 @@ def validate_audio_arguments(rate: float, volume: float, voice: int | str | None
|
|
43
43
|
logger.error('Invalid voice ID = %s. Keeping current voice.', voice)
|
44
44
|
elif voice is not None:
|
45
45
|
logger.error('Unsupported datatype of voice = %s. It must be either int or str.', type(voice))
|
46
|
+
voice = None
|
46
47
|
if pause_seconds < 0:
|
47
48
|
pause_seconds = 0.1
|
48
49
|
logger.error('pause = %s must be non-negative. Keeping the current pause.', pause_seconds)
|
audioarxiv/resources/paper.py
CHANGED
@@ -172,6 +172,9 @@ class Paper:
|
|
172
172
|
list: A list of sections. Each section is a dict with the header as the key and the content as the value.
|
173
173
|
"""
|
174
174
|
if len(self._sections) == 0:
|
175
|
+
if self.paper is None:
|
176
|
+
logger.error('Paper is None. Cannot download PDF.')
|
177
|
+
return self._sections
|
175
178
|
with tempfile.NamedTemporaryFile() as tmp:
|
176
179
|
filename = tmp.name
|
177
180
|
self.download_pdf(filename=filename)
|
audioarxiv/tools/main.py
CHANGED
@@ -57,7 +57,6 @@ def initialize_configuration(args: configargparse.Namespace) -> tuple:
|
|
57
57
|
os.makedirs(config_dir, exist_ok=True)
|
58
58
|
config_file = 'config.json'
|
59
59
|
config_path = os.path.join(config_dir, config_file)
|
60
|
-
|
61
60
|
# Default settings.
|
62
61
|
settings = {
|
63
62
|
'audio': {
|
@@ -159,36 +158,35 @@ def main():
|
|
159
158
|
paper = Paper(**settings['paper'])
|
160
159
|
|
161
160
|
# Search the paper.
|
162
|
-
|
163
|
-
|
164
|
-
|
165
|
-
|
166
|
-
|
167
|
-
|
168
|
-
|
169
|
-
|
170
|
-
|
171
|
-
|
172
|
-
|
173
|
-
|
174
|
-
|
175
|
-
|
176
|
-
|
177
|
-
|
178
|
-
|
179
|
-
|
161
|
+
# Print the information
|
162
|
+
logger.info('Configuration file: %s', config_path)
|
163
|
+
logger.info('Audio settings')
|
164
|
+
for key, value in settings['audio'].items():
|
165
|
+
logger.info('%s: %s', key, value)
|
166
|
+
|
167
|
+
logger.info('Paper settings')
|
168
|
+
for key, value in settings['paper'].items():
|
169
|
+
logger.info('%s: %s', key, value)
|
170
|
+
|
171
|
+
logger.info('Searching arxiv: %s...', args.id)
|
172
|
+
paper.search_by_arxiv_id(arxiv_id=args.id)
|
173
|
+
# Get the sections
|
174
|
+
sections = paper.sections
|
175
|
+
if args.output is None:
|
176
|
+
for section in sections:
|
177
|
+
audio.read_article(section['header'])
|
178
|
+
time.sleep(1)
|
179
|
+
for content in section['content']:
|
180
|
+
audio.read_article(content)
|
180
181
|
time.sleep(1)
|
181
|
-
|
182
|
-
|
183
|
-
|
184
|
-
|
185
|
-
|
186
|
-
|
187
|
-
|
188
|
-
|
189
|
-
|
190
|
-
|
191
|
-
|
192
|
-
logger.info('Saving audio...')
|
193
|
-
audio.save_article(filename=args.output, article=article)
|
194
|
-
logger.info('Audio is saved to %s.', args.output)
|
182
|
+
else:
|
183
|
+
article = []
|
184
|
+
for section in sections:
|
185
|
+
if section['header'] is not None:
|
186
|
+
article.append(section['header'])
|
187
|
+
if section['content'] is not None:
|
188
|
+
article += section['content']
|
189
|
+
article = " ".join(article)
|
190
|
+
logger.info('Saving audio...')
|
191
|
+
audio.save_article(filename=args.output, article=article)
|
192
|
+
logger.info('Audio is saved to %s.', args.output)
|
@@ -1,12 +1,12 @@
|
|
1
1
|
Metadata-Version: 2.4
|
2
2
|
Name: audioarxiv
|
3
|
-
Version: 0.1.
|
3
|
+
Version: 0.1.2
|
4
4
|
Summary: Turn arXiv papers into audio. audioarxiv lets you fetch the research papers from arXiv and read them aloud.
|
5
5
|
Author-email: "Isaac C. F. Wong" <isaac.cf.wong@gmail.com>
|
6
6
|
Requires-Python: >=3.9
|
7
7
|
Description-Content-Type: text/markdown
|
8
8
|
Classifier: Development Status :: 3 - Alpha
|
9
|
-
Classifier: Intended Audience ::
|
9
|
+
Classifier: Intended Audience :: Science/Research
|
10
10
|
Classifier: License :: OSI Approved :: MIT License
|
11
11
|
Classifier: Programming Language :: Python :: 3 :: Only
|
12
12
|
Classifier: Programming Language :: Python :: 3.9
|
@@ -22,6 +22,10 @@ Requires-Dist: sympy
|
|
22
22
|
Requires-Dist: nltk
|
23
23
|
Requires-Dist: pandas
|
24
24
|
Requires-Dist: platformdirs
|
25
|
+
Requires-Dist: pytest ; extra == "dev"
|
26
|
+
Requires-Dist: pre-commit ; extra == "dev"
|
27
|
+
Requires-Dist: black ; extra == "dev"
|
28
|
+
Requires-Dist: flake8 ; extra == "dev"
|
25
29
|
Requires-Dist: pyspark>=3.0.0 ; extra == "spark"
|
26
30
|
Requires-Dist: bandit[toml]==1.8.3 ; extra == "test"
|
27
31
|
Requires-Dist: black==25.1.0 ; extra == "test"
|
@@ -45,6 +49,7 @@ Project-URL: Homepage, https://github.com/isaac-cf-wong/audioarxiv
|
|
45
49
|
Project-URL: Release Notes, https://github.com/isaac-cf-wong/audioarxiv/releases
|
46
50
|
Project-URL: Source, https://github.com/isaac-cf-wong/audioarxiv
|
47
51
|
Project-URL: Tracker, https://github.com/isaac-cf-wong/audioarxiv/issues
|
52
|
+
Provides-Extra: dev
|
48
53
|
Provides-Extra: spark
|
49
54
|
Provides-Extra: test
|
50
55
|
|
@@ -114,5 +119,15 @@ The settings are saved, so you only need to provide your preferred settings once
|
|
114
119
|
|
115
120
|
## Contributing
|
116
121
|
|
117
|
-
|
122
|
+
Contributions and suggestions are welcome! Whether it's fixing bugs, improving documentation, or adding new features, your help is appreciated.
|
123
|
+
|
124
|
+
Please read our [Code of Conduct](CODE_OF_CONDUCT.md) before contributing.
|
125
|
+
|
126
|
+
To get started:
|
127
|
+
|
128
|
+
- Fork the repository
|
129
|
+
- Create a new branch for your changes
|
130
|
+
- Submit a pull request
|
131
|
+
|
132
|
+
If you're unsure where to begin, feel free to open an issue or ask for guidance!
|
118
133
|
|
@@ -0,0 +1,15 @@
|
|
1
|
+
audioarxiv/__init__.py,sha256=Mp9dcQGEY0QWnkMlD4MoPz45BLjDSOp5v96m8ZXwda0,5816
|
2
|
+
audioarxiv/audio/__init__.py,sha256=UZx3AkhC8NZFXwQbW_sU4sQ1uGeEIRXCPDghXvZy8rY,214
|
3
|
+
audioarxiv/audio/base.py,sha256=LLZGciBbFeaGlRqt_VF58RWOSKDZevks4U2SpWAk1To,6005
|
4
|
+
audioarxiv/preprocess/__init__.py,sha256=NUCDDLpSwpWTBaPNdLWUVK2FhtwMPsFvXczTE21_UvU,338
|
5
|
+
audioarxiv/preprocess/article.py,sha256=d9nV2DEH4mvKsgUpJ3WB256rt8k5O7YvNTBUp5YOUbs,394
|
6
|
+
audioarxiv/preprocess/math_equation.py,sha256=ulkeMZFJKxU8BH1QzNyW4BZ-UjWfDDMp1C-cqoRGyls,945
|
7
|
+
audioarxiv/resources/__init__.py,sha256=KCZm9Hq0O9oCCtfpyKVDGo_qX-PU2qS8aJe1NgvmR7Q,166
|
8
|
+
audioarxiv/resources/paper.py,sha256=o6DD4KrcypjH810ArDzD93uBkdpKUNvnErIUJUZ3J9s,7302
|
9
|
+
audioarxiv/tools/__init__.py,sha256=7X5vtxzvCY9URWo0p3zvM11J6whGFeDPF7XU0dt1Qcw,28
|
10
|
+
audioarxiv/tools/main.py,sha256=n5Q22HTktaxPv1C1Z7HxkN2OJqi9F6QxSWbnzqZ448E,6735
|
11
|
+
audioarxiv-0.1.2.dist-info/entry_points.txt,sha256=d_K6uTNuC8-f9XUQ_enFBgssiK2lVV57EHCEloriVY4,57
|
12
|
+
audioarxiv-0.1.2.dist-info/licenses/LICENSE,sha256=EaCbwfO894O6p0QwcO_sgtKCIEWxfBS0fhybH9sURk8,1140
|
13
|
+
audioarxiv-0.1.2.dist-info/WHEEL,sha256=G2gURzTEtmeR8nrdXUJfNiB3VYVxigPQ-bEQujpNiNs,82
|
14
|
+
audioarxiv-0.1.2.dist-info/METADATA,sha256=zI482AWs0OUlYlhMonZELnSxe5RNpruDyi7Jedyj9IU,5210
|
15
|
+
audioarxiv-0.1.2.dist-info/RECORD,,
|
@@ -1,15 +0,0 @@
|
|
1
|
-
audioarxiv/__init__.py,sha256=NitAtYpjQ2X_VB-5hX7qDpyw4VCLfpV1qMCPdTJpbu0,5807
|
2
|
-
audioarxiv/audio/__init__.py,sha256=UZx3AkhC8NZFXwQbW_sU4sQ1uGeEIRXCPDghXvZy8rY,214
|
3
|
-
audioarxiv/audio/base.py,sha256=tQOby6-12r5lInbAQChMxsQNSQT7_od4_tZ7G8hsDKE,5984
|
4
|
-
audioarxiv/preprocess/__init__.py,sha256=NUCDDLpSwpWTBaPNdLWUVK2FhtwMPsFvXczTE21_UvU,338
|
5
|
-
audioarxiv/preprocess/article.py,sha256=d9nV2DEH4mvKsgUpJ3WB256rt8k5O7YvNTBUp5YOUbs,394
|
6
|
-
audioarxiv/preprocess/math_equation.py,sha256=ulkeMZFJKxU8BH1QzNyW4BZ-UjWfDDMp1C-cqoRGyls,945
|
7
|
-
audioarxiv/resources/__init__.py,sha256=KCZm9Hq0O9oCCtfpyKVDGo_qX-PU2qS8aJe1NgvmR7Q,166
|
8
|
-
audioarxiv/resources/paper.py,sha256=s9XT3xuzntR_0_Np29F66muou0q409jocD4sU2dtgDM,7161
|
9
|
-
audioarxiv/tools/__init__.py,sha256=7X5vtxzvCY9URWo0p3zvM11J6whGFeDPF7XU0dt1Qcw,28
|
10
|
-
audioarxiv/tools/main.py,sha256=sAh7izIdGmfQZiI3tBKn-zLMhQgAQvLGu4OmYnYLsAc,6884
|
11
|
-
audioarxiv-0.1.1rc56.post1.dist-info/entry_points.txt,sha256=d_K6uTNuC8-f9XUQ_enFBgssiK2lVV57EHCEloriVY4,57
|
12
|
-
audioarxiv-0.1.1rc56.post1.dist-info/licenses/LICENSE,sha256=ws_MuBL-SCEBqPBFl9_FqZkaaydIJmxHrJG2parhU4M,1141
|
13
|
-
audioarxiv-0.1.1rc56.post1.dist-info/WHEEL,sha256=G2gURzTEtmeR8nrdXUJfNiB3VYVxigPQ-bEQujpNiNs,82
|
14
|
-
audioarxiv-0.1.1rc56.post1.dist-info/METADATA,sha256=UvpJ-tny5iNHwmYtLYcYbYw78rYIVwTUZ6NN-LWpvQ0,4873
|
15
|
-
audioarxiv-0.1.1rc56.post1.dist-info/RECORD,,
|
File without changes
|
File without changes
|