Python Forum
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Unpacking wheel files
#1
I am trying to open a .whl file.

I went to https://pypi.org/project/tidegravity which takes you into GitHub.

I then downloaded tidegravity-0.40b1-py3-none-any.whl into my Download file.

I want to unzip this so I can check the authors' algebra coincides with the
research paper they are working from.

Following https://wheel.readthedocs.io/en/stable I wrote various little programs along the lines of
unpack.py where unpack had two lines
wheel upack tidegravity-0.40b1-py3-none-any.whl
Unpacking to ./<some path>

I cannot get this to work. I made various obvious variants but it said unpack was a syntax error.
I checked that wheel was installed by trying >>>pip install wheel.

I missed something obvious - please tell me what !
Reply
#2
why would you need to unzip the wheel file? Just look at the github repo.
why would you write a py script to unzip the wheel? Just unzip it as regular archive with your program of choice and open the wheel or tar.gz file from pypi.

if you want to use wheel unpack tidegravity-0.4.0b1-py3-none-any.whl - you need to run this from cmd/terminal shell, not inside python module
if you still want to use py script - post your code in python tags and full traceback if you get any error.

import zipfile

with zipfile.ZipFile("tidegravity-0.4.0b1-py3-none-any.whl") as f:
    f.extractall('./somepath')
or

import subprocess

subprocess.run(['wheel', 'unpack', 'tidegravity-0.4.0b1-py3-none-any.whl'])
snippsat likes this post
If you can't explain it to a six year old, you don't understand it yourself, Albert Einstein
How to Ask Questions The Smart Way: link and another link
Create MCV example
Debug small programs

Reply
#3
As mention look at GitHub Repo
As long a setup.py(what is used to make the wheel) is not outdated.
Then files on Repo will be the same as the packed wheel.
Then using git make more sense if want files local.
G:\div_code
λ git clone https://github.com/bradyzp/LongmanTide.git
Cloning into 'LongmanTide'...
remote: Enumerating objects: 7, done.
remote: Counting objects: 100% (7/7), done.
remote: Compressing objects: 100% (7/7), done.
Receivinng objects:  92% (14emote: Total 161 (delta 0), reused 2 (delta 0), pack-reused 1549/161), 492.00 KiB | 302.00 KiB/s
Receiving objects: 100% (161/161), 538.28 KiB | 302.00 KiB/s, done.
Resolving deltas: 100% (67/67), done.
Checking connectivity... done.

G:\div_code
λ cd LongmanTide\

G:\div_code\LongmanTide (master)
λ ls
LICENSE  MANIFEST.in  README.rst  examples/  requirements.txt  setup.cfg  setup.py  tests/  tidegravity/
Reply
#4
OK Thank you all for this. I didn't understand how to use GitHub properly and I eventually found the code by poking my white stick here and there.

DavidTheGrockle
Reply


Possibly Related Threads…
Thread Author Replies Views Last Post
  Unpacking a dict with * or ** msrk 4 915 Dec-02-2023, 11:50 PM
Last Post: msrk
  iterate through the dict_values while unpacking the dictionary PeacockOpenminded 3 1,261 Jan-22-2023, 12:44 PM
Last Post: PeacockOpenminded
  Python wheel packages - how to add timestamp to the wheel name? vcankovic 0 938 Jul-06-2022, 12:04 PM
Last Post: vcankovic
  python wheel file Led_Zeppelin 1 1,157 Jun-15-2022, 04:08 PM
Last Post: Led_Zeppelin
  Unpacking zip object Mark17 12 3,103 Mar-28-2022, 04:59 PM
Last Post: deanhystad
  unpacking list wardancer84 2 1,837 Sep-11-2021, 02:42 PM
Last Post: wardancer84
  Building Wheel files (why would it ask for the wrong version?) coreyhanson 1 2,266 Jan-25-2021, 09:50 PM
Last Post: coreyhanson
  unpacking tuple not working project_science 1 1,451 Jan-09-2021, 09:09 PM
Last Post: buran
  Unpacking a list Mark17 3 2,555 Dec-18-2020, 05:08 AM
Last Post: aajkaal
  Why the result of "extended iterable unpacking" with set() is unpredictable? zohanlin 2 2,015 Jun-29-2020, 10:30 AM
Last Post: zohanlin

Forum Jump:

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020