Allow user to override freezefile.
This commit is contained in:
parent
bbfdb2e64b
commit
1a25fbcd77
@ -16,6 +16,8 @@ parser = argparse.ArgumentParser(
|
|||||||
epilog='For further information, please check the documentation.')
|
epilog='For further information, please check the documentation.')
|
||||||
parser.add_argument('config', metavar='CONFIG', type=str,
|
parser.add_argument('config', metavar='CONFIG', type=str,
|
||||||
help='freeze file cofiguration')
|
help='freeze file cofiguration')
|
||||||
|
parser.add_argument('--db', default=None,
|
||||||
|
help='Override the freezefile database URI')
|
||||||
|
|
||||||
|
|
||||||
def freeze(result, format='csv', filename='freeze.csv',
|
def freeze(result, format='csv', filename='freeze.csv',
|
||||||
@ -91,6 +93,8 @@ def main():
|
|||||||
args = parser.parse_args()
|
args = parser.parse_args()
|
||||||
config = Configuration(args.config)
|
config = Configuration(args.config)
|
||||||
for export in config.exports:
|
for export in config.exports:
|
||||||
|
if args.db is not None:
|
||||||
|
export.data['database'] = args.db
|
||||||
if export.skip:
|
if export.skip:
|
||||||
log.info("Skipping: %s", export.name)
|
log.info("Skipping: %s", export.name)
|
||||||
continue
|
continue
|
||||||
|
|||||||
@ -22,7 +22,10 @@ freeze file as its argument:
|
|||||||
|
|
||||||
datafreeze Freezefile.yaml
|
datafreeze Freezefile.yaml
|
||||||
|
|
||||||
Freeze files can be either written in JSON or in YAML.
|
Freeze files can be either written in JSON or in YAML. The database URI
|
||||||
|
indicated in the Freezefile can also be overridden via the command line:
|
||||||
|
|
||||||
|
datafreeze --db sqlite:///foo.db Freezefile.yaml
|
||||||
|
|
||||||
|
|
||||||
Example Freezefile.yaml
|
Example Freezefile.yaml
|
||||||
|
|||||||
2
setup.py
2
setup.py
@ -2,7 +2,7 @@ from setuptools import setup, find_packages
|
|||||||
|
|
||||||
setup(
|
setup(
|
||||||
name='dataset',
|
name='dataset',
|
||||||
version='0.3.2',
|
version='0.3.3',
|
||||||
description="Toolkit for Python-based data processing.",
|
description="Toolkit for Python-based data processing.",
|
||||||
long_description="",
|
long_description="",
|
||||||
classifiers=[
|
classifiers=[
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user