Пример #1
0
def metadata():
    usage = '%prog dburl table [edgemart]'
    op = optparse.OptionParser(usage=usage)
    op.add_option('-o', '--output', metavar='FILENAME',
                  help='output data to FILENAME', default=sys.stdout)

    opts, args = op.parse_args()

    if opts.output != sys.stdout:
        opts.output = open(opts.output, 'w')

    dburl = get_arg(op, args, 'missing dburl, [postgres://username:password@localhost/database]')
    schema, table = get_schema_table(op, args)
    metadata = db.metadata_dict(dburl, table, schema=schema)

    json.dump(metadata, opts.output, sort_keys=True, indent=4)
Пример #2
0
def table():
    usage = '%prog dburl table [edgemart]'
    op = optparse.OptionParser(usage=usage)
    op.add_option('--wsdl', default='wsdl_partner.xml')
    options, args = op.parse_args()
    username, password, token = get_credentials(op)

    dburl = get_arg(op, args, 'missing dburl, [postgres://username:password@localhost/database]')
    schema, table = get_schema_table(op, args)
    edgemart = get_arg(op, args, default=table)

    metadata = db.metadata_dict(dburl, table, schema=schema)
    data = db.data_generator(dburl, table, schema=schema)

    uploader = AnalyticsCloudUploader(metadata, data)
    uploader.login(options.wsdl, username, password, token)
    uploader.upload(edgemart)
Пример #3
0
def table():
    usage = '%prog dburl table [edgemart]'
    op = optparse.OptionParser(usage=usage)
    op.add_option('--wsdl', default='wsdl_partner.xml')
    options, args = op.parse_args()
    username, password, token = get_credentials(op)

    dburl = get_arg(
        op, args,
        'missing dburl, [postgres://username:password@localhost/database]')
    schema, table = get_schema_table(op, args)
    edgemart = get_arg(op, args, default=table)

    metadata = db.metadata_dict(dburl, table, schema=schema)
    data = db.data_generator(dburl, table, schema=schema)

    uploader = AnalyticsCloudUploader(metadata, data)
    uploader.login(options.wsdl, username, password, token)
    uploader.upload(edgemart)
Пример #4
0
def metadata():
    usage = '%prog dburl table [edgemart]'
    op = optparse.OptionParser(usage=usage)
    op.add_option('-o',
                  '--output',
                  metavar='FILENAME',
                  help='output data to FILENAME',
                  default=sys.stdout)

    opts, args = op.parse_args()

    if opts.output != sys.stdout:
        opts.output = open(opts.output, 'w')

    dburl = get_arg(
        op, args,
        'missing dburl, [postgres://username:password@localhost/database]')
    schema, table = get_schema_table(op, args)
    metadata = db.metadata_dict(dburl, table, schema=schema)

    json.dump(metadata, opts.output, sort_keys=True, indent=4)