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

This is a simple library to help building .mdx scripts. It is composed by:

  • A simple syntax module to generate mdx
  • Functions to generate mdx sets from lists, .json arrays or prefined .mdx sets
  • A writer class and a writer context manager


pip install mdx


# Usage
from mdx import syntax as s
from mdx import MDXSetConstructor, writerContext
from mdx import loadJson, loadMDX

toyCodeBuilder = MDXSetConstructor(memberPath="[Products].[ProductName]", comment="Product Codes")
colorCodeBuilder = MDXSetConstructor(memberPath="[Colors]", comment="Color Codes")

toys = {
  'dolls' : toyCodeBuilder(codeList=[1,2,3], listName="toy dolls")

colors = {
  'blue' : colorCodeBuilder(codeList=['blue', 'cyan'], listName="blues")

# Loads .mdx files in path
# Each file becomes available as a tuple member with the file name as key
toys = loadMDX(
  extraMembers = toys, # Add extra members defined by hand

# Loads .json files in path
# Each file becomes available as a member of a named tuple with the file name as field
colors = loadJSON(
  extraMembers = colors,  # Add extra members defined by hand

# The first two arguments are passed automatically by the context manager
def volume(writer, sets, name, *expressions, **kwargs):

  # Perform some common .mdx operations here...

      s.sumExisting('[Measures].[PurchaseCount]', s.intersect(*expressions)

writer = MDXWriter(name='writer', path='./interestingToys') # by default the path is set on config["OUTPUT_FOLDER"]

# Putting it all together
with writerContext((toys, colors), writer) as (measures, config):

    # the writer and set variables are passed to the measure after the arguments
    'volume of interesting toy purchases',
      s.tuple(, colors.any),

# The output will be available at ./interestingToys.mdx

# Configuration options
from mdx import config
config["OUTPUT_FOLDER"] = "./path/to/folder"
config["LIST_BASE_PATH"] = "./path/to/folder"
config["TAB_SIZE"] = 2
Release History

Release History


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

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
mdx-0.1.tar.gz (18.6 kB) Copy SHA256 Checksum SHA256 Source Dec 30, 2015

Supported By

WebFaction WebFaction Technical Writing Elastic Elastic Search Pingdom Pingdom Monitoring Dyn Dyn DNS 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