Skip to content

Commit

Permalink
feat: update readme, add dockerfile, and validate document before
Browse files Browse the repository at this point in the history
parsing
  • Loading branch information
magiskboy committed Jul 2, 2023
1 parent 5b44fba commit 3f6e375
Show file tree
Hide file tree
Showing 3 changed files with 50 additions and 13 deletions.
57 changes: 44 additions & 13 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,22 +1,53 @@
![Lucky Luke](https://i.ibb.co/vL1MmML/luke.png)

![GitHub Workflow Status (with event)](https://img.shields.io/github/actions/workflow/status/magiskboy/luke/test-suite.yml)
![GitHub commit activity (branch)](https://img.shields.io/github/commit-activity/w/magiskboy/luke)
![Codecov](https://img.shields.io/codecov/c/github/magiskboy/luke)
![PyPI - Downloads](https://img.shields.io/pypi/dd/py-luke)
![GitHub](https://img.shields.io/github/license/magiskboy/luke)
![PyPI - Python Version](https://img.shields.io/pypi/pyversions/py-luke)
![PyPI](https://img.shields.io/pypi/v/py-luke)
<p align="center">
<img width="420px" src="https://i.ibb.co/vL1MmML/luke.png" alt='py-luke'>
</p>
<p align="center">
<em>Working on OpenAPI easily.</em>
</p>
<p align="center">
<a href="https://github.com/magiskboy/luke/actions">
<img src="https://github.com/magiskboy/luke/actions/workflows/test-suite.yml/badge.svg" alt="Build Status">
</a>
<a href="https://app.codecov.io/gh/magiskboy/luke">
<img src="https://img.shields.io/codecov/c/github/magiskboy/luke" alt="Code coverage">
</a>
<a href="https://pypi.org/project/py-luke/">
<img src="https://img.shields.io/pypi/dd/py-luke" alt="Download PyPi">
</a>
<a href="https://github.com/magiskboy/luke/blob/main/LICENSE">
<img src="https://img.shields.io/github/license/magiskboy/luke" alt="MIT">
</a>
<a href="https://pypi.org/project/py-luke/">
<img src="https://img.shields.io/pypi/pyversions/py-luke" alt="Py version">
</a>
<a href="https://pypi.org/project/py-luke/">
<img src="https://img.shields.io/pypi/v/py-luke" alt="PyPi version">
</a>
</p>


## Features

Some of main features:

- Create a mock server for OpenAPI document
- Validate OpenAPI document
- Bundle OpenAPI fragments into the single document

py-luke supports both json and yaml type. Besides, you can also open file via path or URL.

## Installation

## Overview
You can install py-luke from PyPi

Luke is a mock server based on OpenAPI Specification. All of you need to do is declaring OpenAPI document and starting luke server with it.
```bash
$ pip install py-luke
```

## Installation
Or from docker

```bash
$ pip install py-luke
$ docker run nguyenkhacthanh/luke:latest
```

## Usage
Expand Down
5 changes: 5 additions & 0 deletions dockerfiles/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
FROM python:3.11-alpine

RUN pip install py-luke

ENTRYPOINT ["luke mock"]
1 change: 1 addition & 0 deletions luke/openapi.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ def __init__(self):

def load(self, filename_or_url: str):
spec = self.load_file(filename_or_url)
self.validate_openapi(spec)
self.parse_spec(spec)

def parse_spec(self, spec: dict):
Expand Down

0 comments on commit 3f6e375

Please sign in to comment.