openzim / cms

ZIM file Publishing Platform
https://cms.openzim.org
GNU General Public License v3.0
4 stars 0 forks source link

Add `/titles/` and `/titles/{ident}` endpoint #39

Closed anshulxyz closed 2 years ago

anshulxyz commented 2 years ago

add folllowing routes

- [ ] GET /titles

For pagination I am using https://github.com/uriyyo/fastapi-pagination

Output

{
  "total": 2,
  "page": 1,
  "size": 50,
  "items": [
    {"ident": "wikipedia_fr_all_maxi"},
    {"ident": "wikipedia_fr_all_nopic"}
  ]
}

- [x] GET /titles/{ident}

Output

[
  {
    "ident": "wikihow_fr_all_maxi",
    "languages": [
      "fra"
    ],
    "metadata": {
      "Creator": "Wikipedia",
      "Description": "offline version of Wikipedia in Ganda",
      "Flavour": "maxi",
      "Language": "fra",
      "Name": "wikipedia_fr_all_maxi",
      "Publisher": "Kiwix",
      "Tags": "wikihow;_category:wikipedia",
      "Title": "Wikipedia",
      "Scraper": "wikihow2zim 1.11",
      "Illustration_48x48": "xxx"
    },
    "tags": [
      "wikihow",
      "_category:wikipedia"
    ]
  }
]
codecov[bot] commented 2 years ago

Codecov Report

Merging #39 (6524351) into main (8414447) will not change coverage. The diff coverage is 100.00%.

:exclamation: Current head 6524351 differs from pull request most recent head 5f70dec. Consider uploading reports for the commit 5f70dec to get more accurate results Impacted file tree graph

@@            Coverage Diff            @@
##              main       #39   +/-   ##
=========================================
  Coverage   100.00%   100.00%           
=========================================
  Files            6         9    +3     
  Lines          190       221   +31     
=========================================
+ Hits           190       221   +31     
Impacted Files Coverage Δ
backend/src/backend/main.py 100.00% <100.00%> (ø)
backend/src/backend/models.py 100.00% <100.00%> (ø)
backend/src/backend/routes/books.py 100.00% <100.00%> (ø)
backend/src/backend/routes/test.py 100.00% <100.00%> (ø)
backend/src/backend/routes/titles.py 100.00% <100.00%> (ø)
backend/src/backend/schemas.py 100.00% <100.00%> (ø)

Continue to review full report at Codecov.

Legend - Click here to learn more Δ = absolute <relative> (impact), ø = not affected, ? = missing data Powered by Codecov. Last update 8414447...5f70dec. Read the comment docs.

anshulxyz commented 2 years ago

Hi @rgaudin can you take a look?

anshulxyz commented 2 years ago

and also adress the remaining data in the DB

working on this now