Skip to main content

Map engine to serve all the people :)

Project description

Github Actions Coverage Status

Good Map

Map engine to serve all the people ;)

Setup

1. Use python 3.10

If you have a different version of Python on your system, install python 3.10 alongside. For that, you can use pyenv. Follow the documentation. Useful commands: pyenv help <command>, pyenv install, pyenv shell, pyenv versions.

2. Install poetry in Python 3.10

poetry can create virtual environments associated with a project.
Make sure you are in the Python 3.10 environment and install:

pip install poetry

Useful commands: poetry -h <command>, poetry env list, poetry env info.

3. Install dependencies

poetry install

4. You're ready

When you enter the project directory, you can invoke any commands in your project like this:

poetry run <command>

Running App locally

TL;DR

If you don't want to go through all the configuration, e.g. you just simply want to test if everything works, you can simply run app with test dataset provided in tests/e2e_tests directory:

poetry run flask --app 'goodmap.goodmap:create_app(config_path="./tests/e2e_tests/e2e_test_config.yml")' run

Configuration

If you want to serve app with your configuration rename config-template.yml to config.yml and change its contents according to your needs. Values descriptions you can find inside config-template.yml.

Afterwards run it with:

poetry run flask --app 'goodmap.goodmap:create_app(config_path="/PATH/TO/YOUR/CONFIG")' --debug run

Database

The database is stored in JSON, in the map section. For an example database see tests/e2e_tests/e2e_test_data.json. The first subsection data consists of the actual datapoints, representing points on a map.

Datapoints have fields. The next subsections define special types of fields:

  • obligatory_fields - here are explicitely stated all the fields that the application assumes are presnt in all datapoints. E.g.
"position",
"name",
"accessible_by"

TODO: obligatory_fields is a new subsection, start using it in the actual application

  • categories - fields that can somehow be used in the app, for example by which datapoints can be filtered. Every category has a specified list of allowed values. E.g.
"accessible_by": ["bikes", "cars", "pedestrians"]
  • visible_data - when a datapoint will be rendered as a pin on a map, these fields will be shown in the box when clicking on a pin. E.g.
"name",
"type_of_place"
  • meta-data - some special data like
"UUID"

You can define the fields in all these subsections. Besides these types of fields, there is no restriction on the number of fields a datapoint can have.

Examples

You can find examples of working configuration and database in tests/e2e_tests named:

  • e2e_test_config.yml
  • e2e_test_data.json

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

goodmap-0.3.1.tar.gz (9.4 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

goodmap-0.3.1-py3-none-any.whl (9.9 kB view details)

Uploaded Python 3

File details

Details for the file goodmap-0.3.1.tar.gz.

File metadata

  • Download URL: goodmap-0.3.1.tar.gz
  • Upload date:
  • Size: 9.4 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.1.1 CPython/3.12.5

File hashes

Hashes for goodmap-0.3.1.tar.gz
Algorithm Hash digest
SHA256 55d8cb56ab82aa8607171a2884fd26c1e2f5b4316d5a1d64df670d2a98d9d5f6
MD5 632848e1b85cbd972aac988656fc2228
BLAKE2b-256 1e5cd72a665714a6e5c7fddd50f9fb4a8380c1502463d4ee4420f299d7756f8d

See more details on using hashes here.

File details

Details for the file goodmap-0.3.1-py3-none-any.whl.

File metadata

  • Download URL: goodmap-0.3.1-py3-none-any.whl
  • Upload date:
  • Size: 9.9 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.1.1 CPython/3.12.5

File hashes

Hashes for goodmap-0.3.1-py3-none-any.whl
Algorithm Hash digest
SHA256 e2a6d4552f7249b3a430dd17c1f94543ee2117e4ac828a1ed12a8a7036220b51
MD5 2d79e0446c9c1fc5fc3cad1b8fdc396e
BLAKE2b-256 8d29b4c5aa458a2f88384137d8f8dd7f69f5785eadad30a463b179631c97ed50

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page