Skip to main content

Download a complete history of georeferenced flickr posts

Project description

Download a complete history of georeferenced flickr posts

This is a Python script that can download a complete history of georeferenced flickr photo metadata. It uses the official flickr API, and saves the data into a PostgreSQL/PostGIS database.

The script will download all photos until its starting time, and keep track of already downloaded time periods in a cache file (default location ~/.cache/flickrhistory.yml). Upon restart it will catch up until the new starting time.

Flickrhistory makes use of multiple threads and can use multiple API keys (something that most likely disagrees with flickr’s T&C, use feature at your own risk).

If you use flickrhistory for scientific research, please cite it in your publication:

Fink, C. (2020): flickrhistory: a Python tool to download a complete flickr timeline. doi:10.5281/zenodo.6566196.

screen shot

Dependencies

The script is written in Python 3 and depends on the Python modules blessed, GeoAlchemy2, psycopg2, PyYaml, Requests and SQLAlchemy.

Installation

pip install flickrhistory

Configuration

Copy the example configuration file flickrhistory.yml.example to a suitable location, depending on your operating system:

  • on Linux systems:
    • system-wide configuration: /etc/flickrhistory.yml
    • per-user configuration:
      • ~/.config/flickrhistory.yml OR
      • ${XDG_CONFIG_HOME}/flickrhistory.yml
  • on MacOS systems:
    • per-user configuration:
      • ${XDG_CONFIG_HOME}/flickrhistory.yml
  • on Microsoft Windows systems:
    • per-user configuration: %APPDATA%\flickrhistory.yml

Adapt the configuration:

  • Configure a PostgreSQL connection string (connection_string), pointing to an existing database (with the PostGIS extension enabled).
  • Configure one or more API access keys to the flickr API flickr_api_keys). Using more than one API key in all likelihood violates the Terms and Conditions of the Flickr API (don’t do it!).

If you have a cache file from a previous installation in which already downloaded time periods are saved, copy it to ${XDG_CACHE_HOME}/flickrhistory.yml or %LOCALAPPDATA%/flickrhistory.yml on Linux or MacOS, and Microsoft Windows, respectively.

Usage

Command line executable

python -m flickrhistory

Python

Import the flickrhistory module. Instantiate a FlickrHistoryDownloader, and call its download() method.

import flickrhistory

downloader = flickrhistory.FlickrHistoryDownloader()
downloader.download()

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

flickrhistory-0.3.1.tar.gz (34.2 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

flickrhistory-0.3.1-py3-none-any.whl (44.8 kB view details)

Uploaded Python 3

File details

Details for the file flickrhistory-0.3.1.tar.gz.

File metadata

  • Download URL: flickrhistory-0.3.1.tar.gz
  • Upload date:
  • Size: 34.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.12.9

File hashes

Hashes for flickrhistory-0.3.1.tar.gz
Algorithm Hash digest
SHA256 ccd127d5732b6679fa19f081d479ce0e650fdd32aba00f0d5528892578eddd88
MD5 8ca8ed7243f2115dd0e74b98d69e547a
BLAKE2b-256 0e6656fcaac1a9e1ac5eee85358bb9a15912ac2897bd209904ceaf1eb571cead

See more details on using hashes here.

Provenance

The following attestation bundles were made for flickrhistory-0.3.1.tar.gz:

Publisher: release.yml on DigitalGeographyLab/flickrhistory

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file flickrhistory-0.3.1-py3-none-any.whl.

File metadata

  • Download URL: flickrhistory-0.3.1-py3-none-any.whl
  • Upload date:
  • Size: 44.8 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.12.9

File hashes

Hashes for flickrhistory-0.3.1-py3-none-any.whl
Algorithm Hash digest
SHA256 815d4edccaeac82c937572edbbd013f52f1f79d45b308470643917e41dca3982
MD5 8bf0be8687324f4455d0568bc65aa803
BLAKE2b-256 52cd96aa7385553dc301a4feb699e0027b188dd275ded606fb544ca94f8056f8

See more details on using hashes here.

Provenance

The following attestation bundles were made for flickrhistory-0.3.1-py3-none-any.whl:

Publisher: release.yml on DigitalGeographyLab/flickrhistory

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page