{"id":13551948,"url":"https://github.com/CodeForAfrica/HURUmap","last_synced_at":"2025-04-03T02:32:34.787Z","repository":{"id":62569839,"uuid":"134069925","full_name":"CodeForAfrica/HURUmap","owner":"CodeForAfrica","description":"HURUmap is an interactive web platform that allows citizens and journalists to explore, visualise, and download census data. This gives them the power to give context to stories that was otherwise hard to spot. Accessible at https://hurumap.org","archived":false,"fork":false,"pushed_at":"2019-12-04T09:18:25.000Z","size":14323,"stargazers_count":8,"open_issues_count":13,"forks_count":7,"subscribers_count":15,"default_branch":"master","last_synced_at":"2024-10-11T09:25:25.538Z","etag":null,"topics":["africa","census","citizens","dashboard","django","django-apps","geo-datasets","geographies","hurumap","journalists","kenya","nigeria","python","south-africa","tanzania","uganda","wazimap","zambia"],"latest_commit_sha":null,"homepage":"https://hurumap.org","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/CodeForAfrica.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":"CONTRIBUTING.md","funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2018-05-19T14:36:56.000Z","updated_at":"2020-03-07T09:38:16.000Z","dependencies_parsed_at":"2022-11-04T00:33:07.185Z","dependency_job_id":null,"html_url":"https://github.com/CodeForAfrica/HURUmap","commit_stats":null,"previous_names":[],"tags_count":46,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/CodeForAfrica%2FHURUmap","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/CodeForAfrica%2FHURUmap/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/CodeForAfrica%2FHURUmap/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/CodeForAfrica%2FHURUmap/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/CodeForAfrica","download_url":"https://codeload.github.com/CodeForAfrica/HURUmap/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":222911644,"owners_count":17056714,"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":["africa","census","citizens","dashboard","django","django-apps","geo-datasets","geographies","hurumap","journalists","kenya","nigeria","python","south-africa","tanzania","uganda","wazimap","zambia"],"created_at":"2024-08-01T12:01:56.239Z","updated_at":"2024-11-03T22:32:52.685Z","avatar_url":"https://github.com/CodeForAfrica.png","language":"HTML","funding_links":[],"categories":["HTML","django"],"sub_categories":[],"readme":"# HURUmap\n\nHURUmap is an interactive web platform that allows citizens and journalists to explore, visualise, and download census data. This gives them the power to give context to stories that was otherwise hard to spot. Accessible at \u003chttps://hurumap.org\u003e\n\n## Goals\n\nInstead of re-inventing the wheel, HURUmap relies on the excellent [Wazimap](https://github.com/OpenUpSA/wazimap) and Census Reporter projects and aims to do the following:\n\n1. Extend the features available e.g download SVG / PNG\n2. Provide a platform of shared data - tables and geographies (using mapit) that can be re-used with the different apps\n3. Provide shared styling, design, attribution, and other engagement content preferences\n\n## Usage\n\nTODO: How to build HURUmap-powered apps using opinionated Docker.\n\n### Install HURUmap Django App / package\n\n1. Install the package\n\n   ```shell\n   pip install -e git+https://github.com/CodeForAfrica/HURUmap.git@master#egg=hurumap\n\n   ```\n\n2. Add the app to installed apps\n\n   ```python\n       INSTALLED_APPS = [\n           ...,\n           'hurumap'\n       ]\n   ```\n\n3. Add these to your `settings.py`\n\n   ```python\n\n   ```\n\n4. Run migrations\n\n   ```shell\n       python manage.py migrate\n   ```\n\n5. Create an admin user to access the CMS\n\n   ```shell\n      python manage.py createsuperuser\n   ```\n\n6. Read the [full Wazimap](http://wazimap.readthedocs.org/en/latest/) documentation to get started.\n\n---\n\n\n## Contributing\n\nTo ease contribution, our key principles are borrowed from [contrib](https://github.com/contrib/contrib) where multiple programming languages and approaches can live together in harmony.\n\nTo this end, we've created a [contrib](./contrib) folder that contains the following:\n\n1. [**Docker**](https://docs.docker.com/) scripts for the Django apps powering majority of the backend\n2. [**Yarn**](https://yarnpkg.com/en/) implementation for the frontend pieces (coming soon?)\n3. [**Makefile**](./Makefile) in the root directory to tie it all together with easy tasks\n\nFor more details on contributing, please check out [`CONTRIBUTING.md`](./CONTRIBUTING.md).\n\n## Development\n\n### Django Apps\n\nQuickly get started with HURUmap by running the following:\n\n```shell\n# 1. Build services:\nmake build\n\n# 2. Start web server:\nmake web\n\n# 3. In a new terminal window, load data:\nmake loaddata\n```\n\nVisit \u003chttp://localhost:8000\u003e to view website.\n\n#### HURUmap Dashboard\n\nHURUmap comes packaged with built-in CMS using Wagtail. To work with the dashboard:\n\n```shell\n# 1. Target and build docker image\nexport DOCKERFILE_TARGET=\"hurumap-dashboard\"\nmake build\n\n# 2. Start web server:\nmake web\n\n# 3. In a new terminal window, create your first user:\nmake createsuperuser\n```\n\nVisit \u003chttp://localhost:8000/dashboard\u003e to log into the dashboard.\n\nTo remove dashboard workings, stop all services and run;\n\n```shell\nunset DOCKERFILE_TARGET\nmake build\nmake web\n```\n\n_NOTE: Unless you remove the database container, all the database tables and their data will remain intact._\n\n### Frontend UI\n\n#### Hide Empty sections on the profile page\n\nUse `LOCATION_NOT_FOUND_DIST` in HURUmap profile templates to either hide or call to action whenever\nthere's a missing data.\n\nIf our data distribution is called `budget`, then our code that hides the viz whenever data is missing:\n\n```python\n  {% if not budget.is_missing %}\n    \u003carticle class=\"clearfix\"\u003e\n      \u003cheader class=\"section-contents\"\u003e\n        \u003ch1\u003eBudget\u003c/h1\u003e\n      \u003c/header\u003e\n      \u003cdiv class=\"section-container\"\u003e\n        {% if not budget.government_expenditure_dist.is_missing %}\n          \u003csection class=\"clearfix stat-row\"\u003e\n            \u003ch2 class=\"header-for-columns\"\u003eGovernment Spending\u003c/h2\u003e\n            \u003cdiv class=\"column-full\"\n                 id=\"chart-grouped_column-budget-government_expenditure_dist\"\n                 data-stat-type=\"scaled-percentage\"\u003e\n            \u003c/div\u003e\n          \u003c/section\u003e\n        {% endif %}\n      \u003c/div\u003e\n    \u003c/article\u003e\n  {% endif %}\n```\n\n#### Multiple Chart Qualifiers Support\n\nThis version adds the ability to have more than one qualifier. Due to the HTML limitation of\nsingle `data-qualifier` attribute, the value of this attribute would need to be\ndelimited to support multiple values. `\\n` is used as delimiter.\n\n```html\n... data-qualifier=\"GF: Global Fund\\nADF: African Development Fund\" data-...\n```\n\nBy adding multiple qualifiers support, one can use qualifiers to add a legend to those charts,\nlike histogram, that do not have a legend by default. This means shorter names can be used on\nthe charts themselves leading to clean and easy to read charts.\n\n### Adding Data\n\n#### Datasets and Releases\n\nThis HURUmap release takes advantage of datasets and releases for versioning data.\nA **dataset** is a collection of related **data tables**,\nsuch as a national census. A dataset can be updated with new\n**releases** every few years. Not all data data tables will always be\nupdated in every release, so HURUmap lets you link data tables to\nreleases individually.\n\nSometimes a release has a different name to the original dataset. For\nexample, South Africa conducts a full census every decade, but releases\na community survey in between each full census. A community survey is a\nstatistical sampling and is not a full census, so it would be incorrect\nto call them both \"census\". The results of the community survey are very\nsimilar to the census and are directly comparable. We consider census\nand community surveys to be different **releases** of the same\n**dataset**.\n\nYou must add at least one **dataset** and one **release** before you can\nadd any data tables. See below for details on how to do this.\n\n##### Create a Dataset and Release\n\n1. Go to the Django admin section at \u003chttp://localhost:8000/admin\u003e and\n   log in.\n2. Under **Wazimap**, click the **Add** button alongside **Datasets**.\n3. Give your dataset a name.\n4. Under **Releases**, fill in the name and the year of your first\n   release. For example, you could use `Census` and `2019`.\n5. Click **Save**.\n\n##### Configuring Tables\n\nDatasets, releases and data tables are configured through the Django\nadmin interface, at \u003chttp://localhost:8000/admin\u003e.\n\nOnce you have told HURUmap about your tables, it'll ensure that they\nexist in the database. You can then import the raw data from CSV.\n\n\n#### Adding custom styles to your embeds\n\nYou can customize the styles of your iframe embed by creating a `.css` file in your static directory\nand you append it to the iframe link like this\n`\u003ciframe ... src=\"... \u0026stylesheet=/static/css/embed_test.css\" ... \u003e\u003c/iframe\u003e\n`\n\n## Deployment\n\n### HURUmap Basic\n\nTODO\n\n### HURUmap Dashboard\n\nTODO \n\n**Static and Media Files deployment**\n\nSet these environment variables:\n```\nUSE_S3 = True\nAWS_ACCESS_KEY_ID = ...\nAWS_SECRET_ACCESS_KEY = ...\nAWS_STORAGE_BUCKET_NAME = ...\nAWS_S3_REGION_NAME = ...\n```\n---\n\n## License\n\nGNU GPLv3\n\nCopyright (C) 2018 Code for Africa\n\nThis program is free software: you can redistribute it and/or modify\nit under the terms of the GNU General Public License as published by\nthe Free Software Foundation, either version 3 of the License, or\n(at your option) any later version.\n\nThis program is distributed in the hope that it will be useful,\nbut WITHOUT ANY WARRANTY; without even the implied warranty of\nMERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\nGNU General Public License for more details.\n\nYou should have received a copy of the GNU General Public License\nalong with this program. If not, see \u003chttps://www.gnu.org/licenses/\u003e.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FCodeForAfrica%2FHURUmap","html_url":"https://awesome.ecosyste.ms/projects/github.com%2FCodeForAfrica%2FHURUmap","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FCodeForAfrica%2FHURUmap/lists"}