mangiafico / eurlex-python

a simple Python library for EUR-Lex

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

EUR-Lex Python

a simple Python library for EUR-Lex

The primary purpose of this library is to identify components of the English language documents available through EUR-Lex.

EUR-Lex documents are described using the FRBR Work/Expression/Manifestation/Item vocabulary. The query function in this library returns an iterable of Work objects, each of which provides information about a document, its English expression, and all of its English manifestations and items. It requires registration credentials with the EUR-Lex Webservice. Any expert search is permitted; by default queries are limited to the Legislation collection (DTS = 3).

For example, the following code prints information about each item:

from eurlex import EUR_Lex

for work in EUR_Lex.query(username, password):
    print()
    print('CELEX:', work.celex)
    print('type:', work.type)
    print('year:', work.year)
    print('number:', work.number)
    print('date:', work.date)
    exp = work.english_expression
    print('  language:', exp.language)
    print('  title:', exp.title)
    for manifest in exp.manifestations:
        print('    format:', manifest.format)
        for item in manifest.items:
            print('      uri:', item.uri)
            print('      filename:', item.filename)

About

a simple Python library for EUR-Lex


Languages

Language:Python 100.0%