Skip to content

an advanced api server fot bubble-sheet extractions using computer-vision

License

Notifications You must be signed in to change notification settings

erfantkerfan/bubble-sheet

Repository files navigation

Project setup with Docker:

  1. run cp .env.example .env
  2. configure APP_PORT as the web interface port the default is 8050
  3. configure MASTER_TOKEN as the master token for administration
  4. run docker-compose up --build -d
  5. in case it's needed to send any inside docker use docker-compose exec web python main.py --help

api documentation

health check
GET `/api/health/check`

api v1 documentation

scan bubble-sheet sample response
POST `/api/v1/scan/test`
scan bubble-sheet form MinIO source
POST `/api/v1/scan/minio`
{
  "token": "hgRHGxrX6yd4Zz5gtSVxDkARcrkjAF_vf7PkkF8jDRA",
  "path": "pics/test.jpg",
  "path_choices": "output_pics/test.jpg"
}
scan bubble-sheet form a url
POST `/api/v1/scan/url`
{
  "url": "https://nodes.alaatv.com/test/test.jpg"
}
scan bubble-sheet form a multipart-request
POST `/api/v1/scan/direct`
{
  "image": "[FILE.jpg]"
}
detect qrcode sample response
POST `/api/v1/detect/test`
detect qrcode form MinIO source
POST `/api/v1/detect/minio`
{
  "token": "hgRHGxrX6yd4Zz5gtSVxDkARcrkjAF_vf7PkkF8jDRA",
  "path": "pics/test.jpg"
}
detect qrcode form a url
POST `/api/v1/detect/url`
{
  "url": "https://nodes.alaatv.com/test/test.jpg"
}
detect qrcode form a multipart-request
POST `/api/v1/detect/direct`
{
  "image": "[FILE.jpg]"
}
sheet generator using MinIO for storage
POST `/api/v1/generate/minio`
{
  "token": "hgRHGxrX6yd4Zz5gtSVxDkARcrkjAF_vf7PkkF8jDRA",
  "path": "output/alaa.zip",
  "data": [
    {
      "name": "عرفان قلی زاده",
      "ostan": "تهران",
      "shahr": "تهران",
      "date": "1400/09/05",
      "duration": "60 دقیقه",
      "start": "07:30",
      "exam_description": "آزمون شماره ۱۲ - پایه دوازدهم ریاضی",
      "qrcode": "71bdcea2cb12aa4141711919,123456789"
    },
    {
      "name": "سهراب ابوذرخانی فرد",
      "ostan": "تهران",
      "shahr": "تهران",
      "date": "1400/09/05",
      "duration": "60 دقیقه",
      "start": "07:30",
      "exam_description": "آزمون شماره 135 - پایه دهم ریاضی تجربی",
      "qrcode": "31bdcea2cb14ea4181711920,987654321"
    },
    {
      "name": "سید دانیال معین آل داوودی سادات پور",
      "ostan": "سیستان و بلوچستان اطراف چهار راه",
      "shahr": "اسلام آباد غرب اصل آباد",
      "date": "1400/09/05",
      "duration": "60 دقیقه",
      "start": "07:30",
      "exam_description": "آزمون شماره 135 - پایه دهم ریاضی تجربی",
      "qrcode": "61bdcea2cb14ea4181711919,111111113"
    }
  ]
}
administration
generate a user token
POST `/api/v1/token/minio`
{
  "master_token": "PtXQe66HDpI4AVCFu5HSZBW7QEuCDwwuysDhs2hfpvo",
  "endpoint": "nodes.alaatv.com",
  "bucket": "test",
  "access_key": "xxxxxxxxxxxxxxxxx",
  "secret_key": "yyyyyyyyyyyyyyyyyy"
}
remove a user token
DELETE `/api/v1/token/minio`
{
  "master_token": "PtXQe66HDpI4AVCFu5HSZBW7QEuCDwwuysDhs2hfpvo",
  "token": "rmT4WoMWYwrdjJF2hDs6bGEU9Uh-Ng3xK9rkLCVxd90"
}
remove all tokens
DELETE `/api/v1/token/minio`
{
  "master_token": "PtXQe66HDpI4AVCFu5HSZBW7QEuCDwwuysDhs2hfpvo",
  "token": "all"
}

About

an advanced api server fot bubble-sheet extractions using computer-vision

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages