ssdownload 0.1.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.
Files changed (36) hide show
  1. ssdownload-0.1.0/.gitignore +24 -0
  2. ssdownload-0.1.0/LICENSE +21 -0
  3. ssdownload-0.1.0/PKG-INFO +146 -0
  4. ssdownload-0.1.0/README.md +112 -0
  5. ssdownload-0.1.0/pyproject.toml +115 -0
  6. ssdownload-0.1.0/src/ssdownload/__init__.py +24 -0
  7. ssdownload-0.1.0/src/ssdownload/cli.py +496 -0
  8. ssdownload-0.1.0/src/ssdownload/cli_utils.py +93 -0
  9. ssdownload-0.1.0/src/ssdownload/client.py +315 -0
  10. ssdownload-0.1.0/src/ssdownload/config.py +171 -0
  11. ssdownload-0.1.0/src/ssdownload/downloader.py +409 -0
  12. ssdownload-0.1.0/src/ssdownload/exceptions.py +37 -0
  13. ssdownload-0.1.0/src/ssdownload/filters.py +172 -0
  14. ssdownload-0.1.0/src/ssdownload/index_manager.py +279 -0
  15. ssdownload-0.1.0/tests/__init__.py +1 -0
  16. ssdownload-0.1.0/tests/contract/__init__.py +1 -0
  17. ssdownload-0.1.0/tests/contract/test_suitesparse_api.py +323 -0
  18. ssdownload-0.1.0/tests/e2e/__init__.py +1 -0
  19. ssdownload-0.1.0/tests/e2e/test_complete_workflows.py +360 -0
  20. ssdownload-0.1.0/tests/integration/__init__.py +1 -0
  21. ssdownload-0.1.0/tests/integration/test_api_integration.py +373 -0
  22. ssdownload-0.1.0/tests/integration/test_real_api.py +271 -0
  23. ssdownload-0.1.0/tests/property/__init__.py +1 -0
  24. ssdownload-0.1.0/tests/property/test_filters_properties.py +161 -0
  25. ssdownload-0.1.0/tests/property/test_range_parsing.py +142 -0
  26. ssdownload-0.1.0/tests/unit/__init__.py +1 -0
  27. ssdownload-0.1.0/tests/unit/test_archive_extraction.py +327 -0
  28. ssdownload-0.1.0/tests/unit/test_cli.py +387 -0
  29. ssdownload-0.1.0/tests/unit/test_cli_utils.py +129 -0
  30. ssdownload-0.1.0/tests/unit/test_client.py +247 -0
  31. ssdownload-0.1.0/tests/unit/test_config.py +146 -0
  32. ssdownload-0.1.0/tests/unit/test_downloader.py +275 -0
  33. ssdownload-0.1.0/tests/unit/test_error_handling.py +288 -0
  34. ssdownload-0.1.0/tests/unit/test_exceptions.py +91 -0
  35. ssdownload-0.1.0/tests/unit/test_filters.py +183 -0
  36. ssdownload-0.1.0/tests/unit/test_index_manager.py +296 -0
