Access Photos.app’s Judgements of your Photos

Ever look at the sqlite3 DB in the Photos.app library bundle ~/Pictures/Photos Library.photoslibrary? So much stuff. I would suggest making a copy of it, and only mess around with the copy.

import sqlite3

# Connect to your database
conn = sqlite3.connect('/path/to/your/Photos copy.sqlite')
cursor = conn.cursor()

# Get the list of tables
cursor.execute("SELECT name FROM sqlite_master WHERE type='table';")
tables = cursor.fetchall()

# Loop through the tables and check for columns containing "SCORE"
for table in tables:
    table_name = table[0]
    cursor.execute(f"PRAGMA table_info({table_name});")
    columns = cursor.fetchall()
    for column in columns:
        column_name = column[1]
        if "SCORE" in column_name:
            print(f"Table '{table_name}' has a column '{column_name}' containing 'SCORE'.")

# Close the connection
conn.close()

The output of the above code is shown below:

Table 'ZCOMPUTEDASSETATTRIBUTES' has a column 'ZBEHAVIORALSCORE' containing 'SCORE'.
Table 'ZCOMPUTEDASSETATTRIBUTES' has a column 'ZFAILURESCORE' containing 'SCORE'.
Table 'ZCOMPUTEDASSETATTRIBUTES' has a column 'ZHARMONIOUSCOLORSCORE' containing 'SCORE'.
Table 'ZCOMPUTEDASSETATTRIBUTES' has a column 'ZIMMERSIVENESSSCORE' containing 'SCORE'.
Table 'ZCOMPUTEDASSETATTRIBUTES' has a column 'ZINTERACTIONSCORE' containing 'SCORE'.
Table 'ZCOMPUTEDASSETATTRIBUTES' has a column 'ZINTERESTINGSUBJECTSCORE' containing 'SCORE'.
Table 'ZCOMPUTEDASSETATTRIBUTES' has a column 'ZINTRUSIVEOBJECTPRESENCESCORE' containing 'SCORE'.
Table 'ZCOMPUTEDASSETATTRIBUTES' has a column 'ZLIVELYCOLORSCORE' containing 'SCORE'.
Table 'ZCOMPUTEDASSETATTRIBUTES' has a column 'ZNOISESCORE' containing 'SCORE'.
Table 'ZCOMPUTEDASSETATTRIBUTES' has a column 'ZPLEASANTCAMERATILTSCORE' containing 'SCORE'.
Table 'ZCOMPUTEDASSETATTRIBUTES' has a column 'ZPLEASANTCOMPOSITIONSCORE' containing 'SCORE'.
Table 'ZCOMPUTEDASSETATTRIBUTES' has a column 'ZPLEASANTLIGHTINGSCORE' containing 'SCORE'.
Table 'ZCOMPUTEDASSETATTRIBUTES' has a column 'ZPLEASANTPATTERNSCORE' containing 'SCORE'.
Table 'ZCOMPUTEDASSETATTRIBUTES' has a column 'ZPLEASANTPERSPECTIVESCORE' containing 'SCORE'.
Table 'ZCOMPUTEDASSETATTRIBUTES' has a column 'ZPLEASANTPOSTPROCESSINGSCORE' containing 'SCORE'.
Table 'ZCOMPUTEDASSETATTRIBUTES' has a column 'ZPLEASANTREFLECTIONSSCORE' containing 'SCORE'.
Table 'ZCOMPUTEDASSETATTRIBUTES' has a column 'ZPLEASANTSYMMETRYSCORE' containing 'SCORE'.
Table 'ZCOMPUTEDASSETATTRIBUTES' has a column 'ZSHARPLYFOCUSEDSUBJECTSCORE' containing 'SCORE'.
Table 'ZCOMPUTEDASSETATTRIBUTES' has a column 'ZTASTEFULLYBLURREDSCORE' containing 'SCORE'.
Table 'ZCOMPUTEDASSETATTRIBUTES' has a column 'ZWELLCHOSENSUBJECTSCORE' containing 'SCORE'.
Table 'ZCOMPUTEDASSETATTRIBUTES' has a column 'ZWELLFRAMEDSUBJECTSCORE' containing 'SCORE'.
Table 'ZCOMPUTEDASSETATTRIBUTES' has a column 'ZWELLTIMEDSHOTSCORE' containing 'SCORE'.
Table 'ZDETECTIONTRAIT' has a column 'ZSCORE' containing 'SCORE'.
Table 'ZMEDIAANALYSISASSETATTRIBUTES' has a column 'ZACTIVITYSCORE' containing 'SCORE'.
Table 'ZMEDIAANALYSISASSETATTRIBUTES' has a column 'ZAUTOPLAYSUGGESTIONSCORE' containing 'SCORE'.
Table 'ZMEDIAANALYSISASSETATTRIBUTES' has a column 'ZBLURRINESSSCORE' containing 'SCORE'.
Table 'ZMEDIAANALYSISASSETATTRIBUTES' has a column 'ZEXPOSURESCORE' containing 'SCORE'.
Table 'ZMEDIAANALYSISASSETATTRIBUTES' has a column 'ZVIDEOSCORE' containing 'SCORE'.
Table 'ZMEDIAANALYSISASSETATTRIBUTES' has a column 'ZWALLPAPERSCORE' containing 'SCORE'.
Table 'ZMEDIAANALYSISASSETATTRIBUTES' has a column 'ZAUDIOSCORE' containing 'SCORE'.
Table 'ZMEDIAANALYSISASSETATTRIBUTES' has a column 'ZVIDEOSTICKERSUGGESTIONSCORE' containing 'SCORE'.
Table 'ZMEDIAANALYSISASSETATTRIBUTES' has a column 'ZSETTLINGEFFECTSCORE' containing 'SCORE'.
Table 'ZMEMORY' has a column 'ZSCORE' containing 'SCORE'.
Table 'ZMOMENT' has a column 'ZAGGREGATIONSCORE' containing 'SCORE'.
Table 'ZQUESTION' has a column 'ZSCORE' containing 'SCORE'.
Table 'ZVISUALSEARCHATTRIBUTES' has a column 'ZSTICKERCONFIDENCESCORE' containing 'SCORE'.
Table 'ZDETECTEDFACE' has a column 'ZBLURSCORE' containing 'SCORE'.
Table 'ZPHOTOSHIGHLIGHT' has a column 'ZPROMOTIONSCORE' containing 'SCORE'.
Table 'ZASSET' has a column 'ZCURATIONSCORE' containing 'SCORE'.
Table 'ZASSET' has a column 'ZHIGHLIGHTVISIBILITYSCORE' containing 'SCORE'.
Table 'ZASSET' has a column 'ZICONICSCORE' containing 'SCORE'.
Table 'ZASSET' has a column 'ZOVERALLAESTHETICSCORE' containing 'SCORE'.
Table 'ZASSET' has a column 'ZPROMOTIONSCORE' containing 'SCORE'.
Table 'ZASSET' has a column 'ZSTICKERCONFIDENCESCORE' containing 'SCORE'.

… so then you can do stuff like:

select
	ZFILENAME,
	ZOVERALLAESTHETICSCORE
from
	ZASSET z
order by
	z.ZOVERALLAESTHETICSCORE DESC
limit 50;

About dre

I like all kinds of food.
This entry was posted in bit bucket. Bookmark the permalink.

Leave a Reply