# 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: <br />
> Fink, C. (2020): *flickrhistory: a Python tool to download a complete flickr timeline*. [doi:10.5281/zenodo.6566196](https://doi.org/10.5281/zenodo.6566196).
<!--//
TODO: create separate repository containing a one-stop-shop script for updating the HELICS/DGL dataset, and add a link for Vuokko, Wäeski and co here.
//-->
![screen shot](extra/images/screenshot.png)
### Dependencies
The script is written in Python 3 and depends on the Python modules [blessed](https://blessed.readthedocs.io/), [GeoAlchemy2](https://geoalchemy-2.readthedocs.io/), [psycopg2](https://www.psycopg.org/), [PyYaml](https://pyyaml.org/), [Requests](https://2.python-requests.org/en/master/) and [SQLAlchemy](https://sqlalchemy.org/).
### Installation
```shell
pip install flickrhistory
```
### Configuration
Copy the example configuration file [flickrhistory.yml.example](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](https://flickr.com/services/api/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
```shell
python -m flickrhistory
```
#### Python
Import the `flickrhistory` module. Instantiate a `FlickrHistoryDownloader`, and call its `download()` method.
```python
import flickrhistory
downloader = flickrhistory.FlickrHistoryDownloader()
downloader.download()
```
Raw data
{
"_id": null,
"home_page": "https://gitlab.com/christoph.fink/flickrhistory/",
"name": "flickrhistory",
"maintainer": "",
"docs_url": null,
"requires_python": "",
"maintainer_email": "",
"keywords": "",
"author": "Christoph Fink",
"author_email": "christoph.fink@helsinki.fi",
"download_url": "https://files.pythonhosted.org/packages/ab/94/d54dde7229655443201784fdaad4e3f28877501c7ce808ec390ecd02b0f8/flickrhistory-0.2.1.tar.gz",
"platform": null,
"description": "# Download a complete history of georeferenced flickr posts\n\nThis 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.\n\nThe 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.\n\n*Flickrhistory* makes use of multiple threads and can use multiple API keys (something that most likely disagrees with flickr\u2019s T&C, use feature at your own risk).\n\nIf you use *flickrhistory* for scientific research, please cite it in your publication: <br />\n> Fink, C. (2020): *flickrhistory: a Python tool to download a complete flickr timeline*. [doi:10.5281/zenodo.6566196](https://doi.org/10.5281/zenodo.6566196).\n\n<!--//\nTODO: create separate repository containing a one-stop-shop script for updating the HELICS/DGL dataset, and add a link for Vuokko, W\u00e4eski and co here.\n//-->\n\n![screen shot](extra/images/screenshot.png)\n\n### Dependencies\n\nThe script is written in Python 3 and depends on the Python modules [blessed](https://blessed.readthedocs.io/), [GeoAlchemy2](https://geoalchemy-2.readthedocs.io/), [psycopg2](https://www.psycopg.org/), [PyYaml](https://pyyaml.org/), [Requests](https://2.python-requests.org/en/master/) and [SQLAlchemy](https://sqlalchemy.org/).\n\n### Installation\n\n```shell\npip install flickrhistory\n```\n\n### Configuration\n\nCopy the example configuration file [flickrhistory.yml.example](flickrhistory.yml.example) to a suitable location, depending on your operating system: \n\n- on Linux systems:\n - system-wide configuration: `/etc/flickrhistory.yml`\n - per-user configuration: \n - `~/.config/flickrhistory.yml` OR\n - `${XDG_CONFIG_HOME}/flickrhistory.yml`\n- on MacOS systems:\n - per-user configuration:\n - `${XDG_CONFIG_HOME}/flickrhistory.yml`\n- on Microsoft Windows systems:\n - per-user configuration:\n `%APPDATA%\\flickrhistory.yml`\n\nAdapt the configuration:\n\n- Configure a PostgreSQL connection string (`connection_string`), pointing to an existing database (with the PostGIS extension enabled).\n- Configure one or more API [access keys](https://flickr.com/services/api/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\u2019t do it!).\n\nIf 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.\n\n### Usage\n\n#### Command line executable\n\n```shell\npython -m flickrhistory\n```\n\n#### Python\n\nImport the `flickrhistory` module. Instantiate a `FlickrHistoryDownloader`, and call its `download()` method.\n\n```python\nimport flickrhistory\n\ndownloader = flickrhistory.FlickrHistoryDownloader()\ndownloader.download()\n```\n",
"bugtrack_url": null,
"license": "GPLv3",
"summary": "Download a complete history of georeferenced flickr posts",
"version": "0.2.1",
"project_urls": {
"Homepage": "https://gitlab.com/christoph.fink/flickrhistory/"
},
"split_keywords": [],
"urls": [
{
"comment_text": "",
"digests": {
"blake2b_256": "0deff75bd27b7a177685d18658699c3e031f1e457cda734cf00abc23dc02ad26",
"md5": "926a4e541891ce7ab4a0299b13aee1ad",
"sha256": "c1b11f35b9b6206660edc4f3fa8b67d255269dbddb856088333f009862ef9034"
},
"downloads": -1,
"filename": "flickrhistory-0.2.1-py3-none-any.whl",
"has_sig": false,
"md5_digest": "926a4e541891ce7ab4a0299b13aee1ad",
"packagetype": "bdist_wheel",
"python_version": "py3",
"requires_python": null,
"size": 42011,
"upload_time": "2024-01-08T08:47:14",
"upload_time_iso_8601": "2024-01-08T08:47:14.620039Z",
"url": "https://files.pythonhosted.org/packages/0d/ef/f75bd27b7a177685d18658699c3e031f1e457cda734cf00abc23dc02ad26/flickrhistory-0.2.1-py3-none-any.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": "",
"digests": {
"blake2b_256": "ab94d54dde7229655443201784fdaad4e3f28877501c7ce808ec390ecd02b0f8",
"md5": "2fcba8d90195e7a4043e39dab02a6346",
"sha256": "e4f064c6c5ccd3dc62b52d0d05b1384dc04d6df55c898779322bf9b9f441dea2"
},
"downloads": -1,
"filename": "flickrhistory-0.2.1.tar.gz",
"has_sig": false,
"md5_digest": "2fcba8d90195e7a4043e39dab02a6346",
"packagetype": "sdist",
"python_version": "source",
"requires_python": null,
"size": 29665,
"upload_time": "2024-01-08T08:47:16",
"upload_time_iso_8601": "2024-01-08T08:47:16.298318Z",
"url": "https://files.pythonhosted.org/packages/ab/94/d54dde7229655443201784fdaad4e3f28877501c7ce808ec390ecd02b0f8/flickrhistory-0.2.1.tar.gz",
"yanked": false,
"yanked_reason": null
}
],
"upload_time": "2024-01-08 08:47:16",
"github": false,
"gitlab": true,
"bitbucket": false,
"codeberg": false,
"gitlab_user": "christoph.fink",
"gitlab_project": "flickrhistory",
"lcname": "flickrhistory"
}