{"id":16431820,"url":"https://github.com/drkostas/cross-the-floor","last_synced_at":"2025-10-27T01:30:26.677Z","repository":{"id":37228957,"uuid":"230281067","full_name":"drkostas/Cross-The-Floor","owner":"drkostas","description":"Uses Sankey Diagrams to visualize politicians that have \"crossed the floor\" from election to election.","archived":false,"fork":false,"pushed_at":"2023-02-10T23:10:55.000Z","size":3550,"stargazers_count":13,"open_issues_count":3,"forks_count":0,"subscribers_count":4,"default_branch":"master","last_synced_at":"2025-02-01T01:23:09.704Z","etag":null,"topics":["crawling","parliamentary-elections","plotly","python","sankey-diagram","wikipedia"],"latest_commit_sha":null,"homepage":"","language":"HTML","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"gpl-3.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/drkostas.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":"2019-12-26T14:53:25.000Z","updated_at":"2025-01-06T16:40:18.000Z","dependencies_parsed_at":"2023-01-31T12:45:31.644Z","dependency_job_id":null,"html_url":"https://github.com/drkostas/Cross-The-Floor","commit_stats":null,"previous_names":[],"tags_count":1,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/drkostas%2FCross-The-Floor","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/drkostas%2FCross-The-Floor/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/drkostas%2FCross-The-Floor/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/drkostas%2FCross-The-Floor/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/drkostas","download_url":"https://codeload.github.com/drkostas/Cross-The-Floor/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":238418208,"owners_count":19468865,"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":["crawling","parliamentary-elections","plotly","python","sankey-diagram","wikipedia"],"created_at":"2024-10-11T08:32:50.701Z","updated_at":"2025-10-27T01:30:26.013Z","avatar_url":"https://github.com/drkostas.png","language":"HTML","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Cross The Floor Viz\n\nUses Sankey Diagrams to visualize politicians that have \"crossed the floor\" from election to election.\n\n\n## Getting Started\n\nThese instructions will get you a copy of the project up and running on your local machine for development and testing purposes. See deployment for notes on how to deploy the project on a live system.\n\n### Prerequisites\n\n1. Python 3\n1. [Plotly Orca](https://github.com/plotly/orca)\n\n### Installing\n\n##### Installing Plotly Orca\n- Method 1: `$ conda install -c plotly plotly-orca`\n- Method 1: `$ npm install -g electron@1.8.4 orca`\n- Method 1: `$ docker pull quay.io/plotly/orca`\n\n##### Create python virtual environment and source it\n```\npython3 -m venv venv\nsource venv/bin/activate\n```\n\n##### Installing the requirements\n```\npip install -r requirements.txt\n```\n\n##### Run setup.py\n```\npython setup.up install --force\n```\n\n### Running\n\n##### Create a yml configuration file with the following structure\n\n```\nsource:\n  config:\n    sources:\n      - link: [wikipedia link]\n        table_header: [html table header]\n        name_col: [Name Column]\n        attr_col:\n          origin_name: [Parliamentary group column name on wikipedia]\n          name_on_plot: [Parliamentary group column name to be shown on on plot]\n        ignore_cols:\n          - [column name to ignore]\n        enclosing_tag: [tag enclosing the table]\n      - link: [wikipedia link]\n        table_header: [html table header]\n        name_col: [Name Column]\n        attr_col:\n          origin_name: [Parliamentary group column name on wikipedia]\n          name_on_plot: [Parliamentary group column name to be shown on on plot]\n        ignore_cols:\n          - [column name]\n        enclosing_tag: [tag enclosing the table]\n  type: ParliamentMembersCrawler\ntarget:\n  config:\n    plot_name: [Output Plot Name]\n    target_path: [path in which the plots are going to be saved]\n    save_image: [true|false]\n    save_html: [true|false]\n    color_grouping_type: [party|year|none]\n    custom_party_colors: # REQUIRED: color_grouping_type: party\n      [Parliamentary group value]: [color hex code]\n      [Parliamentary group value]: [color hex code]\n      [Parliamentary group value]: [color hex code]\n  type: plotly\n```\n\n##### Some info about the yml\n\n1. `[wikipedia link]`: Wikipeda page that contains a table with the list of parliament members of some year [[example](https://en.wikipedia.org/wiki/List_of_members_of_the_Hellenic_Parliament,_2015_(September)%E2%80%932019)\n1. `[html table header]`: The Table Header\n   1. First click `View Page Source` on the wikipedia page\n   1. Spot the table with the parliament members\n   1. Copy the header of the table - usually it starts with a `\u003cthead\u003e` tag\n1. `[Name Column]`: The name of the column that represents the members' names\n1. `[Parliamentary group column name on wikipedia]`: The name of the column that represents the parliamentary groups' names\n1. `[Parliamentary group column name to be shown on on plot]`: The value with which you want the previous attribute to be replaced on the plot\n1. `[column name to ignore]`: If in the _page source_ there is table column with the attribute `colspan=\"2\"`, the add its name here\n1. `[tag enclosing the table]`: The tag name that encloses the header along with rest of the table - usually `\u003ctable\u003e` or `\u003ctbody\u003e`\n1. `[Output Plot Name]`: The name of the plot\n1. `[path in which the plots are going to be saved]`: Save path of the plot\n1. `[Parliamentary group value]`: The name of the parliament group for which you want a custom color\n1. `[color hex code]`: The hex code of the custom color - should be enclosed in double quotes e.g. \"#4974BB\"\n\n##### Run it\n\n```\nparliament_members_sankey -c CONFIG_FILE [-l LOG_FILE] [--debug] [--help]\n```\n##### or\n```\npython3 main.py -c CONFIG_FILE [-l LOG_FILE] [--debug] [--help]\n```\n\n#### Results\n![Greek Elections 2007-2012-Sept 2015-2019](https://github.com/drkostas/Parliament-Members-Flow-Viz/blob/master/plots/Greek%20Elections%202007-2012-Sept%202015-2019.png)\n\n## License\n\nThis project is licensed under the GNU General Public License v3.0 License\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdrkostas%2Fcross-the-floor","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdrkostas%2Fcross-the-floor","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdrkostas%2Fcross-the-floor/lists"}