# Gohlke Grabber
**NOTICE**: 2024 and onwards. The original site is no longer available. Check [Christoph Gohlke's personal site](https://www.cgohlke.com/) for details, and check his GitHub repos mentioned there for anything you may have hoped to obtain from the original site. Finally, consider using Conda for package management in your project, possibly with the open conda-forge channel. Most of the packages I used to obtain from Gohlke's site are available there. I like [the miniforge distribution](https://github.com/conda-forge/miniforge).
**NOTICE**: On 12 June 2022, this message appeared on the site Christoph Gohlke maintains: "Updated on 12 June 2022 at 20:19 UTC. Funding for the Laboratory for Fluorescence Dynamics has ceased. This service will be discontinued before July 2022." However, later that month this notice disappeared. The status of the site is unclear - this means that this tool may stop working as well; there's nothing I can do about that within reason, so I will likely remove this project if Gohlke can no longer maintain their site.
Simple script to download .whl packages from the pre-built Python packages at https://www.lfd.uci.edu/~gohlke/pythonlibs.
Christoph Gohlke maintains 32-bit and 64-bit binaries for many popular scientific Python packages. These can save you some trouble in cases where getting the package from PyPI (using `pip install package_name`) causes pip to try and build underlying C or C++ code. This can of course be made to work on Windows, but requires the installation and configuration of a C/++ compiler and libraries - both of which come standard with a Linux installation, but not with Windows.
So, if you have issues installing a package, you trust Gohlke's build, and you want something easy that helps automate the download, grab a copy of [gohlkegrabber.py](https://github.com/jaapvandervelde/gohlkegrabber/blob/master/gohlkegrabber/gohlkegrabber.py) and call it like shown below or in [download.py](https://github.com/jaapvandervelde/gohlkegrabber/blob/master/example/download.py).
Of course, once you have a wheel (a file with the `.whl` extension), you can install it using:
```cmd
pip install path\to\saved\location\name.whl
```
<i>Please don't bother Christoph Gohlke or their organisation if there are issues with this tool. If it breaks, that's my fault and you should bother me with it, or ideally propose how to fix it. They just provide a valuable service at no cost and merely deserve credit.</i>
## Installing
```cmd
pip install gohlkegrabber
```
## Dependencies
Dependencies that will be installed :
```
lxml>=4.4.2
```
## Getting Started
### Quick
After installing, to get a recent copy of `gdal`:
```python
from gohlkegrabber import GohlkeGrabber
gg = GohlkeGrabber()
gg.retrieve('c:/temp', 'gdal')
```
Or, directly from the command line:
```commandline
ggrab c:\temp gdal
```
Note that `ggrab` takes the same arguments as the `.retrieve()` method, except that positional arguments come after named arguments, as this is the convention on OS CLIs. For example:
```commandline
ggrab -v 1.18 --platform win32 .\bin numpy
```
The CLI command `ggrab` also takes an additional argument `--cache` if you want to specify a cached index file to use, for example:
```commandline
ggrab --cache c:\temp\cache.html . numpy
```
If you run `ggrab` from the command line, you can also pass `--bare` or `-x`
```commandline
pip install gohklegrabber
for /f "tokens=*" %i in ('ggrab --bare c:\temp numpy') do set ggrab_last_package=%i
pip install %ggrab_last_package%
```
Or in a batch file:
```commandline
@echo off
pip install gohklegrabber
for /f "tokens=*" %%i in ('ggrab --bare c:\temp numpy') do set ggrab_last_package=%%i
pip install %ggrab_last_package%
```
### In greater detail
When you create a `GohlkeGrabber`, it automatically downloads the index from the website (or reads a cached copy) and figures out all the packages on offer. Of course, this requires an active connection to the web.
You can list the available packages:
```python
print(list(gg.packages))
```
Note that `.packages` is a `dict` - of course you can just use the dictionary directly and the data therein yourself as well. For example, this is what the start of the `numpy` entry looks like:
```python
{
'numpy-1.16.5+mkl-cp27-cp27m-win32.whl': {
'link': 'https://download.lfd.uci.edu/pythonlibs/t7epjj8p/numpy-1.16.5+mkl-cp27-cp27m-win32.whl',
'version': '1.16.5+mkl',
'build': None,
'python': '2.7',
'abi': 'cp27m',
'platform': 'win32'
},
'numpy-1.16.5+mkl-cp27-cp27m-win_amd64.whl': ...
}
```
To download the latest version (default) of `numpy`, for Windows 64-bit (default), and for the most recent version of Python (default) for which it is available, you would call:
```python
fn, metadata = gg.retrieve(output_folder, 'numpy')
```
`fn` will be the filename of the wheel that was downloaded. `metadata` will be a dictionary with the metadata for the downloaded wheel. Both will be `None` if no package could be downloaded that matched the request.
An example of what the metadata would look like:
```python
{
'link': 'https://download.lfd.uci.edu/pythonlibs/t7epjj8p/numpy-1.17.4+mkl-cp38-cp38-win_amd64.whl',
'version': '1.17.4+mkl',
'build': None,
'python': '3.8',
'abi': 'cp38',
'platform': 'win_amd64'
}
```
Note that this is just the appropriate entry from the `.packages` `dict`.
To get a copy for a specific Python version (e.g. 2.7), Windows version (e.g. 32-bit) and package version (e.g. '<1.17'), you can provide extra parameters to the call in no particular order:
```python
fn, metadata = gg.retrieve(output_folder, 'numpy', python='2.7', platform='win32', version='<1.17')
```
Any file downloaded will be stored in the `output_folder`.
If the file already exists, it won't be downloaded again, unless you pass `overwrite=True` to the `.retrieve()` call.
If you create the GohlkeGrabber with a `cached` parameter, it will save the downloaded web page to that location, or load that file instead of downloading it again, if it already exists.
```python
gg = GohlkeGrabber(cached='work/cache.html')
```
## License
This project is licensed under the MIT license. See [LICENSE.txt](https://github.com/jaapvandervelde/gohlkegrabber/blob/master/LICENSE.txt).
## Change log
0.3.12
- remove notice, as the notice on the source website has been taken down.
- fix a partial match problem with a `starts_with` typo
- adjust to change on website where identifiers are now no longer prefixed with `_`; detect similar change
0.3.11
- add a notice with regards to the service used being discontinued - this tool may need to be discontinued as well.
0.3.10
- support gzipped index html
0.3.9
- adjusted to change on website where identifiers are now prefixed with `_`
- added simple matching for partial identifiers
0.3.8
- fixed behaviour to download current Python version of package unless 'last' is specified for '--python'
0.3.6 / 0.3.7
- Changed version import for setup.py, as it was causing dependency problems
0.3.5
- Downgraded Python requirement to 3.6
0.3.4
- Improved message for missing packages
0.3.3
- 'Bare' mode added to capture written wheel
- Project structure cleanup (`script` folder, version location)
0.3.2
- Versioning issues resolved
- Documentation fix
- Short command line switches
0.3.1
- Added command line tool. Added 'User-Agent' to file retrieve as well as index.
0.3.0
- Flipped default for `python` parameter, favouring the current Python over the most recent
0.2.9
- added a user agent header field, as the site no longer serves a basic Python client
0.2.8
- open release, version conflict
Raw data
{
"_id": null,
"home_page": "https://github.com/jaapvandervelde/gohlkegrabber",
"name": "gohlkegrabber",
"maintainer": null,
"docs_url": null,
"requires_python": null,
"maintainer_email": null,
"keywords": "package, download, gohlke, wheel",
"author": "BMT, Jaap van der Velde",
"author_email": "jaap.vandervelde@bmtglobal.com",
"download_url": "https://files.pythonhosted.org/packages/7b/74/391a5dacef791c58756e810870b2dda396e76530419e73a5ae8544c5185d/gohlkegrabber-0.3.13.tar.gz",
"platform": null,
"description": "# Gohlke Grabber\n\n**NOTICE**: 2024 and onwards. The original site is no longer available. Check [Christoph Gohlke's personal site](https://www.cgohlke.com/) for details, and check his GitHub repos mentioned there for anything you may have hoped to obtain from the original site. Finally, consider using Conda for package management in your project, possibly with the open conda-forge channel. Most of the packages I used to obtain from Gohlke's site are available there. I like [the miniforge distribution](https://github.com/conda-forge/miniforge).\n\n**NOTICE**: On 12 June 2022, this message appeared on the site Christoph Gohlke maintains: \"Updated on 12 June 2022 at 20:19 UTC. Funding for the Laboratory for Fluorescence Dynamics has ceased. This service will be discontinued before July 2022.\" However, later that month this notice disappeared. The status of the site is unclear - this means that this tool may stop working as well; there's nothing I can do about that within reason, so I will likely remove this project if Gohlke can no longer maintain their site. \n\nSimple script to download .whl packages from the pre-built Python packages at https://www.lfd.uci.edu/~gohlke/pythonlibs.\n\nChristoph Gohlke maintains 32-bit and 64-bit binaries for many popular scientific Python packages. These can save you some trouble in cases where getting the package from PyPI (using `pip install package_name`) causes pip to try and build underlying C or C++ code. This can of course be made to work on Windows, but requires the installation and configuration of a C/++ compiler and libraries - both of which come standard with a Linux installation, but not with Windows.\n\nSo, if you have issues installing a package, you trust Gohlke's build, and you want something easy that helps automate the download, grab a copy of [gohlkegrabber.py](https://github.com/jaapvandervelde/gohlkegrabber/blob/master/gohlkegrabber/gohlkegrabber.py) and call it like shown below or in [download.py](https://github.com/jaapvandervelde/gohlkegrabber/blob/master/example/download.py).\n\nOf course, once you have a wheel (a file with the `.whl` extension), you can install it using:\n```cmd\npip install path\\to\\saved\\location\\name.whl\n```\n\n<i>Please don't bother Christoph Gohlke or their organisation if there are issues with this tool. If it breaks, that's my fault and you should bother me with it, or ideally propose how to fix it. They just provide a valuable service at no cost and merely deserve credit.</i>\n\n## Installing\n\n```cmd\npip install gohlkegrabber\n```\n\n## Dependencies\n\nDependencies that will be installed :\n```\nlxml>=4.4.2\n```\n\n## Getting Started\n\n### Quick\n\nAfter installing, to get a recent copy of `gdal`:\n```python\nfrom gohlkegrabber import GohlkeGrabber\ngg = GohlkeGrabber()\ngg.retrieve('c:/temp', 'gdal')\n```\n\nOr, directly from the command line:\n```commandline\nggrab c:\\temp gdal\n```\nNote that `ggrab` takes the same arguments as the `.retrieve()` method, except that positional arguments come after named arguments, as this is the convention on OS CLIs. For example:\n```commandline\nggrab -v 1.18 --platform win32 .\\bin numpy\n```\nThe CLI command `ggrab` also takes an additional argument `--cache` if you want to specify a cached index file to use, for example:\n```commandline\nggrab --cache c:\\temp\\cache.html . numpy\n```\nIf you run `ggrab` from the command line, you can also pass `--bare` or `-x` \n```commandline\npip install gohklegrabber\nfor /f \"tokens=*\" %i in ('ggrab --bare c:\\temp numpy') do set ggrab_last_package=%i\npip install %ggrab_last_package%\n```\nOr in a batch file:\n```commandline\n@echo off\npip install gohklegrabber\nfor /f \"tokens=*\" %%i in ('ggrab --bare c:\\temp numpy') do set ggrab_last_package=%%i\npip install %ggrab_last_package%\n```\n\n### In greater detail\n\nWhen you create a `GohlkeGrabber`, it automatically downloads the index from the website (or reads a cached copy) and figures out all the packages on offer. Of course, this requires an active connection to the web. \n\nYou can list the available packages:\n```python\nprint(list(gg.packages))\n```\nNote that `.packages` is a `dict` - of course you can just use the dictionary directly and the data therein yourself as well. For example, this is what the start of the `numpy` entry looks like:\n```python\n{\n 'numpy-1.16.5+mkl-cp27-cp27m-win32.whl': {\n 'link': 'https://download.lfd.uci.edu/pythonlibs/t7epjj8p/numpy-1.16.5+mkl-cp27-cp27m-win32.whl',\n 'version': '1.16.5+mkl',\n 'build': None,\n 'python': '2.7',\n 'abi': 'cp27m',\n 'platform': 'win32'\n },\n 'numpy-1.16.5+mkl-cp27-cp27m-win_amd64.whl': ...\n}\n```\n\nTo download the latest version (default) of `numpy`, for Windows 64-bit (default), and for the most recent version of Python (default) for which it is available, you would call:\n```python\nfn, metadata = gg.retrieve(output_folder, 'numpy')\n```\n\n`fn` will be the filename of the wheel that was downloaded. `metadata` will be a dictionary with the metadata for the downloaded wheel. Both will be `None` if no package could be downloaded that matched the request. \n\nAn example of what the metadata would look like:\n```python\n{\n 'link': 'https://download.lfd.uci.edu/pythonlibs/t7epjj8p/numpy-1.17.4+mkl-cp38-cp38-win_amd64.whl',\n 'version': '1.17.4+mkl',\n 'build': None,\n 'python': '3.8',\n 'abi': 'cp38',\n 'platform': 'win_amd64'\n}\n```\nNote that this is just the appropriate entry from the `.packages` `dict`.\n\nTo get a copy for a specific Python version (e.g. 2.7), Windows version (e.g. 32-bit) and package version (e.g. '<1.17'), you can provide extra parameters to the call in no particular order:\n```python\nfn, metadata = gg.retrieve(output_folder, 'numpy', python='2.7', platform='win32', version='<1.17')\n```\n\nAny file downloaded will be stored in the `output_folder`. \n\nIf the file already exists, it won't be downloaded again, unless you pass `overwrite=True` to the `.retrieve()` call. \n\nIf you create the GohlkeGrabber with a `cached` parameter, it will save the downloaded web page to that location, or load that file instead of downloading it again, if it already exists.\n```python\ngg = GohlkeGrabber(cached='work/cache.html')\n```\n\n## License\n\nThis project is licensed under the MIT license. See [LICENSE.txt](https://github.com/jaapvandervelde/gohlkegrabber/blob/master/LICENSE.txt).\n\n\n## Change log\n\n0.3.12\n- remove notice, as the notice on the source website has been taken down.\n- fix a partial match problem with a `starts_with` typo\n- adjust to change on website where identifiers are now no longer prefixed with `_`; detect similar change \n\n0.3.11\n- add a notice with regards to the service used being discontinued - this tool may need to be discontinued as well.\n\n0.3.10\n- support gzipped index html\n\n0.3.9\n- adjusted to change on website where identifiers are now prefixed with `_` \n- added simple matching for partial identifiers\n\n0.3.8\n- fixed behaviour to download current Python version of package unless 'last' is specified for '--python'\n\n0.3.6 / 0.3.7\n- Changed version import for setup.py, as it was causing dependency problems\n\n0.3.5\n- Downgraded Python requirement to 3.6\n\n0.3.4\n- Improved message for missing packages\n\n0.3.3\n- 'Bare' mode added to capture written wheel\n- Project structure cleanup (`script` folder, version location)\n\n0.3.2\n- Versioning issues resolved \n- Documentation fix\n- Short command line switches\n\n0.3.1\n- Added command line tool. Added 'User-Agent' to file retrieve as well as index.\n\n0.3.0\n- Flipped default for `python` parameter, favouring the current Python over the most recent\n\n0.2.9\n- added a user agent header field, as the site no longer serves a basic Python client\n\n0.2.8\n- open release, version conflict",
"bugtrack_url": null,
"license": "MIT",
"summary": "Simple script to download .whl packages from www.lfd.uci.edu/~gohlke/pythonlibs.",
"version": "0.3.13",
"project_urls": {
"Download": "https://github.com/jaapvandervelde/gohlkegrabber/archive/v0.3.13.tar.gz",
"Homepage": "https://github.com/jaapvandervelde/gohlkegrabber"
},
"split_keywords": [
"package",
" download",
" gohlke",
" wheel"
],
"urls": [
{
"comment_text": "",
"digests": {
"blake2b_256": "7b74391a5dacef791c58756e810870b2dda396e76530419e73a5ae8544c5185d",
"md5": "504db413598460958a75fd173f72d781",
"sha256": "7b704f34e51f74bd849968beb04fc9771e0b7340513fdce33e8bd6aaf5b8b1c4"
},
"downloads": -1,
"filename": "gohlkegrabber-0.3.13.tar.gz",
"has_sig": false,
"md5_digest": "504db413598460958a75fd173f72d781",
"packagetype": "sdist",
"python_version": "source",
"requires_python": null,
"size": 12102,
"upload_time": "2025-01-09T22:44:50",
"upload_time_iso_8601": "2025-01-09T22:44:50.208693Z",
"url": "https://files.pythonhosted.org/packages/7b/74/391a5dacef791c58756e810870b2dda396e76530419e73a5ae8544c5185d/gohlkegrabber-0.3.13.tar.gz",
"yanked": false,
"yanked_reason": null
}
],
"upload_time": "2025-01-09 22:44:50",
"github": true,
"gitlab": false,
"bitbucket": false,
"codeberg": false,
"github_user": "jaapvandervelde",
"github_project": "gohlkegrabber",
"travis_ci": false,
"coveralls": false,
"github_actions": false,
"requirements": [
{
"name": "lxml",
"specs": [
[
">=",
"4.4.2"
]
]
}
],
"lcname": "gohlkegrabber"
}