Skip to content

Instantly share code, notes, and snippets.

@jugmac00
Last active July 21, 2022 17:20
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save jugmac00/a77af7e4554de3042440fda8cfc10ce9 to your computer and use it in GitHub Desktop.
Save jugmac00/a77af7e4554de3042440fda8cfc10ce9 to your computer and use it in GitHub Desktop.
get some infos about the PPas of a team
"""
Usage:
- create and activate a virtual env
- `pip install launchpadlib`
- run `python main.py https://launchpad.net/~deadsnakes`
API:
https://launchpad.net/+apidoc/devel.html
Getting started:
https://help.launchpad.net/API/launchpadlib
"""
from argparse import ArgumentParser
from urllib.parse import urlparse
from launchpadlib.launchpad import Launchpad
parser = ArgumentParser()
parser.add_argument("team", help="Full URL to a team")
args = parser.parse_args()
launchpad = Launchpad.login_anonymously(
"testing", "production", version="devel"
)
if args.team:
team = launchpad.load(urlparse(args.team).path)
ppas = team.ppas
for ppa in ppas:
for ps in ppa.getPublishedBinaries():
print(ps.display_name)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment