{"id":23112917,"url":"https://github.com/isms/votebuilder-xls2json","last_synced_at":"2025-04-04T00:11:23.124Z","repository":{"id":7107762,"uuid":"8400683","full_name":"isms/votebuilder-xls2json","owner":"isms","description":"Parse non-standard NGP VAN Votebuilder .xls exports to JSON","archived":false,"fork":false,"pushed_at":"2013-07-19T16:55:51.000Z","size":136,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-02-09T11:42:47.855Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/isms.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2013-02-25T02:19:57.000Z","updated_at":"2013-10-15T21:50:14.000Z","dependencies_parsed_at":"2022-09-05T17:11:13.678Z","dependency_job_id":null,"html_url":"https://github.com/isms/votebuilder-xls2json","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/isms%2Fvotebuilder-xls2json","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/isms%2Fvotebuilder-xls2json/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/isms%2Fvotebuilder-xls2json/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/isms%2Fvotebuilder-xls2json/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/isms","download_url":"https://codeload.github.com/isms/votebuilder-xls2json/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247097994,"owners_count":20883128,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-12-17T02:20:57.505Z","updated_at":"2025-04-04T00:11:23.098Z","avatar_url":"https://github.com/isms.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# votebuilder-xls2json\n\nTakes an `xls` file exported from certain sections of Votebuilder (a product of NGP VAN, Inc.), applies desired transforms to the data, and outputs well-formed JSON to stdout.\n\n## Usage\n\nOn the command line: `python parse.py \u003cexported xls\u003e`\n\nTypical use might entail saving the output, e.g.: `python parse.py Report.xls \u003e events.json`\n\n## Use as module\n\nIt is also possible to use the intermediate functions within the module. For example:\n\n```python\nfrom parse import read_html_from_file, get_dicts_from_html\n\n# read an exported events list\nhtml = read_html_from_file('Report.xls')\ndicts = get_dicts_from_html(html)\ndicts[0]\n```\n\nWhich would print a result like this:\n```python\n{'Scheduled': '6', 'Confirmed': '0', 'Completed': '0', 'Tentative': '0', 'Invited': '0', 'Walk In': '0', 'Conf Twice': '0', 'Paid': '0', 'ID': '55555', 'Wait List': '0', 'Cancelled': '0', 'Left Msg': '0', 'Time': '10:00 AM - 4:00 PM', 'Date': '1/1/13', 'No Show': '0', 'Type': 'Canvassing', 'Event': 'Anytown Canvass', 'Declined': '0'}\n```\n\n## Transforms\n\nBefore printing the JSON, you can apply specific transforms to the entire list of dictionaries or each dictionary. This makes it possible to, e.g., add fields, remove fields, sort the list of dictionaries, etc. *Note: specific transforms relevant to the 'Event List' export are left in as examples and will be applied by default. You may want to remove these before use.*\n\nTo remove transforms, simply delete them from the `DICT_TRANSFORMS` and `LIST_TRANSFORMS` lists at the end of `transforms.py`.\n\nTo add a transform that operates on each specific dictionary (to remove or add values, for example), write a function that takes a dictionary as its argument and returns the modified dictionary, then add that function to `DICT_TRANSFORMS`.\n\nTo add a transform that operates on the entire list of dictionaries (to sort, for example), write a function that takes a list of dictionaries as its argument and returns the modified list, then add that function to `LIST_TRANSFORMS`.\n\n## Notes\n\nNot all Votebuilder exports are set up the same way. This file works for exported files (such as Events List, Counts and Crosstabs, etc) which are actually an HTML fragment of the following form:\n\n```html\n\u003cdiv\u003e\n  \u003ctable class=\"ResultsGridViewControlStyle\"\u003e\n    \u003ctr class=\"ResultsHeaderStyle\"\u003e\n      \u003cth scope=\"col\"\u003e [...] \u003c/th\u003e\n      [...]\n    \u003c/tr\u003e\n    \u003ctr class=\"ResultsRowStyle\"\u003e\n      \u003ctd\u003e [...] \u003c/td\u003e\n      [...]\n    \u003c/tr\u003e\n    \u003ctr class=\"ResultsAlternateRowStyle\"\u003e [...]\n      \u003ctd\u003e [...] \u003c/td\u003e\n      [...]\n    \u003c/tr\u003e\n  \u003c/table\u003e\n\u003c/div\u003e\n```","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fisms%2Fvotebuilder-xls2json","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fisms%2Fvotebuilder-xls2json","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fisms%2Fvotebuilder-xls2json/lists"}