A library to perform machine reading over a model codebase in order to automatically extract key metadata.
Project description
Domain-Model-Examiner (DMX)
The goal of this process is to perform machine reading over the model codebase in order to automatically extract key metadata about:
- Input files
- Output files
- System requirements
- Software requirements
- Model entry points
- Model descriptions
- Maintainer information
Installation
First, recommended installation is to create a new conda environment and then intall from requirements.txt:
conda create --name=dmx python=3.8
conda activate dmx
conda install uvicorn
pip install -r requirements.txt
Docker Install and Run
docker build -t dmx .
docker run -p 80:80 dmx
Package Install
pip install domainmodelexaminer
Usage
Package Usage
Examine a url:
import domainmodelexaminer as dmx
url = "https://github.com/jataware/dummy-model"
yaml = dmx.examine(url)
List command line options
python main.py --help
Process Local Repository
Clone or download the repository of interest. For example:
cd /tmp
git clone https://github.com/jataware/dummy-model.git
Next, analyze this repo with:
python main.py --repo="/tmp/dummy-model"
Process Remote Repository
python main.py --url="https://github.com/jataware/dummy-model.git"
This creates and deletes a tempory folder 'tmp'.
Output
The application produces a .yaml file with prefix 'dmx-' concatenated with the repo name.
Running the API
Run API:
uvicorn api:app
http://127.0.0.1:8000/
Do not use --reload flag, since the app will download the repo to the api folder.
Testing Repositories
- https://github.com/jataware/dummy-model
- https://github.com/djgroen/FabFlee
- https://github.com/jataware/maxhop
- https://github.com/DSSAT/pythia/tree/develop [
develop
branch] - https://github.com/mjpuma/FSC-WorldModelers
Note that Pythia is a highly abstracted Python version of the DSSAT model.
API Reference
Default port for Docker is 80. Default port for Uvicorn is 8000. Examples given below assume the Uvicorn server is running at port 8000.
Docs
GET /docs
e.g. http://127.0.0.1:8000/docs
Confirm the API is available:
GET /
e.g. http://127.0.0.1:8000/
Returns
{"status":"running"}
Examine URL
GET /examine/${url}
e.g. http://127.0.0.1:8000/examine/?url=https://github.com/jataware/dummy-model.git
Parameter | Type | Description |
---|---|---|
url |
string |
Required. URL of GitHub repo |
Returns
yaml-formatted string
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Hashes for domainmodelexaminer-0.0.1.tar.gz
Algorithm | Hash digest | |
---|---|---|
SHA256 | daec68ca0b5d2765a85c824d1e5a109b2b5886c59263596a244cae562551a421 |
|
MD5 | 391f62e3286486f8336933f6f94d9c87 |
|
BLAKE2b-256 | 69b5b96502a37b6a8c0bb50ee505af47f293ee50b9efdfbc400fe4b3749183f1 |
Hashes for domainmodelexaminer-0.0.1-py2.py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 15238f0a620fcf446d7175e227083c013f6466ba3ad0d74477d76c83659e00a1 |
|
MD5 | 1132f79f3636d7042a811da07d79cea4 |
|
BLAKE2b-256 | aac51f4bdf9b0d514e74622a0b3e33cecc96ae5f3087095861a37d7f80720648 |