Giter Site home page Giter Site logo

ddi-converter-tool's Introduction

Swagger generated server

Overview

This server was generated by the swagger-codegen project.

How to generate:

swagger-codegen generate -c dct-swagger-codegen-config.json -i ddi-converter-tool.yaml -l python-flask  -o .

Requirements

Python 3.5.2+

Usage

To run the server, please execute the following from the root directory:

pip3 install -r requirements.txt
pip3 install --no-cache-dir -r requirements.txt
pip3 install "connexion[swagger-ui]"

pip3 install connexion[swagger-ui]
Note: 
When the result something like 'zsh: no matches found: connexion[swagger-ui]'
Solution:
pip3 install "connexion[swagger-ui]"

pip3 install flask-debugtoolbar
pip3 install flask_cors
pip3 setup.py
pip3 install lxml
pip3 install xmltodict
pip3 install pyDataverse

python3 -m dct_server --reload

and open your browser to here:

http://localhost:8520/api/ui/

Your Swagger definition lives here:

http://localhost:8520/api/swagger.json

To launch the integration tests, use tox:

sudo pip install tox
tox

Running with Docker

To run the server on a Docker container, please execute the following from the root directory:

# building the image
docker build -t dct_server .

# starting up a container
docker run -p 8520:8520 dct_server

swagger-codegen generate -i ddi-converter-tool.yaml -l python-flask -o .

Notes: Since python does not have any equivalent of interfaces like in java, so the implementation of controller is written in default_controller.py. It means that the default_controller.py needs to add in .swagger-codegen-ignore file.

For SSHOC image: docker build -t sshoc/ddi-converter-tool . docker run -d -it -p 8520:8520 --name dct_server sshoc/ddi-converter-tool

curl -X POST "http://127.0.0.1:8520/api/convert/ekoi/c89e6f53-9edc-4a73-9ff5-4447e6911f2b?xsl_url=https%3A%2F%2Fraw.githubusercontent.com%2Fekoi%2Fddi-converter-tool%2Fmaster%2Fxsl%2Fddi-to-dataset-csv.xsl&author_name=Indarto%2C%20E&author_affiliation=DANS&contact_name=Indarto%2C%20Eko&contact_email=eko.indarto%40dans.knaw.nl&subject=Medicine%2C%20Health%20and%20Life%20Sciences" -H "accept: */*" -H "Content-Type: multipart/form-data" -F "[email protected];type=text/xml"

ddi-converter-tool's People

Contributors

ekoi avatar skasberger avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.