<commit_before># MediaWiki database

This library provides a set of utilities for connecting to and querying a
MediaWiki database.

* **Installation:** ``pip install mwdb``
* **Documentation:** https://pythonhosted.org/mwdb
* **License:** MIT

## Basic example

    >>> import mwdb
    >>> enwiki = mwdb.Schema("mysql+pymysql://enwiki.labsdb/enwiki_p" +
    ...                     "?read_default_file=~/replica.my.cnf")
    >>>
    >>> with enwiki.session() as session:
    ...     print(session.query(enwiki.user)
    ...           .filter_by(user_name="EpochFail")
    ...           .first())
    ...
    (6396742, b'EpochFail', b'', None, None, None, None, None, None, None,
    None, None, b'20080208222802', None, 4270, None)
    >>> result = enwiki.execute("SELECT * FROM user WHERE user_id=:user_id",
    ...                         {'user_id': 6396742})
    >>>
    >>> print(result.fetchone())
    (6396742, b'EpochFail', b'', None, None, None, None, None, None, None,
    None, None, b'20080208222802', None, 4270, None)<commit_msg>Adds author to readme<commit_after># MediaWiki database

This library provides a set of utilities for connecting to and querying a
MediaWiki database.

* **Installation:** ``pip install mwdb``
* **Documentation:** https://pythonhosted.org/mwdb
* **License:** MIT

## Basic example

    >>> import mwdb
    >>> enwiki = mwdb.Schema("mysql+pymysql://enwiki.labsdb/enwiki_p" +
    ...                     "?read_default_file=~/replica.my.cnf")
    >>>
    >>> with enwiki.session() as session:
    ...     print(session.query(enwiki.user)
    ...           .filter_by(user_name="EpochFail")
    ...           .first())
    ...
    (6396742, b'EpochFail', b'', None, None, None, None, None, None, None,
    None, None, b'20080208222802', None, 4270, None)
    >>> result = enwiki.execute("SELECT * FROM user WHERE user_id=:user_id",
    ...                         {'user_id': 6396742})
    >>>
    >>> print(result.fetchone())
    (6396742, b'EpochFail', b'', None, None, None, None, None, None, None,
    None, None, b'20080208222802', None, 4270, None)

## Author
* <NAME> -- https://github.com/halfak
{'fraction_non_alphanumeric': 0.1726551563229118, 'fraction_numerical': 0.05319645356976201, 'mean_word_length': 2.728695652173913, 'pattern_counts': {'":': 0, '<': 4, '<?xml version=': 0, '>': 46, 'https://': 3, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '3966816', 'n_tokens_mistral': 802, 'n_tokens_neox': 714, 'n_words': 167}