def main(args): """Main entry point allowing external callreleasess Args: args ([str]): command line parameter list """ args = parse_args(args) setup_logging(args.loglevel) _logger.debug("Starting Analysis...") ip = InstalledPackages() ind = Index() if args.list: pprint(ip.list_installed()) elif args.releases is not None: pprint(ind.get_latest_releases(package_name=args.releases[0])) elif args.popularity is not None: pprint(ind.get_popularity(package_name=args.popularity[0])) elif args.info is not None: results = ind.package_info(pkgn=args.info[0]) print("Name: {} \nDescription: {}".format(*results)) elif args.release_series is not None: pprint(ind.release_series(package_name=args.release_series[0])) _logger.info("Done")
def index(self): return Index()
def test_package_info(self): ind = Index() result = ind.package_info("numpy") assert isinstance(result, tuple)
def test_rank_of_packages_by_recent_release(self): aa = Index().rank_of_packages_by_recent_release(size=20) assert len(aa) == 20