A Python program which parses the data in the coblob database and transforms into a format which the co-data project can use. One of the main goals of this project is to reduce the load on the CPU in the co-data project. https://www.craigoates.net/Software/project/17
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
This repo is archived. You can view files and clone it, but cannot push or open issues/pull-requests.

29 lines
1.0 KiB

#!/usr/bin/python3
import requests
from datetime import datetime
from services import art_services, data_services
def main():
raw_art_data = data_services.get_json("https://api.craigoates.net/api/1.0/Artwork")
cd_totals = art_services.get_creation_date_totals(raw_art_data)
print(cd_totals)
cat_totals = art_services.get_db_column_totals(raw_art_data, "category")
print(cat_totals)
med_totals = art_services.get_db_column_totals(raw_art_data, "medium")
print(med_totals)
width_totals = art_services.get_dimension_totals(raw_art_data, "dimensions", "width")
print(width_totals)
height_totals = art_services.get_dimension_totals(raw_art_data, "dimensions", "height")
print(height_totals)
depth_totals = art_services.get_dimension_totals(raw_art_data, "dimensions", "depth")
print(depth_totals)
# Use for console priting for the moment.
date = datetime.now().strftime('%d/%m/%Y')
time = datetime.now().strftime("%H:%M")
return 0
if __name__ == "__main__":
main()