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.
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
- system-wide configuration:
- on MacOS systems:
- per-user configuration:
${XDG_CONFIG_HOME}/flickrhistory.yml
- per-user configuration:
- on Microsoft Windows systems:
- per-user configuration:
%APPDATA%\flickrhistory.yml
- per-user configuration:
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
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
File details
Details for the file flickrhistory-0.2.1.tar.gz
.
File metadata
- Download URL: flickrhistory-0.2.1.tar.gz
- Upload date:
- Size: 29.7 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.1 CPython/3.9.18
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | e4f064c6c5ccd3dc62b52d0d05b1384dc04d6df55c898779322bf9b9f441dea2 |
|
MD5 | 2fcba8d90195e7a4043e39dab02a6346 |
|
BLAKE2b-256 | ab94d54dde7229655443201784fdaad4e3f28877501c7ce808ec390ecd02b0f8 |
File details
Details for the file flickrhistory-0.2.1-py3-none-any.whl
.
File metadata
- Download URL: flickrhistory-0.2.1-py3-none-any.whl
- Upload date:
- Size: 42.0 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.1 CPython/3.9.18
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | c1b11f35b9b6206660edc4f3fa8b67d255269dbddb856088333f009862ef9034 |
|
MD5 | 926a4e541891ce7ab4a0299b13aee1ad |
|
BLAKE2b-256 | 0deff75bd27b7a177685d18658699c3e031f1e457cda734cf00abc23dc02ad26 |