This is a pre-production deployment of Warehouse, however changes made here WILL affect the production instance of PyPI.
Latest Version Dependencies status unknown Test status unknown Test coverage unknown
Project Description

# MediaWiki database

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

The Schema() object is a thin wrapper around a sqlalchemy Engine and Meta adapts to the local database setup. When using Schema()’s member table ORM, the internal mapping will translate between public replicas views (e.g. revision_userindex, logging_userindex and logging_logindex) transparently. This allows you to write one query that will run as expected on either schema.

At the moment, the execute() method does not make any such conversion, but a helper attribute public_replica that is True when querying a views via a public replica and False when querying the production database.

## Example

>>> import mwdb
>>> enwiki = mwdb.Schema("mysql+pymysql://enwiki.labsdb/enwiki_p" +
...                      "?read_default_file=~/replica.my.cnf")
>>> enwiki.public_replica
True
>>>
>>> with enwiki.transaction() as session:
...     print(session.query(enwiki.revision_userindex)
...           .filter_by(rev_user_text="EpochFail")
...           .count())
...
4302
>>> result = enwiki.execute("SELECT COUNT(*) FROM revision_userindex " +
...                         "WHERE rev_user=:user_id",
...                         {'user_id': 6396742})
>>>
>>> print(result.fetchone())
(4302,)

## Authors * Aaron Halfaker – https://github.com/halfak

Release History

Release History

0.1.0

This version

History Node

TODO: Figure out how to actually get changelog content.

Changelog content for this version goes here.

Donec et mollis dolor. Praesent et diam eget libero egestas mattis sit amet vitae augue. Nam tincidunt congue enim, ut porta lorem lacinia consectetur. Donec ut libero sed arcu vehicula ultricies a non tortor. Lorem ipsum dolor sit amet, consectetur adipiscing elit.

Show More

0.0.1

History Node

TODO: Figure out how to actually get changelog content.

Changelog content for this version goes here.

Donec et mollis dolor. Praesent et diam eget libero egestas mattis sit amet vitae augue. Nam tincidunt congue enim, ut porta lorem lacinia consectetur. Donec ut libero sed arcu vehicula ultricies a non tortor. Lorem ipsum dolor sit amet, consectetur adipiscing elit.

Show More

Download Files

Download Files

TODO: Brief introduction on what you do with files - including link to relevant help section.

File Name & Checksum SHA256 Checksum Help Version File Type Upload Date
mwdb-0.1.0-py2.py3-none-any.whl (7.3 kB) Copy SHA256 Checksum SHA256 3.4 Wheel Oct 2, 2015
mwdb-0.1.0.tar.gz (4.5 kB) Copy SHA256 Checksum SHA256 Source Oct 2, 2015

Supported By

WebFaction WebFaction Technical Writing Elastic Elastic Search Pingdom Pingdom Monitoring Dyn Dyn DNS HPE HPE Development Sentry Sentry Error Logging CloudAMQP CloudAMQP RabbitMQ Heroku Heroku PaaS Kabu Creative Kabu Creative UX & Design Fastly Fastly CDN DigiCert DigiCert EV Certificate Rackspace Rackspace Cloud Servers DreamHost DreamHost Log Hosting