pinforge

A small Python package with two jobs: build vertical 1000×1500 Pinterest pins from an image and a few lines of text, and work out what to publish first from a Google Search Console export, counted separately for every language of a site.

pip install pinforge

Package page: pypi.org/project/pinforge

Why rank per locale

If a site has several language versions, demand in each one is different. Summing impressions across the whole site and reusing one order for every language sends the best material to the wrong audience.

The package was written for Tarot Magic, a tarot reference with the same 78 cards in four languages. The most-searched card in each language was a different card:

LocaleTop cardImpressions
UkrainianSix of Wands308
RussianTen of Cups270
EnglishFour of Wands158
FrenchThe Magician19

Four different answers, not the same list in a different order.

Usage

from pinforge import rank_by_locale

queues = rank_by_locale(
    "pages.csv",
    item_pattern=r"/card/([^/?]+)$",
    locales=("ru", "uk", "fr"),
    default_locale="en",
)
for slug, impressions in queues["uk"][:5]:
    print(slug, impressions)

It reads the CSV the way Search Console exports it, in any interface language: column names are detected, not hard-coded.

Live example

The card pins on the site's Pinterest boards come from the same code this package was extracted from. The card pages the pins point to are at tarot-magic.com/card-meanings.