Skip to main content

A library for parsing the french wiktionnary

Project description

WiktionnaireParser

A library for parsing the french wiktionary.

Installation

Supported Python versions : 3.6+

With Pip

pip install wiktionnaireparser

From source

python setup.py install

Usage

>>> from wiktionnaireparser import WiktionnaireParser as wiktp
>>> page = wiktp.from_source('nage PMT')
>>> page.get_etymology()
'Forme abrégée de nage avec palmes, masque et tuba.'
>>> page.get_parts_of_speech()
{'Locution nominale': ['(Plongée) Nage avec palmes, masque et tuba.']}

It is also possible to pick a word at random.

>>> page.random_page()
>>> page.get_title()
'décrocher'

Use get_word_data to extract and display all data

>>> from wiktionnaireparser import WiktionnaireParser as wtp
>>> page = wtp.from_source('anglophone')
>>> page.get_word_data
{
    'title': 'anglophone',
    'etymologies': 'Composé du préfixe latin anglo pour anglais et du suffixe -phone.',
    'partOfSpeech': {
        'Nom commun': {
            0: {
                'definition': 'Personne parlant la langue anglaise.',
                'examples': {
                    0: {
                        'example': 'La minorité anglaise avait également reçu, de façon encore plus discrète, une autre «\xa0protection\xa0»: le trésorier du Québec serait un anglophone, un anglophone choisi par les financiers. —\xa0(Laurent Laplante, Paul Berryman, 2000)'
                    }
                }
            },
            'translations': {
                'Allemand': ['Englischsprachige'],
                'Anglais': ['English-speaker', 'anglophone'],
                'Breton': ['saozneger'],
                'Catalan': ['anglòfon', 'anglòfona', 'angloparlant'],
                'Espagnol': ['anglófono', 'anglófona', 'anglohablante'],
                'Espéranto': ['anglalingvano'],
                'Italien': ['anglofono'],
                'Néerlandais': ['Engelstalige'],
                'Portugais': ['anglófono', 'anglofalante', 'angloparlante'],
                'Roumain': ['anglofon']
            },
            'pronunciation': ['ɑ̃.ɡlɔ.fɔn'],
            'gender': 'masculin et féminin identiques',
            'Dérivés': ['Anglo-Bami', 'anglo-fou', 'angryphone'],
            'Apparentés étymologiques': ['Angleterre', 'anglais', '-phone']
        },
        'Adjectif': {
            0: {
                'definition': 'De langue anglaise.',
                'examples': {
                    0: {
                        'example': "Selon plusieurs penseurs de l'époque, l'État québécois est le seul qui puisse rivaliser avec les grandes entreprises anglophones d'Amérique du Nord. —\xa0(Mathieu Bureau Meunier, Wake up mes bons amis!, Québec, Septentrion, 2019, p. 133.)"
                    }
                }
            },
            'translations': {
                'Allemand': ['englischsprachig'],
                'Anglais': ['anglophone'],
                'Espagnol': ['anglófono', 'anglohablante'],
                'Espéranto': ['anglalingva'],
                'Italien': ['anglofono'],
                'Kazakh': ['ағылшынтілді'],
                'Néerlandais': ['Engelstalig'],
                'Norvégien (bokmål)': ['engelskspråklig'],
                'Portugais': ['anglófono', 'anglofalante', 'angloparlante'],
                'Roumain': ['anglofon']
            },
            'pronunciation': ['ɑ̃.ɡlɔ.fɔn'],
            'gender': 'masculin et féminin identiques',
            'Dérivés': ['anglo-fou']
        }
    }
}

How to contribute

Contributions are more than welcome.

If you're new to Python and would like to contribute, get inspiration from the TODOs.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

wiktionnaireparser-0.1.tar.gz (14.6 kB view details)

Uploaded Source

Built Distribution

wiktionnaireparser-0.1-py3-none-any.whl (34.3 kB view details)

Uploaded Python 3

File details

Details for the file wiktionnaireparser-0.1.tar.gz.

File metadata

  • Download URL: wiktionnaireparser-0.1.tar.gz
  • Upload date:
  • Size: 14.6 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.2.0 pkginfo/1.5.0.1 requests/2.24.0 setuptools/50.3.1 requests-toolbelt/0.9.1 tqdm/4.50.2 CPython/3.6.12

File hashes

Hashes for wiktionnaireparser-0.1.tar.gz
Algorithm Hash digest
SHA256 280d3ccbdb830c065ea5753b9d7817fcdbdc23913b0116c10ecbe217104d30c2
MD5 48e092ee4d9bbbfa8c2e48f8e793f758
BLAKE2b-256 5908096a83c784b7d6a6adb0e4eea4f2542ac11365679d1d42b38a9da6b0895e

See more details on using hashes here.

File details

Details for the file wiktionnaireparser-0.1-py3-none-any.whl.

File metadata

  • Download URL: wiktionnaireparser-0.1-py3-none-any.whl
  • Upload date:
  • Size: 34.3 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.2.0 pkginfo/1.5.0.1 requests/2.24.0 setuptools/50.3.1 requests-toolbelt/0.9.1 tqdm/4.50.2 CPython/3.6.12

File hashes

Hashes for wiktionnaireparser-0.1-py3-none-any.whl
Algorithm Hash digest
SHA256 b69440165d261c4e1f519286515fc19b52af794896050313258188f777aefc8d
MD5 5fcc3fc78be81492521da586287d1842
BLAKE2b-256 0bd8c2f52ebccf28f8988091f0cebe40d08c7590213a93e580550e654ffb8305

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page