Skip to main content

hxl-proxy

Python-/flask-based web proxy for transforming a HXL dataset dynamically. Requires Python3.

User documentation is available at https://github.com/HXLStandard/hxl-proxy/wiki

Installation

Installation from PyPi:

pip install hxl-proxy

Installation from source:

python setup.py install

Running unit tests:

python setup.py test

Configuration

To configure the proxy, make a copy of config.py.TEMPLATE (e.g. to config.py), and change its values as necessary. The environment variable HXL_PROXY_CONFIG should point to your local config file's location. More details appear below.

Admin interface

To enable the admin interface, you need to enter the MD5 hash of a password into the ADMIN_PASSWORD_MD5 field in the config file. If your password were "hello-kitty" (don't do that!), you could generate the hash like this using Python3:

$ python -c 'import hashlib; print(hashlib.md5("hello-kitty".encode("utf-8")).hexdigest())'

Caching

Choose and configure your input and output caches as needed, following the examples in the config template. You may need to create local directories or databases, depending on the caching backends you choose.

Database support

Using SQLite3

  • DB_TYPE - (required) set to "sqlite3"
  • DB_FILE - (required) a file (which the proxy will create if necessary) containing a SQLite3 database of saved configurations. The file's directory must exist and be readable and writable by the web-server process.

The database schema appears in hxl_proxy/schema-sqlite3.sql

Using MySQL

  • DB_TYPE - (required) set to "mysql"
  • DB_HOST - (optional) address of the MySQL host (defaults to "localhost")
  • DB_PORT - (optional) port number of the MySQL host (must be a number; defaults to 3306)
  • DB_DATABASE - (optional) database name for the HXL Proxy (defaults to "hxl_proxy")
  • DB_USERNAME - (required) database username
  • DB_PASSWORD - (required) database password

Note that for MySQL, you must create the database manually. A schema appears in hxl_proxy/schema-mysql.sql

Authorisation tokens

To use the Google Drive selector, you will require a client ID and OAuth id from Google. To allow users to log in via Humanitarian.ID, you will require a client ID, client secret, and redirect URI from the Humanitarian.ID team.

P-codes and mapping

For mapping, the Proxy uses a collection of GeoJSON files hosted online. If you want to use a local copy (e.g. for offline demos), clone the GitHub repository at https://github.com/hxlstandard/p-codes and set the new base URL as the value of PCODE_BASE_URL. Note that the server serving the local copy must implement CORS, since the shapes get loaded on the browser side: https://www.w3.org/TR/cors/

Edit PCODE_COUNTRY_MAP if you'd like to make more countries available in the map dropdown menu.

Usage

Launching a local server (usually on http://127.0.0.1:5000):

python run-server.py

For web deployment, see the hxl-proxy.wsgi.TEMPLATE file and the flask documentation.

For more on HXL, see http://hxlstandard.org

For more documentation about the underlying HXL engine and filters, see https://github.com/HXLStandard/libhxl-python/wiki

Release files for hxl-proxy 1.23

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for hxl-proxy 1.23
File Size Uploaded
hxl-proxy-1.23.tar.gz 695.1 kB Details

Release files / hxl-proxy-1.23.tar.gz

Download URL hxl-proxy-1.23.tar.gz
Size 695.1 kB
Tags Source
SHA-256 checksum
How to use checksums
3d824228fc2e6816211e9af18480f0a8d30e1981613630a9f1c801975cf69a98
BLAKE2b-256 checksum
How to use checksums
5128facc8cd687b166f2cc2fc360f152d6bf1727d7b0088137cc9c2dbfaeca15
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/3.3.0 pkginfo/1.7.0 requests/2.25.1 setuptools/44.0.0 requests-toolbelt/0.9.1 tqdm/4.56.0 CPython/3.8.6

Release history Release notifications | RSS feed

2.1.1

1 release file

2.0.2

1 release file

2.0.1

1 release file

2.0

1 release file

1.29

1 release file

1.28.1

1 release file

1.28

1 release file

1.27.2

1 release file

1.27.1

1 release file

1.27

1 release file

1.26.1

1 release file

1.26

1 release file

1.25.2

1 release file

1.25.1

1 release file

1.25

1 release file

1.24.4

1 release file

1.24.3

1 release file

1.24.2

1 release file

1.24.1

1 release file

1.24

1 release file

This release

1.23 This release

1 release file

1.22

1 release file

1.21.3

1 release file

1.21.2

1 release file

1.21.1

1 release file

1.21

1 release file

1.20

1 release file

1.19

1 release file

1.18

1 release file

1.17

1 release file

1.16.1

1 release file

1.16

1 release file

1.15.1

1 release file

1.15

1 release file

1.14.1

1 release file

1.14

1 release file

1.13.1

1 release file

1.13

1 release file

1.12

1 release file

1.11

1 release file

1.10

1 release file

1.9.1

1 release file

1.9

1 release file

1.8.3

1 release file

1.8.2

1 release file

1.8.1

1 release file

1.8

1 release file

1.7.1

1 release file

1.7

1 release file

1.6

1 release file

1.5.1

1 release file

1.5

1 release file

1.4

1 release file

1.3

1 release file

1.2

1 release file

1.1

1 release file

1.0

1 release file

0.6

1 release file

0.5

1 release file

0.4

1 release file

0.4beta

0.2beta

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page