Use Bitbucket api and python to download repo in zip

XMLWordPrintable

      I use python3.5.0 ,bitbucket-api 0.5.0 on windows 10.

      This is my code

      #!python
      
      >>>from bitbucket.bitbucket importBitbucket
      >>>USERNAME = 'CCC'
      >>>PASSWORD = 'BBB'
      >>>bb = Bitbucket(USERNAME, PASSWORD, repo_name_or_slug="Py-Bitbucket-api")
      >>>success, result = bb.repository.get()
      >>>print (bb.repository.get())
      True{......}
      >>>success, archive_path = bb.repository.archive()
      >>> print (success, archive_path)
      True C:\....\Temp\tmp_zxpa_14
      

      It download some tmp files. (tmp_zxpa_14.....) but it not a zip .

      Do I miss some parameter?

      I read the repository.py the function

      archive(self, repo_slug=None, format='zip', prefix='':

      format default 'zip' .Did I understand wrong?

      BTW

      Can Bitbucket-api specify the file to download?

      How to modify my code?

      I wandt to download one of file in my repo.

              Assignee:
              Unassigned
              Reporter:
              eastek_claire
              Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

                Created:
                Updated:
                Resolved: