Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/statisticsnorway/microdata-metadata-service

M2.0 Metadata service
https://github.com/statisticsnorway/microdata-metadata-service

backstage

Last synced: 23 days ago
JSON representation

M2.0 Metadata service

Awesome Lists containing this project

README

        

# microdata-metadata-service
Metadata service for microdata.no.

## Contribute

### Set up
To work on this repository you need to install [poetry](https://python-poetry.org/docs/):
```
# macOS / linux / BashOnWindows
curl -sSL https://raw.githubusercontent.com/python-poetry/poetry/master/get-poetry.py | python -

# Windows powershell
(Invoke-WebRequest -Uri https://raw.githubusercontent.com/python-poetry/poetry/master/get-poetry.py -UseBasicParsing).Content | python -
```
Then install the virtual environment from the root directory:
```
poetry install
```

### Running tests
Open terminal and go to root directory of the project and run:
````
poetry run pytest --cov=metadata_service/
````

### REST API documentation
The API documentation is available at [data-store-api-doc](https://gitlab.sikt.no/raird/data-store-api-doc)

### Running without Docker
You should add the appropriate environmental variables to your local system:
```sh
export DATASTORE_ROOT_DIR=/datastore
export DOCKER_HOST_NAME=
```

Open terminal and go to root directory of the project and run:
````
poetry run gunicorn metadata_service.app:app
````

### Build and run Docker image
````
docker build --tag metadata-service:local-latest .
docker run --publish 8080:8080 \
--rm \
--env DATASTORE_ROOT_DIR=/datastore \
--env PORT=8000 \
--env DOCKER_HOST_NAME=local \
-v /path/to/datastore:/datastore metadata-service:local-latest
````

## Built with
* [Poetry](https://python-poetry.org/) - Python dependency and package management
* [Gunicorn](https://gunicorn.org/) - Python WSGI-server for UNIX
* [Flask](https://flask.palletsprojects.com) - Web framework
* [Pydantic](https://pydantic-docs.helpmanual.io/) - Data validation