{ "info": { "author": "Elizabeth Sall", "author_email": "easall@gmail.com", "bugtrack_url": null, "classifiers": [ "Development Status :: 3 - Alpha", "License :: OSI Approved :: Apache Software License", "Operating System :: OS Independent", "Programming Language :: Python :: 3" ], "description": "[![Build Status](https://travis-ci.org/e-lo/forecastcards.svg?branch=master)](https://travis-ci.org/e-lo/forecastcards)\n\n# What are forecast cards?\n\nForecast cards are a simple data specification for storing key information about your travel forecast in order to: \n - evaluate performance of a forecast over time, \n - analyze the collective performance of forecasting systems and institutions over time, and\n - identify contributing factors to high performing forecasts. \n\n\n## Overview of forecast cards\n\nThere five are types of Forecast Cards:\n - Points of Interest, such as a roadway segment or transit line,\n - Projects, such as a roadway expansion, an HOV designation,\n - Scenarios or runs, including information about the forecasting system\n - Forecasts, which are predictions at the points of interest about what the project will do,\n - Observations, which are points of data used to evaluate the the forecasts\n\nEach \"card\" is a text-based CSV file. \n\nThe forecastcards Python library is designed to validate and organize\ndata that conforms to the forecast cards data schema and consists of four main classes: \n 1. Cardset: a set of forecast data projects that conforms to the forecastcards data schema\n 2. Dataset: turns a cardset into a [pandas](https://pandas.pydata.org/) dataset suitable for estimation purposes\n 3. Project: to validate single projects (much of the same functionality as Cardset)\n 4. Schema: to manage and validate the data schemas\n\n### Basic Usage\n\n**Validate Single Project**\n\n```shell\nvalidate_project.py \"forecastcards/examples/ecdot-lu123-munchkin_tod\"\n```\n\n**Project**\n\n```python\n\nimport forecastcards\n\n# project locations can either be\n# - a dictionary describing a github location,\n# - a local directory, or\n# - a github web address.\n\ngh_project = {'username':'e-lo',\n 'repository':'forecastcards',\n 'branch':'master',\n 'subdir':'examples/ecdot-rx123-ybr_hov'}\n\n# load project and validate using default data schema\nproject = forecastcards.Project(project_location = gh_project)\n\n# check if project is valid\nproject.valid\n```\n**Cardset**\n\n```python\n\nimport forecastcards\n\n# project locations can either be\n# - a dictionary describing a github location or\n# - a local directory\n\ngh_data = {'username':'e-lo',\n 'repository':'forecastcards',\n 'branch':'master',\n 'subdir':'examples'}\n\n# cardset walks through a directory, finds projects, and validates them\n# according to the right schema.\n\n# projects can be excluded or explicitly selected using keyword options\ncardset = forecastcards.Cardset(data_loc = gh_data, exclude_projects=['lu123'])\ncardset.add_projects(data_loc=ex_data, select_projects=['lu123'])\n```\n\n**Dataset** \nCreate a dataset suitable for estimating quantile regressions. \n\n```python\n\nimport forecastcards\n\n# project locations can either be\n# - a dictionary describing a github location or\n# - a local directory\n\ngh_data = {'username':'e-lo',\n 'repository':'forecastcards',\n 'branch':'master',\n 'subdir':'examples'}\n\ncardset = forecastcards.Cardset(data_loc = gh_data)\ndataset = forecastcards.Dataset(card_locs_by_type = cardset.card_locs_by_type,\n file_to_project_id = cardset.file_to_project_id )\n\n# access to the dataframe\ndataset.df\n```\n\n\n### The Schema\n\n![entity relationship diagram](spec/en/forecast-cards-erd.png?raw=true \"Forecast Cards Schema Entity Relationship Diagram\")\n\n![Overview of data relationships](spec/en/forecast-cards-rg.png?raw=true \"Forecast Cards Data Relationships\")\n\nForecast Cards are compatible with the [Open Knowledge Foundation's]() [Frictionless Data](http://frictionlessdata.io) [Table Schema]( https://github.com/frictionlessdata/specs/blob/master/specs/table-schema.md) specification.\n\nExplore the data schema from your web browser using [colaboratory](https://colab.research.google.com):\n\n[![Open In Colab](https://colab.research.google.com/assets/colab-badge.svg)](https://colab.research.google.com/github/e-lo/forecastcards/blob/master/forecastcards/notebooks/Explore_Data_Schemas.ipynb)\n\n### Included Examples\n\nThis project currently includes one example, which is the Emerald City DOT's HOV expansion for the Yellow Brick Road, which is contained in `forecastcards/examples/emeraldcitydot-rx123-yellowbrickroadhov`\n\nThis example can be analyzed and run with the `notebooks` folder of this directory and can be run using [binder](http://www.mybinder.org) or [colaboratory](https://colab.research.google.com).\n\n[![Open In Colab](https://colab.research.google.com/assets/colab-badge.svg)](https://colab.research.google.com/github/e-lo/forecastcards/blob/master/forecastcards/notebooks/Estimate_Quantiles.ipynb)\n\nTable Validity Status: [![goodtables.io](https://goodtables.io/badge/github/e-lo/forecast-cards.svg)](https://goodtables.io/github/e-lo/forecastcards)\n\n### Suggested card naming and organization\n\nIn order to leverage a common set of tools, we suggest that forecast card data is stored in the following naming and folder structure:\n\n agency-name-project-id-project-short-name/\n |---README.md\n |---\n |---project--.csv\n |---scenarios-.csv\n |---poi-.csv\n |---observations/\n | |---observations-.csv\n |\n |---forecasts/\n | |---forecast----.csv\n\n## How do I start on my own?\n\n1. Make sure you have the required data by examining the schema.\n\n2. Create or Format Data as Forecast Cards\n\n - Enter data into browser and download: [![Open In Colab](https://colab.research.google.com/assets/colab-badge.svg)](https://colab.research.google.com/github/e-lo/forecastcards/blob/master/forecastcards/notebooks/Create_Forecast_Cards.ipynb)\n\n - Use [csv templates](https://github.com/e-lo/forecastcards/tree/master/forecastcards/template/) and enter data using a text browser or a spreadsheet application\n\n - Convert existing data using the [helper scripts on the way](https://github.com/e-lo/forecastcards/issues/1)*\n\n3. Use template notebooks locally or on a hosted remote server (i.e. colaboratory) to clean data and estimate quantile regressions. \n\n\n## Installing forecastcards\n\nNote: If you don't want to install forecastcards locally, you can run the code\nnotebooks in the cloud using Google Colab.\n\n### Requirements\nForecast cards requires Python 3.6 or higher and it is recommended that\nyou install it in a virtual environment (i.e. [Conda](https://conda.io/docs/)).\n\n### Installing\nYou can install forecastcards from this github repository using pip: \n`pip install --upgrade git+https://github.com/e-lo/forecastcards.git@master#egg=forecastcards`\n\nIf you plan to make changes, you can clone this git repository install\nfrom your local, cloned directory using pip:\n`pip install --upgrade .`\n\n### Troubleshooting\nFor people using a newer version of MacOS, they may have trouble installing one of the dependencies because its setuplpy settings are not up to date. You can successfully install it by overriding the default compiler using:\n\n`CFLAGS='-stdlib=libc++' pip install cchardet`\n\n## Suggested Workflow\n\n### Initial setup\n - decide where your data will live: local file server or github repository\n - catalog and convert historic data\n\n### Starting a new project\n\nUse the Create_Forecast_Cards notebook locally, or [![Open In Colab](https://colab.research.google.com/assets/colab-badge.svg)](https://colab.research.google.com/github/e-lo/forecastcards/blob/master/forecastcards/notebooks/Create_Forecast_Cards.ipynb)\n\nYou can also just use the templates:\n\n1. Copy the folder from `\\template` folder in the `forecastcards` package to your folder for holding all the project forecastcards. \n2. Rename project folder according to schema, taking care to not duplicate any - roject IDs within your analysis scope (usually your agency of the [forecastcarddata store](https://github.com/e-lo/forecastcarddata)). \n3. Add observations, POIs, forecast runs, and forecasts for specific POIs as they are determined or created. \n4. Confirm data in new project conforms to data schema by running `validate_project.py ` or for all the projects in a directory by running `validate_cardset.py` from that directory or `validate_project.py `\n\n### Adding a forecast to an existing project\n\nUse the Create_Forecast_Cards notebook locally, or [![Open In Colab](https://colab.research.google.com/assets/colab-badge.svg)](https://colab.research.google.com/github/e-lo/forecastcards/blob/master/forecastcards/notebooks/Create_Forecast_Cards.ipynb)\n\nYou can also just use the templates from `\\template` folder:\n\n1. add a new forecast csv file with relevant data for points of interest \n2. add an entry to scenario csv file about the model run \n3. Add any additional points of interest to poi csv file \n4. Confirm new data in project conforms to data schema by running `validate_project.py ` or for all the projects in a directory by running `validate_cardset.py` from that directory or `validate_project.py `\n\n### Adding observed data to existing project\n\nUse the Create_Forecast_Cards notebook locally, or [![Open In Colab](https://colab.research.google.com/assets/colab-badge.svg)](https://colab.research.google.com/github/e-lo/forecastcards/blob/master/forecastcards/notebooks/Create_Forecast_Cards.ipynb)\n\nYou can also just use the templates from `\\template` folder:\n1. Add a new observations csv \n2. Confirm new data in project conforms to data schema by running `validate_project.py ` or for all the projects in a directory by running `validate_cardset.py` from that directory or `validate_project.py ` \n\n### Run analysis\n\nAs summarized in [![the Estimate_Quantiles.ipynb notebook](https://colab.research.google.com/assets/colab-badge.svg)](https://colab.research.google.com/github/e-lo/forecastcards/blob/master/forecastcards/notebooks/Estimate_Quantiles.ipynb)\n\n1. Select cards to use \n2. Clean and merge cards \n3. Create any additional categorical variables \n4. Perform regressions \n\n# Making forecast cards publicly available\n\nThere are three likely options for making your data available:\n1. Github (not great for extremely large datasets)\n2. Amazon S3 / Microsoft Azure / Google Cloud (functionality coming soon)\n3. Other agency-hosted web services (i.e. Socrata, webserver, etc.)\n\n## Submitting forecast cards to community data store\n\nYou can submit forecast cards to the [community data store](https://github.com/e-lo/forecastcardsdata) by:\n\n1. submitting a [pull-request to the forecastcardsdata repository](https://github.com/e-lo/forecastcardsdata/pulls)\n2. submitting [an issue](https://github.com/e-lo/forecastcardsdata/issues) with a link to the location of the data along with permission to host it on the repository.\n3. set up the public data store as a mirror.\n\n# Getting Help\nPlease [submit an issue!](https://github.com/e-lo/forecastcards/issues)\n\n\n", "description_content_type": "", "docs_url": null, "download_url": "", "downloads": { "last_day": -1, "last_month": -1, "last_week": -1 }, "home_page": "https://github.com/e-lo/forecastcards", "keywords": "", "license": "", "maintainer": "", "maintainer_email": "", "name": "forecastcards", "package_url": "https://pypi.org/project/forecastcards/", "platform": "", "project_url": "https://pypi.org/project/forecastcards/", "project_urls": { "Homepage": "https://github.com/e-lo/forecastcards" }, "release_url": "https://pypi.org/project/forecastcards/0.1.dev1/", "requires_dist": [ "pandas (==0.22)", "requests", "goodtables", "tableschema", "graphviz", "statsmodels", "jupyter" ], "requires_python": "", "summary": "", "version": "0.1.dev1" }, "last_serial": 4733515, "releases": { "0.1.dev1": [ { "comment_text": "", "digests": { "md5": "53ec50c37b7c5d9f907dababe62a8597", "sha256": "28841b5ab5c5c7aae5c72f84f3b26a6899a8ad46cb4ba5af398fcb3c76b8a1d7" }, "downloads": -1, "filename": "forecastcards-0.1.dev1-py3-none-any.whl", "has_sig": false, "md5_digest": "53ec50c37b7c5d9f907dababe62a8597", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": null, "size": 56009, "upload_time": "2019-01-23T23:53:39", "url": "https://files.pythonhosted.org/packages/38/89/36a6cb01070118f69569b526bb566c4cc9cc51b566209b702e7a06e9c57c/forecastcards-0.1.dev1-py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "c8c67eb77b9425a1c3458c7347e23390", "sha256": "8fdff46063850477b1fe93381b83dd6b0ce0866d5d63c6f270441769069ddb4f" }, "downloads": -1, "filename": "forecastcards-0.1.dev1.tar.gz", "has_sig": false, "md5_digest": "c8c67eb77b9425a1c3458c7347e23390", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 18722, "upload_time": "2019-01-23T23:53:41", "url": "https://files.pythonhosted.org/packages/28/99/0768526799bae9425ba60e292dc150bc778a3eb4faa3758b91d61b97c6fc/forecastcards-0.1.dev1.tar.gz" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "53ec50c37b7c5d9f907dababe62a8597", "sha256": "28841b5ab5c5c7aae5c72f84f3b26a6899a8ad46cb4ba5af398fcb3c76b8a1d7" }, "downloads": -1, "filename": "forecastcards-0.1.dev1-py3-none-any.whl", "has_sig": false, "md5_digest": "53ec50c37b7c5d9f907dababe62a8597", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": null, "size": 56009, "upload_time": "2019-01-23T23:53:39", "url": "https://files.pythonhosted.org/packages/38/89/36a6cb01070118f69569b526bb566c4cc9cc51b566209b702e7a06e9c57c/forecastcards-0.1.dev1-py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "c8c67eb77b9425a1c3458c7347e23390", "sha256": "8fdff46063850477b1fe93381b83dd6b0ce0866d5d63c6f270441769069ddb4f" }, "downloads": -1, "filename": "forecastcards-0.1.dev1.tar.gz", "has_sig": false, "md5_digest": "c8c67eb77b9425a1c3458c7347e23390", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 18722, "upload_time": "2019-01-23T23:53:41", "url": "https://files.pythonhosted.org/packages/28/99/0768526799bae9425ba60e292dc150bc778a3eb4faa3758b91d61b97c6fc/forecastcards-0.1.dev1.tar.gz" } ] }