figshare_client 0.0.2__tar.gz → 0.0.4__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,34 +1,34 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: figshare_client
3
- Version: 0.0.2
3
+ Version: 0.0.4
4
4
  Summary: A client to Figshare
5
5
  Keywords: snekpack,cookiecutter,figshare
6
6
  Author: Charles Tapley Hoyt
7
7
  Author-email: Charles Tapley Hoyt <cthoyt@gmail.com>
8
+ License-Expression: MIT
8
9
  License-File: LICENSE
9
10
  Classifier: Development Status :: 1 - Planning
10
11
  Classifier: Environment :: Console
11
12
  Classifier: Intended Audience :: Developers
12
- Classifier: License :: OSI Approved :: MIT License
13
13
  Classifier: Operating System :: OS Independent
14
14
  Classifier: Framework :: Pytest
15
15
  Classifier: Framework :: tox
16
16
  Classifier: Framework :: Sphinx
17
17
  Classifier: Natural Language :: English
18
18
  Classifier: Programming Language :: Python
19
- Classifier: Programming Language :: Python :: 3.10
20
19
  Classifier: Programming Language :: Python :: 3.11
21
20
  Classifier: Programming Language :: Python :: 3.12
22
21
  Classifier: Programming Language :: Python :: 3.13
23
22
  Classifier: Programming Language :: Python :: 3.14
23
+ Classifier: Programming Language :: Python :: 3.15
24
24
  Classifier: Programming Language :: Python :: 3 :: Only
25
25
  Classifier: Typing :: Typed
26
26
  Requires-Dist: pydantic
27
27
  Requires-Dist: requests
28
- Requires-Dist: pystow
28
+ Requires-Dist: pystow>=0.10.0
29
29
  Maintainer: Charles Tapley Hoyt
30
30
  Maintainer-email: Charles Tapley Hoyt <cthoyt@gmail.com>
31
- Requires-Python: >=3.10
31
+ Requires-Python: >=3.11
32
32
  Project-URL: Bug Tracker, https://github.com/cthoyt/figshare-client/issues
33
33
  Project-URL: Homepage, https://github.com/cthoyt/figshare-client
34
34
  Project-URL: Repository, https://github.com/cthoyt/figshare-client.git
@@ -0,0 +1,230 @@
1
+ [build-system]
2
+ requires = ["uv_build>=0.9.6,<1.0"]
3
+ build-backend = "uv_build"
4
+
5
+ [project]
6
+ name = "figshare_client"
7
+ version = "0.0.4"
8
+ description = "A client to Figshare"
9
+ readme = "README.md"
10
+ classifiers = [
11
+ "Development Status :: 1 - Planning",
12
+ "Environment :: Console",
13
+ "Intended Audience :: Developers",
14
+ "Operating System :: OS Independent",
15
+ "Framework :: Pytest",
16
+ "Framework :: tox",
17
+ "Framework :: Sphinx",
18
+ "Natural Language :: English",
19
+ "Programming Language :: Python",
20
+ "Programming Language :: Python :: 3.11",
21
+ "Programming Language :: Python :: 3.12",
22
+ "Programming Language :: Python :: 3.13",
23
+ "Programming Language :: Python :: 3.14",
24
+ "Programming Language :: Python :: 3.15",
25
+ "Programming Language :: Python :: 3 :: Only",
26
+ "Typing :: Typed",
27
+ ]
28
+ keywords = [
29
+ "snekpack",
30
+ "cookiecutter",
31
+ "figshare",
32
+ ]
33
+ license = "MIT"
34
+ license-files = ["LICENSE"]
35
+ requires-python = ">=3.11"
36
+ dependencies = [
37
+ "pydantic",
38
+ "requests",
39
+ "pystow>=0.10.0",
40
+ ]
41
+
42
+ [[project.authors]]
43
+ name = "Charles Tapley Hoyt"
44
+ email = "cthoyt@gmail.com"
45
+
46
+ [[project.maintainers]]
47
+ name = "Charles Tapley Hoyt"
48
+ email = "cthoyt@gmail.com"
49
+
50
+ [project.optional-dependencies]
51
+
52
+ [project.urls]
53
+ "Bug Tracker" = "https://github.com/cthoyt/figshare-client/issues"
54
+ Homepage = "https://github.com/cthoyt/figshare-client"
55
+ Repository = "https://github.com/cthoyt/figshare-client.git"
56
+ Documentation = "https://figshare_client.readthedocs.io"
57
+ Funding = "https://github.com/sponsors/cthoyt"
58
+
59
+ [project.scripts]
60
+ figshare_client = "figshare_client.cli:main"
61
+
62
+ [dependency-groups]
63
+ tests = [
64
+ "pytest",
65
+ "coverage[toml]",
66
+ ]
67
+ docs = [
68
+ "sphinx>=9",
69
+ "sphinx-rtd-theme>=3.0",
70
+ "sphinx-click",
71
+ "sphinx_automodapi",
72
+ "autodoc_pydantic",
73
+ ]
74
+ lint = ["ruff"]
75
+ typing = [
76
+ { include-group = "tests" },
77
+ "mypy",
78
+ "pydantic",
79
+ "types-click",
80
+ "types-requests",
81
+ ]
82
+ docs-lint = [
83
+ { include-group = "docs" },
84
+ "doc8",
85
+ ]
86
+ format-docs = [
87
+ { include-group = "docs" },
88
+ "docstrfmt",
89
+ ]
90
+ doctests = [
91
+ "xdoctest",
92
+ "pygments",
93
+ ]
94
+ pyroma = [
95
+ "pyroma",
96
+ "pygments",
97
+ ]
98
+
99
+ [tool.cruft]
100
+ skip = [
101
+ "**/__init__.py",
102
+ "tests/*",
103
+ ]
104
+
105
+ [tool.mypy]
106
+ plugins = ["pydantic.mypy"]
107
+
108
+ [tool.doc8]
109
+ max-line-length = 120
110
+
111
+ [tool.pytest.ini_options]
112
+ markers = ["""slow: marks tests as slow (deselect with '-m "not slow"')"""]
113
+
114
+ [tool.coverage.run]
115
+ branch = true
116
+ source = ["figshare_client"]
117
+ omit = [
118
+ "tests/*",
119
+ "docs/*",
120
+ "src/figshare_client/version.py",
121
+ "src/figshare_client/__main__.py",
122
+ "src/figshare_client/cli.py",
123
+ ]
124
+
125
+ [tool.coverage.paths]
126
+ source = [
127
+ "src/figshare_client",
128
+ ".tox/*/lib/python*/site-packages/figshare_client",
129
+ ]
130
+
131
+ [tool.coverage.report]
132
+ show_missing = true
133
+ exclude_lines = [
134
+ "pragma: no cover",
135
+ "raise NotImplementedError",
136
+ 'if __name__ == "__main__":',
137
+ "if TYPE_CHECKING:",
138
+ "def __str__",
139
+ "def __repr__",
140
+ ]
141
+
142
+ [tool.ruff]
143
+ line-length = 100
144
+ extend-include = ["*.ipynb"]
145
+
146
+ [tool.ruff.lint]
147
+ extend-select = [
148
+ "F",
149
+ "E",
150
+ "W",
151
+ "C90",
152
+ "I",
153
+ "UP",
154
+ "D",
155
+ "DOC",
156
+ "B",
157
+ "S",
158
+ "T20",
159
+ "N",
160
+ "ERA",
161
+ "NPY",
162
+ "RUF",
163
+ "C4",
164
+ ]
165
+ ignore = [
166
+ "D105",
167
+ "E203",
168
+ ]
169
+
170
+ [tool.ruff.lint.per-file-ignores]
171
+ "src/figshare_client/version.py" = [
172
+ "S603",
173
+ "S607",
174
+ ]
175
+ "docs/source/conf.py" = ["ERA001"]
176
+ "notebooks/**/*.ipynb" = ["T201"]
177
+
178
+ [tool.ruff.lint.pydocstyle]
179
+ convention = "pep257"
180
+
181
+ [tool.ruff.lint.isort]
182
+ relative-imports-order = "closest-to-furthest"
183
+ known-third-party = ["tqdm"]
184
+ known-first-party = [
185
+ "figshare_client",
186
+ "tests",
187
+ ]
188
+
189
+ [tool.ruff.format]
190
+ docstring-code-format = true
191
+
192
+ [tool.bumpversion]
193
+ current_version = "0.0.4"
194
+ parse = '(?P<major>\d+)\.(?P<minor>\d+)\.(?P<patch>\d+)(?:-(?P<release>[0-9A-Za-z-]+(?:\.[0-9A-Za-z-]+)*))?(?:\+(?P<build>[0-9A-Za-z-]+(?:\.[0-9A-Za-z-]+)*))?'
195
+ serialize = [
196
+ "{major}.{minor}.{patch}-{release}+{build}",
197
+ "{major}.{minor}.{patch}+{build}",
198
+ "{major}.{minor}.{patch}-{release}",
199
+ "{major}.{minor}.{patch}",
200
+ ]
201
+ commit = true
202
+ tag = false
203
+
204
+ [tool.bumpversion.parts.release]
205
+ optional_value = "production"
206
+ first_value = "dev"
207
+ values = [
208
+ "dev",
209
+ "production",
210
+ ]
211
+
212
+ [[tool.bumpversion.files]]
213
+ filename = "pyproject.toml"
214
+ search = 'version = "{current_version}"'
215
+ replace = 'version = "{new_version}"'
216
+
217
+ [[tool.bumpversion.files]]
218
+ filename = "docs/source/conf.py"
219
+ search = 'release = "{current_version}"'
220
+ replace = 'release = "{new_version}"'
221
+
222
+ [[tool.bumpversion.files]]
223
+ filename = "src/figshare_client/version.py"
224
+ search = 'VERSION = "{current_version}"'
225
+ replace = 'VERSION = "{new_version}"'
226
+
227
+ [[tool.bumpversion.files]]
228
+ filename = "CITATION.cff"
229
+ search = "version: {current_version}"
230
+ replace = "version: {new_version}"
@@ -4,7 +4,7 @@ build-backend = "uv_build"
4
4
 
