Explore Hong Kong's neighborhoods through visualizations of census data
gazetteerhk, updated
🕥
2022-07-01 11:51:35
Hong Kong Gazetteer
Explore Hong Kong's neighborhoods through data

Usage
Data Preparation
Go to scripts
dir and run python data_preparation.py
.
This script will download original xlsx files, extract cleaned data to JSON, generate translation mapping, and generate combined CSV files.
You can also generate translation files with this script by uncommenting a few lines, but this should not be necessary, as
the files are included in the repo under /rontend/locale
All the data files are under backend/data
dir.
Backend
Make sure to install the necessary libraries by doing pip install -r requirements.txt
. We recommend using a virtualenv
.
Run:
- soft link the
backend/
dir to /srv/hk_census_explorer/backend
.
uwsgi uwsgi.ini
for production server.
The production server runs at port 8080
by default.
python debug.py
for the DEBUG version.
The development server runs at port 8081
by default.
Dockerized Backend
You can run the backend as a Docker container. Simply do sudo docker build .
in the project root, and it will build
the container for you. You must still do the data preparation step first.
Frontend
- Node.js
- Grunt
- AngularJS
- D3js
- Leaflet
- Google Map
cd
into the frontend
folder. Prepare environment:
[sudo] npm install -g grunt-cli
[sudo] npm install -g bower
npm install
bower install
Usage:
grunt serve
: Start the local http server at port 9000 in app
.
By default the host is 0.0.0.0
to allow connections from outside the server.
grunt test
: Run frontend tests.
grunt build
: Execute the build process.
grunt serve:dist
will run the build process and start the server within dist
.
grunt deploy
will build and deploy the site to GitHub pages.
By default, the API will hit our servers. If you want it to query from your local development server, you must change
the endpoint in frontend/app/scripts/services/CensusAPI.js
Contribution
If you have bug report, feature request or anything to discuss,
create an issue in our project repo.
For code contributions, please fork, modify and send Pull Request.
License
See LICENSE
Todo
- Data preparation scripts dump the data into scripts/data, but the backend assumes
the data will be in backend/data
- Backend requires symlink of backend to /srv/hk_census_explorer/backend
Issues
opened on 2022-07-01 11:51:34 by dependabot[bot]
Bumps openpyxl from 1.8.2 to 2.4.2.

