Upload a CSV, get back a Budget Data Package.
(This is a very, very early first draft.)
We recommend you install it using virtualenv:
virtualenv venv
Then install the requirements:
pip install -r requirements.txt
Celebrate, because you've installed everything!
The webapp is configured via environment variables:
BDP_CSV_UPLOAD_DIRsets the path to the directory where uploaded csv files will be placed. Default iscsv-uploadsin the code base's root.BDP_METADATA_DIRsets the path to the diretory where the generated metadata files wil be placed. Default ismetadatain the code base's root.BDP_DATA_DIRsets the path for a data directory with configuration files like currencies used by the software. Default isdatain the code base's root and it should probably be left that way unless you know what you're doing.BDP_ZIPFILE_DIRsets the path to the directory where the zipfile of the budget data packages will be stored. Default isbdpin the code base's root.BDP_ALLOWED_EXTENSIONSis a comma separated list of extensions for the CSV files that can be uploaded. Default is only one file extension: csv.BDP_DEBUGsets a boolean true or false to indicate if server should be run in debug mode. Default is false (not run in debug mode).
To configure S3 support further environment variables are needed:
AWS_ACCESS_KEY_IDsets the access key id for S3AWS_SECRET_ACCESS_KEYsets the secret access key (sshh... don't tell anyone)BDP_S3_BUCKETsets the bucket name where all the csv files and buckets will be storedBDP_S3_HTTPsets the URL for the HTTP fron of the S3 bucket. This is needed to serve the budget data packages from the web interfaceBDP_S3_CSV_PREFIXsets the prefix used in the keys for the csv files on S3. Default is csv/ (note: if you skip trailing slash it will be a general prefix)BDP_S3_BDP_PREFIXsets the prefix used in the keys for the budget data packages themselves. The metadata files will stored at {THIS PREFIX}{PACKAGE NAME}/datapackage.json. Default is bdp/ (note: if you skip the thrailing slash it will be a general prefix
To run the server, after setting all environment variables as you need them to be, just run (with your virtualenv activated, if you're using one):
python run.py