Package: gohlkegrabber
Gohlke GrabberNOTICE: 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 athttps://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 (usingpip 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 ofgohlkegrabber.pyand call it like shown below or indownload.py.Of course, once you have a wheel (a file with the.whlextension), you can install it using:pip install path\to\saved\location\name.whlPlease 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.Installingpip install gohlkegrabberDependenciesDependencies that will be installed :lxml>=4.4.2Getting StartedQuickAfter installing, to get a recent copy ofgdal:fromgohlkegrabberimportGohlkeGrabbergg=GohlkeGrabber()gg.retrieve('c:/temp','gdal')Or, directly from the command line:ggrab c:\temp gdalNote thatggrabtakes 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:ggrab -v 1.18 --platform win32 .\bin numpyThe CLI commandggrabalso takes an additional argument--cacheif you want to specify a cached index file to use, for example:ggrab --cache c:\temp\cache.html . numpyIf you runggrabfrom the command line, you can also pass--bareor-xpip 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:@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 detailWhen you create aGohlkeGrabber, 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:print(list(gg.packages))Note that.packagesis adict- of course you can just use the dictionary directly and the data therein yourself as well. For example, this is what the start of thenumpyentry looks like:{'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) ofnumpy, for Windows 64-bit (default), and for the most recent version of Python (default) for which it is available, you would call:fn,metadata=gg.retrieve(output_folder,'numpy')fnwill be the filename of the wheel that was downloaded.metadatawill be a dictionary with the metadata for the downloaded wheel. Both will beNoneif no package could be downloaded that matched the request.An example of what the metadata would look like:{'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.packagesdict.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:fn,metadata=gg.retrieve(output_folder,'numpy',python='2.7',platform='win32',version='<1.17')Any file downloaded will be stored in theoutput_folder.If the file already exists, it won't be downloaded again, unless you passoverwrite=Trueto the.retrieve()call.If you create the GohlkeGrabber with acachedparameter, it will save the downloaded web page to that location, or load that file instead of downloading it again, if it already exists.gg=GohlkeGrabber(cached='work/cache.html')LicenseThis project is licensed under the MIT license. SeeLICENSE.txt.Change log0.3.12remove notice, as the notice on the source website has been taken down.fix a partial match problem with astarts_withtypoadjust to change on website where identifiers are now no longer prefixed with_; detect similar change0.3.11add a notice with regards to the service used being discontinued - this tool may need to be discontinued as well.0.3.10support gzipped index html0.3.9adjusted to change on website where identifiers are now prefixed with_added simple matching for partial identifiers0.3.8fixed behaviour to download current Python version of package unless 'last' is specified for '--python'0.3.6 / 0.3.7Changed version import for setup.py, as it was causing dependency problems0.3.5Downgraded Python requirement to 3.60.3.4Improved message for missing packages0.3.3'Bare' mode added to capture written wheelProject structure cleanup (scriptfolder, version location)0.3.2Versioning issues resolvedDocumentation fixShort command line switches0.3.1Added command line tool. Added 'User-Agent' to file retrieve as well as index.0.3.0Flipped default forpythonparameter, favouring the current Python over the most recent0.2.9added a user agent header field, as the site no longer serves a basic Python client0.2.8open release, version conflict