Dependabot will resolve any conflicts with this PR as long as you don't alter it yourself. You can also trigger a rebase manually by commenting @dependabot rebase
.
Dependabot commands and options
You can trigger Dependabot actions by commenting on this PR:
- `@dependabot rebase` will rebase this PR
- `@dependabot recreate` will recreate this PR, overwriting any edits that have been made to it
- `@dependabot merge` will merge this PR after your CI passes on it
- `@dependabot squash and merge` will squash and merge this PR after your CI passes on it
- `@dependabot cancel merge` will cancel a previously requested merge and block automerging
- `@dependabot reopen` will reopen this PR if it is closed
- `@dependabot close` will close this PR and stop Dependabot recreating it. You can achieve the same result by closing it manually
- `@dependabot ignore this major version` will close this PR and stop Dependabot creating any more for this major version (unless you reopen the PR or upgrade to it yourself)
- `@dependabot ignore this minor version` will close this PR and stop Dependabot creating any more for this minor version (unless you reopen the PR or upgrade to it yourself)
- `@dependabot ignore this dependency` will close this PR and stop Dependabot creating any more for this dependency (unless you reopen the PR or upgrade to it yourself)
- `@dependabot use these labels` will set the current labels as the default for future PRs for this repo and language
- `@dependabot use these reviewers` will set the current reviewers as the default for future PRs for this repo and language
- `@dependabot use these assignees` will set the current assignees as the default for future PRs for this repo and language
- `@dependabot use this milestone` will set the current milestone as the default for future PRs for this repo and language
You can disable automated security fix PRs for this repo from the [Security Alerts page](https://github.com/gazetteerhk/census_explorer/network/alerts).
opened on 2022-06-21 21:13:15 by dependabot[bot]
Bumps numpy from 1.8.2 to 1.22.0.
Release notes
Sourced from numpy's releases.
v1.22.0
NumPy 1.22.0 Release Notes
NumPy 1.22.0 is a big release featuring the work of 153 contributors
spread over 609 pull requests. There have been many improvements,
highlights are:
- Annotations of the main namespace are essentially complete. Upstream
is a moving target, so there will likely be further improvements,
but the major work is done. This is probably the most user visible
enhancement in this release.
- A preliminary version of the proposed Array-API is provided. This is
a step in creating a standard collection of functions that can be
used across application such as CuPy and JAX.
- NumPy now has a DLPack backend. DLPack provides a common interchange
format for array (tensor) data.
- New methods for
quantile
, percentile
, and related functions. The
new methods provide a complete set of the methods commonly found in
the literature.
- A new configurable allocator for use by downstream projects.
These are in addition to the ongoing work to provide SIMD support for
commonly used functions, improvements to F2PY, and better documentation.
The Python versions supported in this release are 3.8-3.10, Python 3.7
has been dropped. Note that 32 bit wheels are only provided for Python
3.8 and 3.9 on Windows, all other wheels are 64 bits on account of
Ubuntu, Fedora, and other Linux distributions dropping 32 bit support.
All 64 bit wheels are also linked with 64 bit integer OpenBLAS, which should fix
the occasional problems encountered by folks using truly huge arrays.
Expired deprecations
Deprecated numeric style dtype strings have been removed
Using the strings "Bytes0"
, "Datetime64"
, "Str0"
, "Uint32"
,
and "Uint64"
as a dtype will now raise a TypeError
.
(gh-19539)
Expired deprecations for loads
, ndfromtxt
, and mafromtxt
in npyio
numpy.loads
was deprecated in v1.15, with the recommendation that
users use pickle.loads
instead. ndfromtxt
and mafromtxt
were both
deprecated in v1.17 - users should use numpy.genfromtxt
instead with
the appropriate value for the usemask
parameter.
(gh-19615)
... (truncated)
Commits

Dependabot will resolve any conflicts with this PR as long as you don't alter it yourself. You can also trigger a rebase manually by commenting @dependabot rebase
.
Dependabot commands and options
You can trigger Dependabot actions by commenting on this PR:
- `@dependabot rebase` will rebase this PR
- `@dependabot recreate` will recreate this PR, overwriting any edits that have been made to it
- `@dependabot merge` will merge this PR after your CI passes on it
- `@dependabot squash and merge` will squash and merge this PR after your CI passes on it
- `@dependabot cancel merge` will cancel a previously requested merge and block automerging
- `@dependabot reopen` will reopen this PR if it is closed
- `@dependabot close` will close this PR and stop Dependabot recreating it. You can achieve the same result by closing it manually
- `@dependabot ignore this major version` will close this PR and stop Dependabot creating any more for this major version (unless you reopen the PR or upgrade to it yourself)
- `@dependabot ignore this minor version` will close this PR and stop Dependabot creating any more for this minor version (unless you reopen the PR or upgrade to it yourself)
- `@dependabot ignore this dependency` will close this PR and stop Dependabot creating any more for this dependency (unless you reopen the PR or upgrade to it yourself)
- `@dependabot use these labels` will set the current labels as the default for future PRs for this repo and language
- `@dependabot use these reviewers` will set the current reviewers as the default for future PRs for this repo and language
- `@dependabot use these assignees` will set the current assignees as the default for future PRs for this repo and language
- `@dependabot use this milestone` will set the current milestone as the default for future PRs for this repo and language
You can disable automated security fix PRs for this repo from the [Security Alerts page](https://github.com/gazetteerhk/census_explorer/network/alerts).
opened on 2022-01-21 19:23:42 by dependabot[bot]
Bumps ipython from 1.1.0 to 7.16.3.
Release notes
Sourced from ipython's releases.
7.9.0
No release notes provided.
7.8.0
No release notes provided.
7.7.0
No release notes provided.
7.6.1
No release notes provided.
7.6.0
No release notes provided.
7.5.0
No release notes provided.
7.4.0
No release notes provided.
7.3.0
No release notes provided.
7.2.0
No release notes provided.
7.1.1
No release notes provided.
7.1.0
No release notes provided.
7.0.1
No release notes provided.
7.0.0
No release notes provided.
7.0.0-doc
No release notes provided.
7.0.0rc1
No release notes provided.
7.0.0b1
No release notes provided.
6.2.1
No release notes provided.
... (truncated)
Commits

Dependabot will resolve any conflicts with this PR as long as you don't alter it yourself. You can also trigger a rebase manually by commenting @dependabot rebase
.
Dependabot commands and options
You can trigger Dependabot actions by commenting on this PR:
- `@dependabot rebase` will rebase this PR
- `@dependabot recreate` will recreate this PR, overwriting any edits that have been made to it
- `@dependabot merge` will merge this PR after your CI passes on it
- `@dependabot squash and merge` will squash and merge this PR after your CI passes on it
- `@dependabot cancel merge` will cancel a previously requested merge and block automerging
- `@dependabot reopen` will reopen this PR if it is closed
- `@dependabot close` will close this PR and stop Dependabot recreating it. You can achieve the same result by closing it manually
- `@dependabot ignore this major version` will close this PR and stop Dependabot creating any more for this major version (unless you reopen the PR or upgrade to it yourself)
- `@dependabot ignore this minor version` will close this PR and stop Dependabot creating any more for this minor version (unless you reopen the PR or upgrade to it yourself)
- `@dependabot ignore this dependency` will close this PR and stop Dependabot creating any more for this dependency (unless you reopen the PR or upgrade to it yourself)
- `@dependabot use these labels` will set the current labels as the default for future PRs for this repo and language
- `@dependabot use these reviewers` will set the current reviewers as the default for future PRs for this repo and language
- `@dependabot use these assignees` will set the current assignees as the default for future PRs for this repo and language
- `@dependabot use this milestone` will set the current milestone as the default for future PRs for this repo and language
You can disable automated security fix PRs for this repo from the [Security Alerts page](https://github.com/gazetteerhk/census_explorer/network/alerts).
opened on 2021-03-19 22:18:08 by dependabot[bot]
Bumps jinja2 from 2.7.2 to 2.11.3.
Release notes
Sourced from jinja2's releases.
2.11.3
This contains a fix for a speed issue with the urlize
filter. urlize
is likely to be called on untrusted user input. For certain inputs some of the regular expressions used to parse the text could take a very long time due to backtracking. As part of the fix, the email matching became slightly stricter. The various speedups apply to urlize
in general, not just the specific input cases.
2.11.2
2.11.1
This fixes an issue in async environment when indexing the result of an attribute lookup, like {{ data.items[1:] }}
.
2.11.0
This is the last version to support Python 2.7 and 3.5. The next version will be Jinja 3.0 and will support Python 3.6 and newer.
2.10.3
2.10.2
2.10.1
2.10
Primary changes
Install or upgrade
Install from PyPI with pip:
... (truncated)
Changelog
Sourced from jinja2's changelog.
Version 2.11.3
Released 2021-01-31
- Improve the speed of the
urlize
filter by reducing regex
backtracking. Email matching requires a word character at the start
of the domain part, and only word characters in the TLD. :pr:1343
Version 2.11.2
Released 2020-04-13
- Fix a bug that caused callable objects with
__getattr__
, like
:class:~unittest.mock.Mock
to be treated as a
:func:contextfunction
. :issue:1145
- Update
wordcount
filter to trigger :class:Undefined
methods
by wrapping the input in :func:soft_str
. :pr:1160
- Fix a hang when displaying tracebacks on Python 32-bit.
:issue:
1162
- Showing an undefined error for an object that raises
AttributeError
on access doesn't cause a recursion error.
:issue:1177
- Revert changes to :class:
~loaders.PackageLoader
from 2.10 which
removed the dependency on setuptools and pkg_resources, and added
limited support for namespace packages. The changes caused issues
when using Pytest. Due to the difficulty in supporting Python 2 and
:pep:451
simultaneously, the changes are reverted until 3.0.
:pr:1182
- Fix line numbers in error messages when newlines are stripped.
:pr:
1178
- The special
namespace()
assignment object in templates works in
async environments. :issue:1180
- Fix whitespace being removed before tags in the middle of lines when
lstrip_blocks
is enabled. :issue:1138
- :class:
~nativetypes.NativeEnvironment
doesn't evaluate
intermediate strings during rendering. This prevents early
evaluation which could change the value of an expression.
:issue:1186
Version 2.11.1
Released 2020-01-30
- Fix a bug that prevented looking up a key after an attribute
(
{{ data.items[1:] }}
) in an async template. :issue:1141
... (truncated)
Commits

Dependabot will resolve any conflicts with this PR as long as you don't alter it yourself. You can also trigger a rebase manually by commenting @dependabot rebase
.
Dependabot commands and options
You can trigger Dependabot actions by commenting on this PR:
- `@dependabot rebase` will rebase this PR
- `@dependabot recreate` will recreate this PR, overwriting any edits that have been made to it
- `@dependabot merge` will merge this PR after your CI passes on it
- `@dependabot squash and merge` will squash and merge this PR after your CI passes on it
- `@dependabot cancel merge` will cancel a previously requested merge and block automerging
- `@dependabot reopen` will reopen this PR if it is closed
- `@dependabot close` will close this PR and stop Dependabot recreating it. You can achieve the same result by closing it manually
- `@dependabot ignore this major version` will close this PR and stop Dependabot creating any more for this major version (unless you reopen the PR or upgrade to it yourself)
- `@dependabot ignore this minor version` will close this PR and stop Dependabot creating any more for this minor version (unless you reopen the PR or upgrade to it yourself)
- `@dependabot ignore this dependency` will close this PR and stop Dependabot creating any more for this dependency (unless you reopen the PR or upgrade to it yourself)
- `@dependabot use these labels` will set the current labels as the default for future PRs for this repo and language
- `@dependabot use these reviewers` will set the current reviewers as the default for future PRs for this repo and language
- `@dependabot use these assignees` will set the current assignees as the default for future PRs for this repo and language
- `@dependabot use this milestone` will set the current milestone as the default for future PRs for this repo and language
You can disable automated security fix PRs for this repo from the [Security Alerts page](https://github.com/gazetteerhk/census_explorer/network/alerts).
opened on 2019-10-23 00:03:56 by dependabot[bot]
Bumps werkzeug from 0.9.4 to 0.15.3.
Release notes
*Sourced from [werkzeug's releases](https://github.com/pallets/werkzeug/releases).*
> ## 0.15.3
> * Blog: https://palletsprojects.com/blog/werkzeug-0-15-3-released/
> * Changes: https://werkzeug.palletsprojects.com/en/0.15.x/changes/#version-0-15-3
>
>
> ## 0.15.2
> * Blog: https://palletsprojects.com/blog/werkzeug-0-15-2-released/
> * Changes: https://werkzeug.palletsprojects.com/en/0.15.x/changes/#version-0-15-2
>
> ## 0.15.1
> * Blog: https://palletsprojects.com/blog/werkzeug-0-15-1-released/
> * Changes: https://werkzeug.palletsprojects.com/en/0.15.x/changes/
>
> ## 0.15.0
> * Blog: https://palletsprojects.com/blog/werkzeug-0-15-0-released/
> * Changes: https://werkzeug.palletsprojects.com/en/0.15.x/changes/
>
> ## 0.13
> [Read the announcement here.](https://www.palletsprojects.com/blog/werkzeug-013-released/)
>
> [Read the full changelog.](http://werkzeug.pocoo.org/docs/latest/changes/#version-0-13)
>
> Install from [PyPI](https://pypi.org/Werkzeug/0.13) with pip:
>
> ```
> pip install -U Werkzeug
> ```
>
Changelog
*Sourced from [werkzeug's changelog](https://github.com/pallets/werkzeug/blob/master/CHANGES.rst).*
> Version 0.15.3
> --------------
>
> Released 2019-05-14
>
> - Properly handle multi-line header folding in development server in
> Python 2.7. (:issue:`1080`)
> - Restore the ``response`` argument to :exc:`~exceptions.Unauthorized`.
> (:pr:`1527`)
> - :exc:`~exceptions.Unauthorized` doesn't add the ``WWW-Authenticate``
> header if ``www_authenticate`` is not given. (:issue:`1516`)
> - The default URL converter correctly encodes bytes to string rather
> than representing them with ``b''``. (:issue:`1502`)
> - Fix the filename format string in
> :class:`~middleware.profiler.ProfilerMiddleware` to correctly handle
> float values. (:issue:`1511`)
> - Update :class:`~middleware.lint.LintMiddleware` to work on Python 3.
> (:issue:`1510`)
> - The debugger detects cycles in chained exceptions and does not time
> out in that case. (:issue:`1536`)
> - When running the development server in Docker, the debugger security
> pin is now unique per container.
>
>
> Version 0.15.2
> --------------
>
> Released 2019-04-02
>
> - ``Rule`` code generation uses a filename that coverage will ignore.
> The previous value, "generated", was causing coverage to fail.
> (:issue:`1487`)
> - The test client removes the cookie header if there are no persisted
> cookies. This fixes an issue introduced in 0.15.0 where the cookies
> from the original request were used for redirects, causing functions
> such as logout to fail. (:issue:`1491`)
> - The test client copies the environ before passing it to the app, to
> prevent in-place modifications from affecting redirect requests.
> (:issue:`1498`)
> - The ``"werkzeug"`` logger only adds a handler if there is no handler
> configured for its level in the logging chain. This avoids double
> logging if other code configures logging first. (:issue:`1492`)
>
>
> Version 0.15.1
> --------------
>
> Released 2019-03-21
>
> - :exc:`~exceptions.Unauthorized` takes ``description`` as the first
> ... (truncated)
Commits
- [`9b1123a`](https://github.com/pallets/werkzeug/commit/9b1123a779e95b5c38ca911ce1329e87a3348a92) release version 0.15.3
- [`00bc43b`](https://github.com/pallets/werkzeug/commit/00bc43b1672e662e5e3b8cecd79e67fc968fa246) unique debugger pin in Docker containers
- [`2cbdf2b`](https://github.com/pallets/werkzeug/commit/2cbdf2b02273daccf85845b1e1569096e65ffe58) Merge pull request [#1542](https://github-redirect.dependabot.com/pallets/werkzeug/issues/1542) from asottile/exceptions_arent_always_hashable
- [`0e669f6`](https://github.com/pallets/werkzeug/commit/0e669f6be532801267d35de23c5f5237b8406d8a) Fix unhashable exception types
- [`bdc17e4`](https://github.com/pallets/werkzeug/commit/bdc17e4cd10bbb17449006cef385ec953a11fc36) Merge pull request [#1540](https://github-redirect.dependabot.com/pallets/werkzeug/issues/1540) from pallets/break-tb-cycle
- [`44e38c2`](https://github.com/pallets/werkzeug/commit/44e38c2985bcd3a7c17467bead901b8f36528f5f) break cycle in chained exceptions
- [`777500b`](https://github.com/pallets/werkzeug/commit/777500b64647ea47b21e52e5e113ba1d86014c05) Merge pull request [#1518](https://github-redirect.dependabot.com/pallets/werkzeug/issues/1518) from NiklasMM/fix/1510_lint-middleware-python3-compa...
- [`e00c7c2`](https://github.com/pallets/werkzeug/commit/e00c7c2cedcbcad3772e4522813c78bc9a860fbe) Make LintMiddleware Python 3 compatible and add tests
- [`d590cc7`](https://github.com/pallets/werkzeug/commit/d590cc7cf2fcb34ebc0783eb3c2913e8ce016ed8) Merge pull request [#1539](https://github-redirect.dependabot.com/pallets/werkzeug/issues/1539) from pallets/profiler-format
- [`0388fc9`](https://github.com/pallets/werkzeug/commit/0388fc95e696513bbefbde293f3f76cc482df8fa) update filename_format for ProfilerMiddleware.
- Additional commits viewable in [compare view](https://github.com/pallets/werkzeug/compare/0.9.4...0.15.3)

Dependabot will resolve any conflicts with this PR as long as you don't alter it yourself. You can also trigger a rebase manually by commenting @dependabot rebase
.
Dependabot commands and options
You can trigger Dependabot actions by commenting on this PR:
- `@dependabot rebase` will rebase this PR
- `@dependabot recreate` will recreate this PR, overwriting any edits that have been made to it
- `@dependabot merge` will merge this PR after your CI passes on it
- `@dependabot squash and merge` will squash and merge this PR after your CI passes on it
- `@dependabot cancel merge` will cancel a previously requested merge and block automerging
- `@dependabot reopen` will reopen this PR if it is closed
- `@dependabot ignore this [patch|minor|major] version` will close this PR and stop Dependabot creating any more for this minor/major version (unless you reopen the PR or upgrade to it yourself)
- `@dependabot ignore this dependency` will close this PR and stop Dependabot creating any more for this dependency (unless you reopen the PR or upgrade to it yourself)
- `@dependabot use these labels` will set the current labels as the default for future PRs for this repo and language
- `@dependabot use these reviewers` will set the current reviewers as the default for future PRs for this repo and language
- `@dependabot use these assignees` will set the current assignees as the default for future PRs for this repo and language
- `@dependabot use this milestone` will set the current milestone as the default for future PRs for this repo and language
You can disable automated security fix PRs for this repo from the [Security Alerts page](https://github.com/gazetteerhk/census_explorer/network/alerts).
opened on 2017-10-22 15:57:25 by hupili
None