qrmagic


Nameqrmagic JSON
Version 0.2.3 PyPI version JSON
download
home_page
SummaryTools to manage qrcoded labels and images during Natural Variaiton experiments
upload_time2023-11-24 12:13:33
maintainer
docs_urlNone
author
requires_python
license
keywords qrcode fieldwork
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage No coveralls.
            # QR Magic

Some magical semi-automated tools to better handle sample tracking during fieldwork.

[![DOI](https://zenodo.org/badge/DOI/10.5281/zenodo.10049943.svg)](https://doi.org/10.5281/zenodo.10049943)


To install:

```
python3 -m pip install qrmagic
```

Or, to get the development version:
```
python3 -m pip install -e git+https://github.com/kdm9/NVTK.git
```

## QR Code Label Printing

Make a PDF of labels for each sample ID. There are a few hard-coded "Avery" label
types commonly used in the Weigel group, and it's super easy to add others
(please create a github issue if you need help doing so, or want me to build a
new label type into the code).


```bash
$ python3 -m qrmagic.labelmaker --help
usage: labelmaker.py [-h] [--demo DIR] [--list-label-types] [--label-type TYPE] [--copies N]
                     [--output FILE] [--id-file FILE] [--id-format FORMAT] [--id-start N] [--id-end N]

optional arguments:
  -h, --help            show this help message and exit
  --demo DIR            Write a demo (10 labels, four reps per label) for each label type to DIR.
  --list-label-types    Write a list of label types.
  --label-type TYPE     Label type.
  --copies N            Create N copies of each label.
  --output FILE         Output PDF file.
  --id-file FILE        File of IDs, one per line.
  --id-format FORMAT    Python-style format string governing ID format e.g. WGL{:04d} gives WGL0001..WGL9999
  --id-start N          First ID number (default 1)
  --id-end N            Last ID number (default 100)
```

To see what label types are available, do:

```
$ python3 -m qrmagic.labelmaker --list-label-types
L7636:  Mid-sized rounded rectangular labels (45x22mm) in sheets of 4x12
L3667:  Mid-sized rectangular labels (48x17mm) in sheets of 4x16
L7658:  Small labels (25x10mm) in sheets of 7x27
CryoLabel:  Cryo Labels for screw-cap eppies. White on left half, clear on right.
```

One can also create a demonstration PDF for each label type with the command:

```bash
$ python3 -m qrmagic.labelmaker --demo output_dir/
```

## QR Code-based Image organisation

So, we took all these photos in the field, now what do we do with them? The first step is to organise them by sample. To do so manually is cumbersome, so here are some tools to help.

### Step 1: scan images on your machine

This CLI tool will scan your images, doing its best to decode all the QRcodes
they contain. For each image it also reports the location and time the image
was taken, and various other bits of metadata.

NB: for silly javascript reasons, you need to have all images be in a single
directory. If you have your images organised in directories (e.g. by date, or
by camera), please run this process once per directory, or move or symlink all
images into a single directory.

```
qrmagic-detect -o my-images.json my-images/*.JPG
```


### Step 2: curation

Now, go to <https://qrmagic.kdmurray.id.au/imagesort.html>. Here, you should
upload the JSON file created above, and up will pop a table of images. You can
then try automatically filling missing barcodes based on the adjacent codes
(always do a bit of manual curation here), or manually type in QR codes that
are not detectable. When you are finished, you can download a Bash script which
contains commands to rename all your files by sample ID (or whatever your
barcodes denote).


### Step 3: rename images

Once downloaded, the renamer script should be run in the same directory your
images are all in:

```
cd /path/to/my-images
bash -x ~/Downloads/rename.sh
```

            

Raw data

            {
    "_id": null,
    "home_page": "",
    "name": "qrmagic",
    "maintainer": "",
    "docs_url": null,
    "requires_python": "",
    "maintainer_email": "",
    "keywords": "qrcode,fieldwork",
    "author": "",
    "author_email": "kdm9 <foss@kdmurray.id.au>",
    "download_url": "https://files.pythonhosted.org/packages/fd/30/dcfb12da4404326c2f58d53e21e86f93275098e0f695c194231796d25210/qrmagic-0.2.3.tar.gz",
    "platform": null,
    "description": "# QR Magic\n\nSome magical semi-automated tools to better handle sample tracking during fieldwork.\n\n[![DOI](https://zenodo.org/badge/DOI/10.5281/zenodo.10049943.svg)](https://doi.org/10.5281/zenodo.10049943)\n\n\nTo install:\n\n```\npython3 -m pip install qrmagic\n```\n\nOr, to get the development version:\n```\npython3 -m pip install -e git+https://github.com/kdm9/NVTK.git\n```\n\n## QR Code Label Printing\n\nMake a PDF of labels for each sample ID. There are a few hard-coded \"Avery\" label\ntypes commonly used in the Weigel group, and it's super easy to add others\n(please create a github issue if you need help doing so, or want me to build a\nnew label type into the code).\n\n\n```bash\n$ python3 -m qrmagic.labelmaker --help\nusage: labelmaker.py [-h] [--demo DIR] [--list-label-types] [--label-type TYPE] [--copies N]\n                     [--output FILE] [--id-file FILE] [--id-format FORMAT] [--id-start N] [--id-end N]\n\noptional arguments:\n  -h, --help            show this help message and exit\n  --demo DIR            Write a demo (10 labels, four reps per label) for each label type to DIR.\n  --list-label-types    Write a list of label types.\n  --label-type TYPE     Label type.\n  --copies N            Create N copies of each label.\n  --output FILE         Output PDF file.\n  --id-file FILE        File of IDs, one per line.\n  --id-format FORMAT    Python-style format string governing ID format e.g. WGL{:04d} gives WGL0001..WGL9999\n  --id-start N          First ID number (default 1)\n  --id-end N            Last ID number (default 100)\n```\n\nTo see what label types are available, do:\n\n```\n$ python3 -m qrmagic.labelmaker --list-label-types\nL7636:  Mid-sized rounded rectangular labels (45x22mm) in sheets of 4x12\nL3667:  Mid-sized rectangular labels (48x17mm) in sheets of 4x16\nL7658:  Small labels (25x10mm) in sheets of 7x27\nCryoLabel:  Cryo Labels for screw-cap eppies. White on left half, clear on right.\n```\n\nOne can also create a demonstration PDF for each label type with the command:\n\n```bash\n$ python3 -m qrmagic.labelmaker --demo output_dir/\n```\n\n## QR Code-based Image organisation\n\nSo, we took all these photos in the field, now what do we do with them? The first step is to organise them by sample. To do so manually is cumbersome, so here are some tools to help.\n\n### Step 1: scan images on your machine\n\nThis CLI tool will scan your images, doing its best to decode all the QRcodes\nthey contain. For each image it also reports the location and time the image\nwas taken, and various other bits of metadata.\n\nNB: for silly javascript reasons, you need to have all images be in a single\ndirectory. If you have your images organised in directories (e.g. by date, or\nby camera), please run this process once per directory, or move or symlink all\nimages into a single directory.\n\n```\nqrmagic-detect -o my-images.json my-images/*.JPG\n```\n\n\n### Step 2: curation\n\nNow, go to <https://qrmagic.kdmurray.id.au/imagesort.html>. Here, you should\nupload the JSON file created above, and up will pop a table of images. You can\nthen try automatically filling missing barcodes based on the adjacent codes\n(always do a bit of manual curation here), or manually type in QR codes that\nare not detectable. When you are finished, you can download a Bash script which\ncontains commands to rename all your files by sample ID (or whatever your\nbarcodes denote).\n\n\n### Step 3: rename images\n\nOnce downloaded, the renamer script should be run in the same directory your\nimages are all in:\n\n```\ncd /path/to/my-images\nbash -x ~/Downloads/rename.sh\n```\n",
    "bugtrack_url": null,
    "license": "",
    "summary": "Tools to manage qrcoded labels and images during Natural Variaiton experiments",
    "version": "0.2.3",
    "project_urls": null,
    "split_keywords": [
        "qrcode",
        "fieldwork"
    ],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "1baffcb374973faf740f4fd63f2cde712bf98afc1bd28b25ea2ff955f8670bb1",
                "md5": "c4fe570ef0c72bb20d82b38d1f4509ca",
                "sha256": "09eeae8d9a8b46f1356ed851b1982426cdaa95f58dbc6642022dfd1609e50d10"
            },
            "downloads": -1,
            "filename": "qrmagic-0.2.3-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "c4fe570ef0c72bb20d82b38d1f4509ca",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": null,
            "size": 13435,
            "upload_time": "2023-11-24T12:13:31",
            "upload_time_iso_8601": "2023-11-24T12:13:31.042830Z",
            "url": "https://files.pythonhosted.org/packages/1b/af/fcb374973faf740f4fd63f2cde712bf98afc1bd28b25ea2ff955f8670bb1/qrmagic-0.2.3-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "fd30dcfb12da4404326c2f58d53e21e86f93275098e0f695c194231796d25210",
                "md5": "56f1cca5c31c1dd2bde272bb12e99032",
                "sha256": "8054fe6848e68803ce6edc9952175dcd9346fde4d3e4992d467be45dcabd1d18"
            },
            "downloads": -1,
            "filename": "qrmagic-0.2.3.tar.gz",
            "has_sig": false,
            "md5_digest": "56f1cca5c31c1dd2bde272bb12e99032",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": null,
            "size": 63646,
            "upload_time": "2023-11-24T12:13:33",
            "upload_time_iso_8601": "2023-11-24T12:13:33.069771Z",
            "url": "https://files.pythonhosted.org/packages/fd/30/dcfb12da4404326c2f58d53e21e86f93275098e0f695c194231796d25210/qrmagic-0.2.3.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2023-11-24 12:13:33",
    "github": false,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "lcname": "qrmagic"
}
        
Elapsed time: 0.14169s