Skip to content

Microservice to calculate smallest postive interger not in an array and retrieve statistics.

License

Notifications You must be signed in to change notification settings

PejeDev/Kuriboh

Repository files navigation

🐼 Kuriboh 🪄

Uptime GPLv3 License Codecov CI workflow

Microservice to get the smallest positive integer not in array and retrieve statistics.

Tech Stack

Development: Docker, Docker-compose, pytest, pylint.

Server: Python 3.9, Flask, Gunicorn, MongoDb.

Deployment: Dokku, Github Actions, codecov.

Features

  • Get the smallest positive integer not in array.
  • Get total of unique arrays validated through the API.
  • Get Count of occurrence as a calculation result from a number.
  • Get ratio between the total count of arrays calculated and result occurrence count from a number.
  • Get server status.

Demo

Run Locally

Clone the project

  git clone https://github.com/PejeDev/Kuriboh.git

Go to the project directory

  cd Kuriboh

Start the server

  docker-compose -D

API Reference

Get the smallest positive integer not in array

  POST /api/smallest

Body

{
  "array": [1, 3, 6, 4, 1, 2]
}

Response

{
  "result": 5
}
Property Type Description
result int Smallest positive integer not in array.

Get number array calculation stats

  GET /api/stats/${number}
Parameter Type Description
number int Required. Number to calculate stats.

Response

{
  "count": 40,
  "total": 100,
  "ratio": 0.4
}
Property Type Description
count int Count of the parameter number occurrence as a calculation result.
total int Number of unique arrays validated through the API and stored in a database.
ratio float Ratio between the total count of arrays calculated and the number parameter occurrence count.

Get server status

  GET /api/health

Response

{
  "successful": 1,
  "failed": 0,
  "total": 1,
  "created": "Sat, 03 Sep 2022 06:13:45 GMT",
  "updated": "Sat, 03 Sep 2022 06:13:45 GMT"
}
Property Type Description
successful int Count of successful requests.
failed int Count of failed requests.
total int Count of total requests.
created str Server stats creation date.
updated str Server stats last update date.

Authors

License

GPLv3

About

Microservice to calculate smallest postive interger not in an array and retrieve statistics.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages