Uploaded image for project: 'Bitbucket Cloud'
  1. Bitbucket Cloud
  2. BCLOUD-13873

Use Bitbucket api and python to download repo in zip

    XMLWordPrintable

Details

    Description

      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.

      Attachments

        Activity

          People

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

            Dates

              Created:
              Updated:
              Resolved: