mirtillo 0.0.1__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,34 @@
1
+ name: Publish to PyPI
2
+
3
+ on:
4
+ push:
5
+ tags:
6
+ - 'v*'
7
+
8
+ jobs:
9
+ build-and-publish:
10
+ runs-on: ubuntu-latest
11
+ environment: release
12
+ permissions:
13
+ id-token: write
14
+
15
+ steps:
16
+ - name: Checkout code
17
+ uses: actions/checkout@v4
18
+ with:
19
+ # required for setuptools_scm to see the git tags
20
+ fetch-depth: 0
21
+
22
+ - name: Set up Python
23
+ uses: actions/setup-python@v5
24
+ with:
25
+ python-version: "3.x"
26
+
27
+ - name: Install build tools
28
+ run: python -m pip install --upgrade build
29
+
30
+ - name: Build the package
31
+ run: python -m build
32
+
33
+ - name: Publish to PyPI
34
+ uses: pypa/gh-action-pypi-publish@release/v1
@@ -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,70 @@
1
+ Metadata-Version: 2.4
2
+ Name: mirtillo
3
+ Version: 0.0.1
4
+ Summary: Hugging face datasets wrapper to load datasets easier and match the style of torchvision default PyTorch datasets.
5
+ Author-email: Taha Shieenavaz <tahashieenavaz@gmail.com>
6
+ License-Expression: MIT
7
+ Project-URL: Homepage, https://github.com/tahashieenavaz/mirtillo
8
+ Project-URL: Repository, https://github.com/tahashieenavaz/mirtillo
9
+ Project-URL: Documentation, https://github.com/tahashieenavaz/mirtillo#readme
10
+ Project-URL: Issues, https://github.com/tahashieenavaz/mirtillo/issues
11
+ Project-URL: Changelog, https://github.com/tahashieenavaz/mirtillo/blob/main/CHANGELOG.md
12
+ Keywords: productivity,dataset,cifar,pytorch
13
+ Classifier: Development Status :: 4 - Beta
14
+ Classifier: Intended Audience :: Developers
15
+ Classifier: Operating System :: OS Independent
16
+ Classifier: Programming Language :: Python :: 3
17
+ Classifier: Programming Language :: Python :: 3 :: Only
18
+ Classifier: Programming Language :: Python :: 3.9
19
+ Classifier: Programming Language :: Python :: 3.10
20
+ Classifier: Programming Language :: Python :: 3.11
21
+ Classifier: Programming Language :: Python :: 3.12
22
+ Classifier: Programming Language :: Python :: 3.13
23
+ Classifier: Programming Language :: Python :: 3.14
24
+ Classifier: Topic :: Software Development :: Libraries :: Python Modules
25
+ Requires-Python: >=3.9
26
+ Description-Content-Type: text/markdown
27
+ Requires-Dist: torch
28
+ Requires-Dist: datasets
29
+ Provides-Extra: dev
30
+ Requires-Dist: build; extra == "dev"
31
+ Requires-Dist: pytest; extra == "dev"
32
+ Requires-Dist: pytest-cov; extra == "dev"
33
+ Requires-Dist: ruff; extra == "dev"
34
+ Requires-Dist: mypy; extra == "dev"
35
+ Requires-Dist: twine; extra == "dev"
36
+
37
+ # Mirtillo
38
+
39
+ Hugging face datasets wrapper to load datasets easier and match the style of `torchvision` default PyTorch datasets.
40
+
41
+ ## Installation
42
+
43
+ Use PyPI:
44
+
45
+ ```bash
46
+ pip install mirtillo
47
+ ```
48
+
49
+ ## Usage
50
+
51
+ Make sure you import PyTorch before mirtillo:
52
+
53
+ ```py
54
+ import torch
55
+ from mirtillo import mirtillo
56
+
57
+ dataset = mirtillo("cifar")
58
+ ```
59
+
60
+
61
+ ## Mappings
62
+
63
+ - cifar: uoft-cs/cifar10
64
+ - cifar10: uoft-cs/cifar10
65
+ - cifar100: uoft-cs/cifar100
66
+ - mnist: ylecun/mnist
67
+ - fashionmnist: zalando-datasets/fashion_mnist
68
+ - fashion-mnist: zalando-datasets/fashion_mnist
69
+ - fashion_mnist: zalando-datasets/fashion_mnist
70
+ - imagenette: frgfm/imagenette
@@ -0,0 +1,34 @@
1
+ # Mirtillo
2
+
3
+ Hugging face datasets wrapper to load datasets easier and match the style of `torchvision` default PyTorch datasets.
4
+
5
+ ## Installation
6
+
7
+ Use PyPI:
8
+
9
+ ```bash
10
+ pip install mirtillo
11
+ ```
12
+
13
+ ## Usage
14
+
15
+ Make sure you import PyTorch before mirtillo:
16
+
17
+ ```py
18
+ import torch
19
+ from mirtillo import mirtillo
20
+
21
+ dataset = mirtillo("cifar")
22
+ ```
23
+
24
+
25
+ ## Mappings
26
+
27
+ - cifar: uoft-cs/cifar10
28
+ - cifar10: uoft-cs/cifar10
29
+ - cifar100: uoft-cs/cifar100
30
+ - mnist: ylecun/mnist
31
+ - fashionmnist: zalando-datasets/fashion_mnist
32
+ - fashion-mnist: zalando-datasets/fashion_mnist
33
+ - fashion_mnist: zalando-datasets/fashion_mnist
34
+ - imagenette: frgfm/imagenette
@@ -0,0 +1,82 @@
1
+ [build-system]
2
+ requires = [
3
+ "setuptools>=77.0",
4
+ "setuptools-scm>=8.0",
5
+ ]
6
+ build-backend = "setuptools.build_meta"
7
+
8
+
9
+ [project]
10
+ name = "mirtillo"
11
+ dynamic = ["version"]
12
+
13
+ description = "Hugging face datasets wrapper to load datasets easier and match the style of torchvision default PyTorch datasets."
14
+ readme = { file = "README.md", content-type = "text/markdown" }
15
+ requires-python = ">=3.9"
16
+
17
+ license = "MIT"
18
+ license-files = ["LICENSE*"]
19
+
20
+ authors = [
21
+ { name = "Taha Shieenavaz", email = "tahashieenavaz@gmail.com" },
22
+ ]
23
+
24
+ keywords = ["productivity", "dataset", "cifar", "pytorch"]
25
+
26
+ classifiers = [
27
+ "Development Status :: 4 - Beta",
28
+ "Intended Audience :: Developers",
29
+ "Operating System :: OS Independent",
30
+ "Programming Language :: Python :: 3",
31
+ "Programming Language :: Python :: 3 :: Only",
32
+ "Programming Language :: Python :: 3.9",
33
+ "Programming Language :: Python :: 3.10",
34
+ "Programming Language :: Python :: 3.11",
35
+ "Programming Language :: Python :: 3.12",
36
+ "Programming Language :: Python :: 3.13",
37
+ "Programming Language :: Python :: 3.14",
38
+ "Topic :: Software Development :: Libraries :: Python Modules",
39
+ ]
40
+
41
+ dependencies = ["torch", "datasets"]
42
+
43
+
44
+ [project.optional-dependencies]
45
+ dev = [
46
+ "build",
47
+ "pytest",
48
+ "pytest-cov",
49
+ "ruff",
50
+ "mypy",
51
+ "twine",
52
+ ]
53
+
54
+
55
+ [project.urls]
56
+ Homepage = "https://github.com/tahashieenavaz/mirtillo"
57
+ Repository = "https://github.com/tahashieenavaz/mirtillo"
58
+ Documentation = "https://github.com/tahashieenavaz/mirtillo#readme"
59
+ Issues = "https://github.com/tahashieenavaz/mirtillo/issues"
60
+ Changelog = "https://github.com/tahashieenavaz/mirtillo/blob/main/CHANGELOG.md"
61
+
62
+
63
+ [tool.setuptools]
64
+ package-dir = {"" = "src"}
65
+
66
+
67
+ [tool.setuptools.packages.find]
68
+ where = ["src"]
69
+ exclude = [
70
+ "tests*",
71
+ "docs*",
72
+ "scripts*",
73
+ ]
74
+
75
+
76
+ [tool.setuptools.package-data]
77
+ mirtillo = ["*.md", "*.txt", "*.png"]
78
+
79
+
80
+ [tool.setuptools_scm]
81
+ version_scheme = "guess-next-dev"
82
+ local_scheme = "no-local-version"
@@ -0,0 +1,4 @@
1
+ [egg_info]
2
+ tag_build =
3
+ tag_date = 0
4
+
@@ -0,0 +1,2 @@
1
+ from .mirtillo_wrapper import MirtilloWrapper
2
+ from .mirtillo import mirtillo
@@ -0,0 +1,8 @@
1
+ import datasets
2
+ from .mirtillo_wrapper import MirtilloWrapper
3
+ from .mirtillo_key import MirtilloKey
4
+
5
+
6
+ def mirtillo(key: str):
7
+ processed_key = MirtilloKey(key).process()
8
+ return MirtilloWrapper(datasets.load_dataset(processed_key))
@@ -0,0 +1,20 @@
1
+ class MirtilloKey:
2
+ def __init__(self, key: str):
3
+ self.key = key
4
+ self.replacements = {
5
+ "cifar": "uoft-cs/cifar10",
6
+ "cifar10": "uoft-cs/cifar10",
7
+ "cifar100": "uoft-cs/cifar100",
8
+ "mnist": "ylecun/mnist",
9
+ "fashionmnist": "zalando-datasets/fashion_mnist",
10
+ "fashion-mnist": "zalando-datasets/fashion_mnist",
11
+ "fashion_nmnist": "zalando-datasets/fashion_mnist",
12
+ "imagenette": "frgfm/imagenette",
13
+ }
14
+
15
+ def process(self):
16
+ if self.key in self.replacements and not self.key.startswith("raw:"):
17
+ return self.replacements[self.key]
18
+
19
+ # did not find the key
20
+ return self.key
@@ -0,0 +1,19 @@
1
+ import torch
2
+ from torch.utils.dataset import Dataset
3
+ from functools import cache
4
+
5
+
6
+ class MirtilloWrapper(Dataset):
7
+ def __init__(self, dataset: Dataset):
8
+ self.dataset = dataset
9
+
10
+ @cache
11
+ def get_length(self):
12
+ return len(self.dataset)
13
+
14
+ def __len__(self):
15
+ return self.get_length()
16
+
17
+ def __getitem__(self, key: any):
18
+ item = self.dataset[key]
19
+ return (item["img"], torch.tensor(item["label"], dtype=torch.long))
@@ -0,0 +1,70 @@
1
+ Metadata-Version: 2.4
2
+ Name: mirtillo
3
+ Version: 0.0.1
4
+ Summary: Hugging face datasets wrapper to load datasets easier and match the style of torchvision default PyTorch datasets.
5
+ Author-email: Taha Shieenavaz <tahashieenavaz@gmail.com>
6
+ License-Expression: MIT
7
+ Project-URL: Homepage, https://github.com/tahashieenavaz/mirtillo
8
+ Project-URL: Repository, https://github.com/tahashieenavaz/mirtillo
9
+ Project-URL: Documentation, https://github.com/tahashieenavaz/mirtillo#readme
10
+ Project-URL: Issues, https://github.com/tahashieenavaz/mirtillo/issues
11
+ Project-URL: Changelog, https://github.com/tahashieenavaz/mirtillo/blob/main/CHANGELOG.md
12
+ Keywords: productivity,dataset,cifar,pytorch
13
+ Classifier: Development Status :: 4 - Beta
14
+ Classifier: Intended Audience :: Developers
15
+ Classifier: Operating System :: OS Independent
16
+ Classifier: Programming Language :: Python :: 3
17
+ Classifier: Programming Language :: Python :: 3 :: Only
18
+ Classifier: Programming Language :: Python :: 3.9
19
+ Classifier: Programming Language :: Python :: 3.10
20
+ Classifier: Programming Language :: Python :: 3.11
21
+ Classifier: Programming Language :: Python :: 3.12
22
+ Classifier: Programming Language :: Python :: 3.13
23
+ Classifier: Programming Language :: Python :: 3.14
24
+ Classifier: Topic :: Software Development :: Libraries :: Python Modules
25
+ Requires-Python: >=3.9
26
+ Description-Content-Type: text/markdown
27
+ Requires-Dist: torch
28
+ Requires-Dist: datasets
29
+ Provides-Extra: dev
30
+ Requires-Dist: build; extra == "dev"
31
+ Requires-Dist: pytest; extra == "dev"
32
+ Requires-Dist: pytest-cov; extra == "dev"
33
+ Requires-Dist: ruff; extra == "dev"
34
+ Requires-Dist: mypy; extra == "dev"
35
+ Requires-Dist: twine; extra == "dev"
36
+
37
+ # Mirtillo
38
+
39
+ Hugging face datasets wrapper to load datasets easier and match the style of `torchvision` default PyTorch datasets.
40
+
41
+ ## Installation
42
+
43
+ Use PyPI:
44
+
45
+ ```bash
46
+ pip install mirtillo
47
+ ```
48
+
49
+ ## Usage
50
+
51
+ Make sure you import PyTorch before mirtillo:
52
+
53
+ ```py
54
+ import torch
55
+ from mirtillo import mirtillo
56
+
57
+ dataset = mirtillo("cifar")
58
+ ```
59
+
60
+
61
+ ## Mappings
62
+
63
+ - cifar: uoft-cs/cifar10
64
+ - cifar10: uoft-cs/cifar10
65
+ - cifar100: uoft-cs/cifar100
66
+ - mnist: ylecun/mnist
67
+ - fashionmnist: zalando-datasets/fashion_mnist
68
+ - fashion-mnist: zalando-datasets/fashion_mnist
69
+ - fashion_mnist: zalando-datasets/fashion_mnist
70
+ - imagenette: frgfm/imagenette
@@ -0,0 +1,15 @@
1
+ .gitignore
2
+ README.md
3
+ pyproject.toml
4
+ .github/workflows/publish.yaml
5
+ src/mirtillo/__init__.py
6
+ src/mirtillo/mirtillo.py
7
+ src/mirtillo/mirtillo_key.py
8
+ src/mirtillo/mirtillo_wrapper.py
9
+ src/mirtillo.egg-info/PKG-INFO
10
+ src/mirtillo.egg-info/SOURCES.txt
11
+ src/mirtillo.egg-info/dependency_links.txt
12
+ src/mirtillo.egg-info/requires.txt
13
+ src/mirtillo.egg-info/scm_file_list.json
14
+ src/mirtillo.egg-info/scm_version.json
15
+ src/mirtillo.egg-info/top_level.txt
@@ -0,0 +1,10 @@
1
+ torch
2
+ datasets
3
+
4
+ [dev]
5
+ build
6
+ pytest
7
+ pytest-cov
8
+ ruff
9
+ mypy
10
+ twine
@@ -0,0 +1,12 @@
1
+ {
2
+ "files": [
3
+ ".github/workflows/publish.yaml",
4
+ ".gitignore",
5
+ "README.md",
6
+ "pyproject.toml",
7
+ "src/mirtillo/__init__.py",
8
+ "src/mirtillo/mirtillo.py",
9
+ "src/mirtillo/mirtillo_key.py",
10
+ "src/mirtillo/mirtillo_wrapper.py"
11
+ ]
12
+ }
@@ -0,0 +1,8 @@
1
+ {
2
+ "tag": "0.0.1",
3
+ "distance": 0,
4
+ "node": "gb2ad854a11057e6070fe931b0c8851d427390e99",
5
+ "dirty": false,
6
+ "branch": "HEAD",
7
+ "node_date": "2026-12-04"
8
+ }
@@ -0,0 +1 @@
1
+ mirtillo