5
5
  [project]
6
6
  name = "figshare_client"
7
- version = "0.0.2"
7
+ version = "0.0.4"
8
8
  description = "A client to Figshare"
9
9
  readme = "README.md"
10
10
  authors = [
@@ -20,21 +20,19 @@ classifiers = [
20
20
  "Development Status :: 1 - Planning",
21
21
  "Environment :: Console",
22
22
  "Intended Audience :: Developers",
23
- "License :: OSI Approved :: MIT License",
24
23
  "Operating System :: OS Independent",
25
24
  "Framework :: Pytest",
26
25
  "Framework :: tox",
27
26
  "Framework :: Sphinx",
28
27
  "Natural Language :: English",
29
28
  "Programming Language :: Python",
30
- "Programming Language :: Python :: 3.10",
31
29
  "Programming Language :: Python :: 3.11",
32
30
  "Programming Language :: Python :: 3.12",
33
31
  "Programming Language :: Python :: 3.13",
34
32
  "Programming Language :: Python :: 3.14",
33
+ "Programming Language :: Python :: 3.15",
35
34
  "Programming Language :: Python :: 3 :: Only",
36
35
  "Typing :: Typed",
37
- # TODO add your topics from the Trove controlled vocabulary (see https://pypi.org/classifiers)
38
36
  ]
39
37
  keywords = [
40
38
  "snekpack", # please keep this keyword to credit the cookiecutter-snekpack template
@@ -44,15 +42,16 @@ keywords = [
44
42
 
45
43
  # License Information.
46
44
  # See PEP-639 at https://peps.python.org/pep-0639/#add-license-files-key
45
+ license = "MIT"
47
46
  license-files = [
48
47
  "LICENSE",
49
48
  ]
50
49
 
51
- requires-python = ">=3.10"
50
+ requires-python = ">=3.11"
52
51
  dependencies = [
53
52
  "pydantic",
54
53
  "requests",
55
- "pystow",
54
+ "pystow>=0.10.0",
56
55
  ]
57
56
 
58
57
  # see https://peps.python.org/pep-0735/ and https://docs.astral.sh/uv/concepts/dependencies/#dependency-groups
@@ -62,7 +61,7 @@ tests = [
62
61
  "coverage[toml]",
63
62
  ]
64
63
  docs = [
65
- "sphinx>=8,<9",
64
+ "sphinx>=9",
66
65
  "sphinx-rtd-theme>=3.0",
67
66
  "sphinx-click",
68
67
  "sphinx_automodapi",
@@ -220,7 +219,7 @@ known-first-party = [
220
219
  docstring-code-format = true
221
220
 
222
221
  [tool.bumpversion]
223
- current_version = "0.0.2"
222
+ current_version = "0.0.4"
224
223
  parse = "(?P<major>\\d+)\\.(?P<minor>\\d+)\\.(?P<patch>\\d+)(?:-(?P<release>[0-9A-Za-z-]+(?:\\.[0-9A-Za-z-]+)*))?(?:\\+(?P<build>[0-9A-Za-z-]+(?:\\.[0-9A-Za-z-]+)*))?"
225
224
  serialize = [
226
225
  "{major}.{minor}.{patch}-{release}+{build}",
@@ -1,6 +1,7 @@
1
1
  """Interact with the Figshare API."""
2
2
 
3
3
  from pathlib import Path
4
+ from typing import Any
4
5
 
5
6
  import pystow
6
7
  import requests
@@ -39,7 +40,9 @@ def get_files(record_id: int) -> list[File]:
39
40
  return [File.model_validate(f) for f in res.json()]
40
41
 
41
42
 
42
- def ensure_files(record_id: int, *, concurrent: bool = True) -> dict[Path, File]:
43
+ def ensure_files(
44
+ record_id: int, *, concurrent: bool = True, tqdm_kwargs: dict[str, Any] | None = None
45
+ ) -> dict[Path, File]:
43
46
  """Ensure all files for a record."""
44
47
  files = get_files(record_id)
45
48
  submodule = MODULE.module(str(record_id))
@@ -47,7 +50,15 @@ def ensure_files(record_id: int, *, concurrent: bool = True) -> dict[Path, File]
47
50
  def _func(file: File) -> tuple[Path, File]:
48
51
  return submodule.ensure(url=str(file.download_url), name=file.name), file
49
52
 
53
+ _tqdm_kwargs = {
54
+ "desc": f"downloading figshare:{record_id}",
55
+ "unit": "file",
56
+ "leave": False,
57
+ }
58
+ if tqdm_kwargs:
59
+ _tqdm_kwargs.update(tqdm_kwargs)
60
+
50
61
  if concurrent:
51
- return dict(thread_map(_func, files))
62
+ return dict(thread_map(_func, files, **_tqdm_kwargs))
52
63
  else:
53
- return dict(tmap(_func, files))
64
+ return dict(tmap(_func, files, **_tqdm_kwargs))
@@ -12,7 +12,7 @@ __all__ = [
12
12
  "get_version",
13
13
  ]
14
14
 
15
- VERSION = "0.0.2"
15
+ VERSION = "0.0.4"
16
16
 
17
17
 
18
18
  def get_git_hash() -> str:
File without changes