No description
  • Python 96.2%
  • Shell 3.8%
Find a file
Repository files (latest commit first)
Filename Latest commit message Latest commit date
Humphrey Drummond 5bf86c7566 Add Links section to README
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-09 18:36:41 +00:00
data packing up 2022-06-02 13:18:33 +01:00
src packing up 2022-06-02 13:18:33 +01:00
.gitignore Added new source + grabbed data 2016-11-17 13:04:30 +02:00
all packing up 2022-06-02 13:18:33 +01:00
cli.py packing up 2022-06-02 13:18:33 +01:00
fabfile.py packing up 2022-06-02 13:18:33 +01:00
house-of-tartan packing up 2022-06-02 13:18:33 +01:00
LICENSE packing up 2022-06-02 13:18:33 +01:00
README.md Add Links section to README 2026-03-09 18:36:41 +00:00
register-of-tartans packing up 2022-06-02 13:18:33 +01:00
requirements.txt packing up 2022-06-02 13:18:33 +01:00
stg packing up 2022-06-02 13:18:33 +01:00
storage.tar.gz Parse data from Tartans of Scotland; consolidate output formats for all sources 2016-11-17 16:25:55 +02:00
tartans-authority packing up 2022-06-02 13:18:33 +01:00
tartans-of-scotland packing up 2022-06-02 13:18:33 +01:00
task-plus.yml Add task-plus.yml for migration 2026-03-09 18:28:53 +00:00
weddslist packing up 2022-06-02 13:18:33 +01:00

Tartan threadcounts from different sources

This is forked from https://github.com/thetartan/tartan-database. I am aiming to make it work on Python 3 and on Windows. I also want to explore creating tartan images. I have also moved from bash files to fabric files.

Sources

Dataset files are available in the data directory - each dataset in its own subfolder. Raw/unparsed data can be found in storage directory after running any of processing scripts.

Requirements

See requirements.txt

  • Python 3;
  • requests library (version 2.9.1 properly works with TLSv1; newer versions are somehow broken);
  • Pillow library (for Scottish Tartans Authority).

Usage

Run corresponding bash script to update a source:

  • ./all - all sources
  • ./weddslist - for Weddslist
  • ./house-of-tartan - for House of Tartan
  • ./tartans-authority - for Scottish Tartans Authority
  • ./tartans-of-scotland - for Tartans os Scotland
  • ./register-of-tartans - for Scottish Register of Tartans

Type ./<source> --help to list possible arguments (note: ./all --help will display arguments multiple times - choose any, they are completely the same).

Configuration

Set this environment variables before running bash scripts:

  • DATASET_AUTHOR - to update author field in datapackage.json
  • DATASET_VERSION - to update version field in datapackage.json

About cache

Grabbers by their nature are very fragile scripts. Depending on situation, it may be possible that they have the only chance to run. So it's good idea to split parsing into two steps: grabbing necessary files to local hard drive, and then process them. Having local cache, parser may run as many times as it needs; it should not wait for grabbing files. This project uses storage folder to store grabbed files - each source has own subfolder.

Meantime, it's bad idea to store all grabbed files in GIT; much better is to compress them and store archive - since grabbed data is usually very similar (at least, page header and footer will be the same for single site), it will reduce data size 10 and more times.

To save raw grabbed files after running grabbers, you can use stg script: ./stg pack - pack storage folder, ./stg unpack - restore previously packed files.

Documentation https://h3-tartan-database.statichost.page/
Source (Codeberg) https://codeberg.org/hum3/tartan-database
Mirror (GitHub) https://github.com/drummonds/tartan-database
Docs repo https://codeberg.org/hum3/tartan-database-docs