@@ -0,0 +1,24 @@
1
+ .vscode/
2
+ .pytest_cache/
3
+ .ruff_cache/
4
+ .venv/
5
+ test_output/
6
+ matrices
7
+ **/__pycache__/
8
+ *.pyc
9
+ *.pyo
10
+ *.pyd
11
+ .coverage
12
+ .coverage.*
13
+ htmlcov/
14
+ .tox/
15
+ .cache
16
+ nosetests.xml
17
+ coverage.xml
18
+ *.egg-info/
19
+ build/
20
+ dist/
21
+
22
+ # Test artifacts
23
+ .hypothesis/
24
+ ssstats_cache.json
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2025 Suguru Kurita
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,146 @@
1
+ Metadata-Version: 2.4
2
+ Name: ssdownload
3
+ Version: 0.1.0
4
+ Summary: Download sparse matrices from SuiteSparse Matrix Collection
5
+ Author-email: Suguru Kurita <skurita0208@gmail.com>
6
+ License-Expression: MIT
7
+ License-File: LICENSE
8
+ Classifier: Development Status :: 3 - Alpha
9
+ Classifier: Intended Audience :: Developers
10
+ Classifier: Intended Audience :: Science/Research
11
+ Classifier: License :: OSI Approved :: MIT License
12
+ Classifier: Programming Language :: Python :: 3
13
+ Classifier: Programming Language :: Python :: 3.12
14
+ Classifier: Topic :: Scientific/Engineering :: Mathematics
15
+ Requires-Python: >=3.12
16
+ Requires-Dist: beautifulsoup4>=4.12.0
17
+ Requires-Dist: httpx>=0.25.0
18
+ Requires-Dist: platformdirs>=3.0.0
19
+ Requires-Dist: pydantic>=2.0.0
20
+ Requires-Dist: rich>=13.0.0
21
+ Requires-Dist: tqdm>=4.66.0
22
+ Requires-Dist: typer>=0.9.0
23
+ Provides-Extra: dev
24
+ Requires-Dist: black>=23.0.0; extra == 'dev'
25
+ Requires-Dist: isort>=5.12.0; extra == 'dev'
26
+ Requires-Dist: mkdocs-material>=9.4.0; extra == 'dev'
27
+ Requires-Dist: mkdocs>=1.5.0; extra == 'dev'
28
+ Requires-Dist: pre-commit>=3.5.0; extra == 'dev'
29
+ Requires-Dist: pytest-asyncio>=0.21.0; extra == 'dev'
30
+ Requires-Dist: pytest-httpx>=0.26.0; extra == 'dev'
31
+ Requires-Dist: pytest>=7.4.0; extra == 'dev'
32
+ Requires-Dist: ruff>=0.1.0; extra == 'dev'
33
+ Description-Content-Type: text/markdown
34
+
35
+ # SuiteSparse Matrix Collection Downloader
36
+
37
+ **Modern Python tool for downloading sparse matrices from the [SuiteSparse Matrix Collection](https://sparse.tamu.edu/)**
38
+
39
+ > ⚠️ **This project is under active development.** APIs and features may change without notice.
40
+
41
+ A command-line tool and Python library that makes it easy to discover, download, and work with sparse matrices from the world's largest collection of sparse matrix data.
42
+
43
+ ## ✨ Features
44
+
45
+ - 🔍 **Smart Matrix Discovery** - Search by size, sparsity, mathematical properties, and more
46
+ - 📦 **Multiple Formats** - Download MAT-files, Matrix Market, or Rutherford-Boeing formats
47
+ - ⚡ **Concurrent Downloads** - Up to 8 parallel downloads with progress tracking
48
+ - 🔄 **Resume Support** - Interrupted downloads continue automatically
49
+ - ✅ **Integrity Verification** - MD5 checksum validation ensures data accuracy
50
+ - 🧠 **Smart Caching** - Skip re-downloads of existing files
51
+ - 🎨 **Rich CLI** - Beautiful progress bars and colored output
52
+ - 🔧 **Type Safety** - Full type hints for better IDE support
53
+
54
+ ## 🚀 Quick Start
55
+
56
+ ### Installation
57
+
58
+ ```bash
59
+ # Clone and install (not yet on PyPI)
60
+ git clone <repository-url>
61
+ cd ssdownload
62
+ curl -LsSf https://astral.sh/uv/install.sh | sh # Install uv
63
+ uv sync # Install dependencies
64
+ ```
65
+
66
+ #### Global Installation (Recommended for Development)
67
+
68
+ For easier command usage without `uv run` prefix:
69
+
70
+ ```bash
71
+ # From project root (or use absolute path)
72
+ uv tool install . # Initial installation
73
+ uv tool update-shell # Update PATH (first time only)
74
+
75
+ # Verify installation
76
+ ssdl --help
77
+
78
+ # After code changes
79
+ uv tool upgrade ssdownload --reinstall # Update wrapper only
80
+ ```
81
+
82
+ ### Basic Usage
83
+
84
+ > **Command Format**: Use `ssdl` directly if you've done global installation, otherwise add `uv run` prefix.
85
+
86
+ ```bash
87
+ # Get matrix information
88
+ ssdl info ct20stif
89
+
90
+ # Download a matrix (auto-detects group)
91
+ ssdl download ct20stif
92
+
93
+ # Download in Matrix Market format
94
+ ssdl download ct20stif --format mm
95
+
96
+ # Search matrices with filters
97
+ ssdl list --spd --size 1000:10000 --field real
98
+
99
+ # Bulk download (real) SPD matrices in size range
100
+ ssdl bulk --spd --field real --size 100:1000 --max-files 5
101
+ ```
102
+
103
+ <details>
104
+ <summary>Python API Example</summary>
105
+
106
+ ```python
107
+ from ssdownload import SuiteSparseDownloader, Filter
108
+
109
+ # Simple download
110
+ downloader = SuiteSparseDownloader()
111
+ path = await downloader.download_by_name("ct20stif")
112
+
113
+ # Filtered bulk download
114
+ filter_obj = Filter(spd=True, n_rows=(1000, 10000))
115
+ paths = await downloader.bulk_download(filter_obj, max_files=5)
116
+ ```
117
+
118
+ </details>
119
+
120
+ ## 📚 Documentation
121
+
122
+ - **[Installation Guide](docs/INSTALLATION.md)** - Detailed setup instructions
123
+ - **[CLI Reference](docs/CLI_REFERENCE.md)** - Complete command-line options
124
+ - **[Python API](docs/API_REFERENCE.md)** - Full API documentation
125
+ - **[Examples](docs/EXAMPLES.md)** - Usage examples and tutorials
126
+ - **[Development](docs/DEVELOPMENT.md)** - Contributing and development setup
127
+ - **[Troubleshooting](docs/TROUBLESHOOTING.md)** - Common issues and solutions
128
+
129
+
130
+ ## 🤝 Contributing
131
+
132
+ We welcome contributions! Please see our [Development Guide](docs/DEVELOPMENT.md) for setup instructions and coding standards.
133
+
134
+ 1. Fork the repository
135
+ 2. Create your feature branch
136
+ 3. Add tests for new functionality
137
+ 4. Submit a pull request
138
+
139
+ ## 📄 License
140
+
141
+ MIT License - see [LICENSE](LICENSE) file for details.
142
+
143
+ ## 🙏 Acknowledgments
144
+
145
+ - [SuiteSparse Matrix Collection](https://sparse.tamu.edu/) by [Tim Davis](https://people.engr.tamu.edu/davis/)
146
+ - Built with [httpx](https://www.python-httpx.org/), [Rich](https://rich.readthedocs.io/), and [Typer](https://typer.tiangolo.com/)
@@ -0,0 +1,112 @@
1
+ # SuiteSparse Matrix Collection Downloader
2
+
3
+ **Modern Python tool for downloading sparse matrices from the [SuiteSparse Matrix Collection](https://sparse.tamu.edu/)**
4
+
5
+ > ⚠️ **This project is under active development.** APIs and features may change without notice.
6
+
7
+ A command-line tool and Python library that makes it easy to discover, download, and work with sparse matrices from the world's largest collection of sparse matrix data.
8
+
9
+ ## ✨ Features
10
+
11
+ - 🔍 **Smart Matrix Discovery** - Search by size, sparsity, mathematical properties, and more
12
+ - 📦 **Multiple Formats** - Download MAT-files, Matrix Market, or Rutherford-Boeing formats
13
+ - ⚡ **Concurrent Downloads** - Up to 8 parallel downloads with progress tracking
14
+ - 🔄 **Resume Support** - Interrupted downloads continue automatically
15
+ - ✅ **Integrity Verification** - MD5 checksum validation ensures data accuracy
16
+ - 🧠 **Smart Caching** - Skip re-downloads of existing files
17
+ - 🎨 **Rich CLI** - Beautiful progress bars and colored output
18
+ - 🔧 **Type Safety** - Full type hints for better IDE support
19
+
20
+ ## 🚀 Quick Start
21
+
22
+ ### Installation
23
+
24
+ ```bash
25
+ # Clone and install (not yet on PyPI)
26
+ git clone <repository-url>
27
+ cd ssdownload
28
+ curl -LsSf https://astral.sh/uv/install.sh | sh # Install uv
29
+ uv sync # Install dependencies
30
+ ```
31
+
32
+ #### Global Installation (Recommended for Development)
33
+
34
+ For easier command usage without `uv run` prefix:
35
+
36
+ ```bash
37
+ # From project root (or use absolute path)
38
+ uv tool install . # Initial installation
39
+ uv tool update-shell # Update PATH (first time only)
40
+
41
+ # Verify installation
42
+ ssdl --help
43
+
44
+ # After code changes
45
+ uv tool upgrade ssdownload --reinstall # Update wrapper only
46
+ ```
47
+
48
+ ### Basic Usage
49
+
50
+ > **Command Format**: Use `ssdl` directly if you've done global installation, otherwise add `uv run` prefix.
51
+
52
+ ```bash
53
+ # Get matrix information
54
+ ssdl info ct20stif
55
+
56
+ # Download a matrix (auto-detects group)
57
+ ssdl download ct20stif
58
+
59
+ # Download in Matrix Market format
60
+ ssdl download ct20stif --format mm
61
+
62
+ # Search matrices with filters
63
+ ssdl list --spd --size 1000:10000 --field real
64
+
65
+ # Bulk download (real) SPD matrices in size range
66
+ ssdl bulk --spd --field real --size 100:1000 --max-files 5
67
+ ```
68
+
69
+ <details>
70
+ <summary>Python API Example</summary>
71
+
72
+ ```python
73
+ from ssdownload import SuiteSparseDownloader, Filter
74
+
75
+ # Simple download
76
+ downloader = SuiteSparseDownloader()
77
+ path = await downloader.download_by_name("ct20stif")
78
+
79
+ # Filtered bulk download
80
+ filter_obj = Filter(spd=True, n_rows=(1000, 10000))
81
+ paths = await downloader.bulk_download(filter_obj, max_files=5)
82
+ ```
83
+
84
+ </details>
85
+
86
+ ## 📚 Documentation
87
+
88
+ - **[Installation Guide](docs/INSTALLATION.md)** - Detailed setup instructions
89
+ - **[CLI Reference](docs/CLI_REFERENCE.md)** - Complete command-line options
90
+ - **[Python API](docs/API_REFERENCE.md)** - Full API documentation
91
+ - **[Examples](docs/EXAMPLES.md)** - Usage examples and tutorials
92
+ - **[Development](docs/DEVELOPMENT.md)** - Contributing and development setup
93
+ - **[Troubleshooting](docs/TROUBLESHOOTING.md)** - Common issues and solutions
94
+
95
+
96
+ ## 🤝 Contributing
97
+
98
+ We welcome contributions! Please see our [Development Guide](docs/DEVELOPMENT.md) for setup instructions and coding standards.
99
+
100
+ 1. Fork the repository
101
+ 2. Create your feature branch
102
+ 3. Add tests for new functionality
103
+ 4. Submit a pull request
104
+
105
+ ## 📄 License
106
+
107
+ MIT License - see [LICENSE](LICENSE) file for details.
108
+
109
+ ## 🙏 Acknowledgments
110
+
111
+ - [SuiteSparse Matrix Collection](https://sparse.tamu.edu/) by [Tim Davis](https://people.engr.tamu.edu/davis/)
112
+ - Built with [httpx](https://www.python-httpx.org/), [Rich](https://rich.readthedocs.io/), and [Typer](https://typer.tiangolo.com/)
@@ -0,0 +1,115 @@
1
+ [build-system]
2
+ requires = ["hatchling"]
3
+ build-backend = "hatchling.build"
4
+
5
+ [project]
6
+ name = "ssdownload"
7
+ version = "0.1.0"
8
+ description = "Download sparse matrices from SuiteSparse Matrix Collection"
9
+ readme = "README.md"
10
+ license = "MIT"
11
+ requires-python = ">=3.12"
12
+ authors = [
13
+ {name = "Suguru Kurita", email = "skurita0208@gmail.com"},
14
+ ]
15
+ classifiers = [
16
+ "Development Status :: 3 - Alpha",
17
+ "Intended Audience :: Developers",
18
+ "Intended Audience :: Science/Research",
19
+ "License :: OSI Approved :: MIT License",
20
+ "Programming Language :: Python :: 3",
21
+ "Programming Language :: Python :: 3.12",
22
+ "Topic :: Scientific/Engineering :: Mathematics",
23
+ ]
24
+ dependencies = [
25
+ "httpx>=0.25.0",
26
+ "typer>=0.9.0",
27
+ "pydantic>=2.0.0",
28
+ "rich>=13.0.0",
29
+ "tqdm>=4.66.0",
30
+ "beautifulsoup4>=4.12.0",
31
+ "platformdirs>=3.0.0",
32
+ ]
33
+
34
+ [project.optional-dependencies]
35
+ dev = [
36
+ "pytest>=7.4.0",
37
+ "pytest-asyncio>=0.21.0",
38
+ "pytest-httpx>=0.26.0",
39
+ "ruff>=0.1.0",
40
+ "black>=23.0.0",
41
+ "isort>=5.12.0",
42
+ "pre-commit>=3.5.0",
43
+ "mkdocs>=1.5.0",
44
+ "mkdocs-material>=9.4.0",
45
+ ]
46
+
47
+ [project.scripts]
48
+ ssdl = "ssdownload.cli:app"
49
+
50
+ [tool.hatch.build.targets.wheel]
51
+ packages = ["src/ssdownload"]
52
+
53
+ [tool.hatch.build.targets.sdist]
54
+ include = [
55
+ "/src",
56
+ "/tests",
57
+ "/README.md",
58
+ "/LICENSE",
59
+ ]
60
+
61
+ [tool.black]
62
+ line-length = 88
63
+ target-version = ['py312']
64
+
65
+ [tool.isort]
66
+ profile = "black"
67
+ line_length = 88
68
+
69
+ [tool.ruff]
70
+ target-version = "py312"
71
+ line-length = 88
72
+
73
+ [tool.ruff.lint]
74
+ select = [
75
+ "E", # pycodestyle errors
76
+ "W", # pycodestyle warnings
77
+ "F", # pyflakes
78
+ "I", # isort
79
+ "B", # flake8-bugbear
80
+ "C4", # flake8-comprehensions
81
+ "UP", # pyupgrade
82
+ ]
83
+ ignore = [
84
+ "E501", # line too long, handled by black
85
+ ]
86
+
87
+ [tool.pytest.ini_options]
88
+ testpaths = ["tests"]
89
+ python_files = ["test_*.py"]
90
+ python_classes = ["Test*"]
91
+ python_functions = ["test_*"]
92
+ asyncio_mode = "auto"
93
+ markers = [
94
+ "slow: marks tests as slow (requiring network access or file I/O)",
95
+ "integration: marks tests as integration tests with real API calls",
96
+ "contract: marks tests as contract tests for API response format",
97
+ "property: marks property-based tests with Hypothesis",
98
+ "e2e: marks end-to-end workflow tests",
99
+ "performance: marks performance and load tests",
100
+ ]
101
+ addopts = [
102
+ "--strict-markers",
103
+ "--disable-warnings",
104
+ ]
105
+
106
+ [tool.uv]
107
+ dev-dependencies = [
108
+ "pytest>=8.4.1",
109
+ "pytest-asyncio>=1.0.0",
110
+ "pytest-httpx>=0.35.0",
111
+ "mypy>=1.0.0",
112
+ "pytest-cov>=4.0.0",
113
+ "pre-commit>=4.2.0",
114
+ "hypothesis>=6.135.16",
115
+ ]
@@ -0,0 +1,24 @@
1
+ """SuiteSparse Matrix Collection Downloader."""
2
+
3
+ from .client import SuiteSparseDownloader
4
+ from .exceptions import (
5
+ ChecksumError,
6
+ DownloadError,
7
+ IndexError,
8
+ MatrixNotFoundError,
9
+ NetworkError,
10
+ SSDownloadError,
11
+ )
12
+ from .filters import Filter
13
+
14
+ __all__ = [
15
+ "SuiteSparseDownloader",
16
+ "Filter",
17
+ "SSDownloadError",
18
+ "ChecksumError",
19
+ "MatrixNotFoundError",
20
+ "IndexError",
21
+ "DownloadError",
22
+ "NetworkError",
23
+ ]
24
+ __version__ = "0.1.0"