GithubHelp home page GithubHelp logo

pombredanne / repodataparser Goto Github PK

View Code? Open in Web Editor NEW

This project forked from iuscommunity/repodataparser

0.0 0.0 0.0 60 KB

A class for reading a Yum repos primary.xml.gz and returning data

License: GNU General Public License v2.0

repodataparser's Introduction

Usage for RepoParser

>>> from RepoParser.RepoParser import Parser
>>> p = Parser(url='http://dl.iuscommunity.org/pub/ius/stable/Redhat/5/SRPMS/repodata/primary.xml.gz')

Query a single Package

>>> package = p.getPackage('php53u')

There can be more than one package by the same name in a repo (differnt versions)

>>> len(package)
1

The package has the following keys

>>> package[0].keys()
[u'description', u'format', u'url', u'checksum', u'summary', u'version', u'location', u'time',
u'packager', u'size', u'arch', u'name']

Each key is a tuple of value / attributes, but not all keys will have both

>>> package[0]['name']
(u'php53u', None)

>>> package[0]['version']
(None, {u'epoch': u'0', u'ver': u'5.3.17', u'rel': u'2.ius.el5'})

>>> package[0]['version'][1]['ver']
u'5.3.17'

Our you can get all packages from a repo using getList:

>>> [ i['name'][0] for i in p.getList() ]
[u'php53u-suhosin', u'php54-pecl-mysqlnd-ms', u'mysql50', u'php54-pgsql84', u'php52-suhosin',
u'php52-pear', u'python26-memcached', u'php53u-pear', u'php53u-pgsql84', u'php52-pecl-apc',
u'php53u-ioncube-loader', u'mysql55', u'rsyslog4', u'php53u-pecl-imagick', u'php54-pecl-imagick',
u'php53u-pecl-apc', u'php53u-pecl-geoip', u'php52-ioncube-loader', u'php52-pecl-geoip',
u'php52-xcache', u'yum-plugin-replace', u'python31-redis', u'php53u', u'python26-jsonschema',
u'php54-ioncube-loader', u'python26-lxml', u'epel-release', u'php54-xcache', u'php54-pecl-geoip',
u'php53u-pecl-memcached', u'php52-pecl-xdebug', u'php54-suhosin', u'php53u-eaccelerator',
u'php52', u'php54-pear', u'python31', u'php54', u'php53u-pecl-memcache', u'python26-elixir',
u'php52-pecl-imagick', u'mysqlclient15', u'mysql51', u'python31-hiredis', u'php53u-pecl-xdebug',
u'php52-eaccelerator', u'php54-pecl-xdebug', u'php53u-xcache', u'python31-mod_wsgi',
u'ius-release', u'php54-pecl-memcache', u'autoconf26x', u'python31-postgresql',
u'php52-pecl-memcache', u'php54-pecl-apc', u'python31-distribute']

repodataparser's People

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.