hms-import


Namehms-import JSON
Version 0.10.8 PyPI version JSON
download
home_page
SummaryUploads encrypted video files and metadata to Tator.
upload_time2023-10-02 19:15:12
maintainer
docs_urlNone
authorCVision AI, Inc.
requires_python>=3.8,<4.0
licenseMIT
keywords
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage No coveralls.
            # HMS Import

Import utility for encrypted video and metadata files.

# Installation

## From Wheel

This assumes you have [Python 3.8+](https://www.python.org/downloads/) installed and `pip3` is on
your path:

```bash
~$ pip3 install hms-import
...
~$ hms-import -h
usage: hms-import [-h] [--quiet] [--verbose] {b3-upload,o2-upload,log-upload} ...

Script for importing video and metadata in O2 and B3 formats.

options:
  -h, --help            show this help message and exit
  --quiet               Changes the console log level from INFO to WARNING; defers to --verbose
  --verbose             Changes the console log level from INFO to DEBUG; takes precedence over --quiet

Commands:
  {b3-upload,o2-upload,log-upload}
    b3-upload           Imports video and GPS files from unlocked LUKS-encrypted device
    o2-upload           Script for uploading raw, encrypted video files
    log-upload          Uploads a log file Tator
```

## From Source

This assumes you have [git](https://git-scm.com/book/en/v2/Getting-Started-Installing-Git), [Python
3.8+](https://www.python.org/downloads/), and
[poetry](https://python-poetry.org/docs/#osx--linux--bashonwindows-install-instructions) installed
already.

```bash
~$ git clone git@github.com:cvisionai/hms.git
...
~$ cd hms/scripts/hms-import
hms-import$ poetry install
...
hms-import$ poetry run hms-import -h
```

# Usage

This script contains three sub-commands: `o2-upload`, `b3-upload`, and `log-upload`; their usage is
described below. Additional documentation is available by providing the `-h` flag, e.g. `hms-import
o2-upload -h`.

## o2-upload

The first step is to set up your `config.ini` file. Start by copying the contents of
[sample_hms-config.ini](./sample_hms-config.ini) included below for reference, and replace the
default values:

```ini
[Local]
# The directory containing the video files for import
Directory=dir1

[Tator]
# The url to the tator deployment
Host=https://hms.tator.io
# The API token for tator
Token=6485c83cf040deadbeef07b7aea13706
# The integer id of the project to upload the videos to
ProjectId=-1
# The integer id of the media type to create, required if the project has more than one video media type
MediaType=-1
# The integer id of the file type to create for the uploaded encrypted sensor data file
FileType=-1
# The integer id of the image type to create for the trip summary image
SummaryType=-1
# The name of the algorithm to launch upon upload of each trip
AlgorithmName=Decrypt Trip
# If true, will skip uploading files and only create media objects; used for legacy O2 importing
SkipDecrypt=False

[Trip]
# The serial number of the hard drive, uncomment and set
# HddSerialNumber=123ABC
```

Once configured, you can run the import utility:

```bash
$ hms-import o2-upload config.ini
```

### Troubleshooting

If an import fails, the logs have more detail than the console, they can be found in the same folder
the command was run from, with the filename `hms_import.log`. These are rotating logs that cycle
daily (if the log file is not current, it will have an `.MM-DD-YY` extension appended to the
filename) and are kept for up to 7 days, so as to not consume disk space without limit.


## b3-upload

The B3 import sub-command, `hms-import b3-upload`, requires the following arguments:

* `--host` the tator hostname (string)
* `--token` the tator API token (string)
* `--media-type-id` the media type id (integer)
* `--file-type-id` the file type id (integer)
* `--multi-type-id` the multiview type id (integer)
* `--state-type-id` the state type id (integer)
* `--image-type-id` the image type id (integer)
* `--hdd-sn` the serial number of the hard drive
* `--directory` the location of the files to upload

Once you have those values, use them to call the script:

```bash
$ hms-import b3-upload \
    --host <TATOR_HOST> \
    --token <TATOR_TOKEN> \
    --media-type-id <id> \
    --file-type-id <id> \
    --multi-type-id <id> \
    --state-type-id <id> \
    --image-type-id <id> \
    --hdd-sn <sn> \
    --directory <path/to/files>
```

## log-upload

There is a third command option, `log-upload`, which is used to upload the log file generated after
running `hms-import`, which can be called like so:

```bash
$ hms-import log-upload \
    --host <TATOR_HOST> \
    --token <TATOR_TOKEN> \
    --log-file-type-id <id>
```

The flag `--log-filename` is optional and defaults to the default location of the log file, only
override it if you know what you're doing.

            

Raw data

            {
    "_id": null,
    "home_page": "",
    "name": "hms-import",
    "maintainer": "",
    "docs_url": null,
    "requires_python": ">=3.8,<4.0",
    "maintainer_email": "",
    "keywords": "",
    "author": "CVision AI, Inc.",
    "author_email": "info@cvisionai.com",
    "download_url": "https://files.pythonhosted.org/packages/a6/e8/43e7869d915ce92e93a93abbbd1e2b18bb2b05c076540947cde693debbd9/hms_import-0.10.8.tar.gz",
    "platform": null,
    "description": "# HMS Import\n\nImport utility for encrypted video and metadata files.\n\n# Installation\n\n## From Wheel\n\nThis assumes you have [Python 3.8+](https://www.python.org/downloads/) installed and `pip3` is on\nyour path:\n\n```bash\n~$ pip3 install hms-import\n...\n~$ hms-import -h\nusage: hms-import [-h] [--quiet] [--verbose] {b3-upload,o2-upload,log-upload} ...\n\nScript for importing video and metadata in O2 and B3 formats.\n\noptions:\n  -h, --help            show this help message and exit\n  --quiet               Changes the console log level from INFO to WARNING; defers to --verbose\n  --verbose             Changes the console log level from INFO to DEBUG; takes precedence over --quiet\n\nCommands:\n  {b3-upload,o2-upload,log-upload}\n    b3-upload           Imports video and GPS files from unlocked LUKS-encrypted device\n    o2-upload           Script for uploading raw, encrypted video files\n    log-upload          Uploads a log file Tator\n```\n\n## From Source\n\nThis assumes you have [git](https://git-scm.com/book/en/v2/Getting-Started-Installing-Git), [Python\n3.8+](https://www.python.org/downloads/), and\n[poetry](https://python-poetry.org/docs/#osx--linux--bashonwindows-install-instructions) installed\nalready.\n\n```bash\n~$ git clone git@github.com:cvisionai/hms.git\n...\n~$ cd hms/scripts/hms-import\nhms-import$ poetry install\n...\nhms-import$ poetry run hms-import -h\n```\n\n# Usage\n\nThis script contains three sub-commands: `o2-upload`, `b3-upload`, and `log-upload`; their usage is\ndescribed below. Additional documentation is available by providing the `-h` flag, e.g. `hms-import\no2-upload -h`.\n\n## o2-upload\n\nThe first step is to set up your `config.ini` file. Start by copying the contents of\n[sample_hms-config.ini](./sample_hms-config.ini) included below for reference, and replace the\ndefault values:\n\n```ini\n[Local]\n# The directory containing the video files for import\nDirectory=dir1\n\n[Tator]\n# The url to the tator deployment\nHost=https://hms.tator.io\n# The API token for tator\nToken=6485c83cf040deadbeef07b7aea13706\n# The integer id of the project to upload the videos to\nProjectId=-1\n# The integer id of the media type to create, required if the project has more than one video media type\nMediaType=-1\n# The integer id of the file type to create for the uploaded encrypted sensor data file\nFileType=-1\n# The integer id of the image type to create for the trip summary image\nSummaryType=-1\n# The name of the algorithm to launch upon upload of each trip\nAlgorithmName=Decrypt Trip\n# If true, will skip uploading files and only create media objects; used for legacy O2 importing\nSkipDecrypt=False\n\n[Trip]\n# The serial number of the hard drive, uncomment and set\n# HddSerialNumber=123ABC\n```\n\nOnce configured, you can run the import utility:\n\n```bash\n$ hms-import o2-upload config.ini\n```\n\n### Troubleshooting\n\nIf an import fails, the logs have more detail than the console, they can be found in the same folder\nthe command was run from, with the filename `hms_import.log`. These are rotating logs that cycle\ndaily (if the log file is not current, it will have an `.MM-DD-YY` extension appended to the\nfilename) and are kept for up to 7 days, so as to not consume disk space without limit.\n\n\n## b3-upload\n\nThe B3 import sub-command, `hms-import b3-upload`, requires the following arguments:\n\n* `--host` the tator hostname (string)\n* `--token` the tator API token (string)\n* `--media-type-id` the media type id (integer)\n* `--file-type-id` the file type id (integer)\n* `--multi-type-id` the multiview type id (integer)\n* `--state-type-id` the state type id (integer)\n* `--image-type-id` the image type id (integer)\n* `--hdd-sn` the serial number of the hard drive\n* `--directory` the location of the files to upload\n\nOnce you have those values, use them to call the script:\n\n```bash\n$ hms-import b3-upload \\\n    --host <TATOR_HOST> \\\n    --token <TATOR_TOKEN> \\\n    --media-type-id <id> \\\n    --file-type-id <id> \\\n    --multi-type-id <id> \\\n    --state-type-id <id> \\\n    --image-type-id <id> \\\n    --hdd-sn <sn> \\\n    --directory <path/to/files>\n```\n\n## log-upload\n\nThere is a third command option, `log-upload`, which is used to upload the log file generated after\nrunning `hms-import`, which can be called like so:\n\n```bash\n$ hms-import log-upload \\\n    --host <TATOR_HOST> \\\n    --token <TATOR_TOKEN> \\\n    --log-file-type-id <id>\n```\n\nThe flag `--log-filename` is optional and defaults to the default location of the log file, only\noverride it if you know what you're doing.\n",
    "bugtrack_url": null,
    "license": "MIT",
    "summary": "Uploads encrypted video files and metadata to Tator.",
    "version": "0.10.8",
    "project_urls": null,
    "split_keywords": [],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "1ba6f15ff0b046ae46336ceb0e3d47fce11c61c0af3164a3b8d306e92fa276bc",
                "md5": "54be03467d71e0e4e93fc14da0976449",
                "sha256": "3af99b0bb72352481500602d01b8c2ca4eb2e411924270abbc10b1d1c8d2a1df"
            },
            "downloads": -1,
            "filename": "hms_import-0.10.8-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "54be03467d71e0e4e93fc14da0976449",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": ">=3.8,<4.0",
            "size": 61243,
            "upload_time": "2023-10-02T19:15:11",
            "upload_time_iso_8601": "2023-10-02T19:15:11.651368Z",
            "url": "https://files.pythonhosted.org/packages/1b/a6/f15ff0b046ae46336ceb0e3d47fce11c61c0af3164a3b8d306e92fa276bc/hms_import-0.10.8-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "a6e843e7869d915ce92e93a93abbbd1e2b18bb2b05c076540947cde693debbd9",
                "md5": "41fcc74b3856f110f672ef22fad93385",
                "sha256": "20de49b99f8fddeb6a3dc70f1ed2b2863c102a4f67c667e6a73878cce9506098"
            },
            "downloads": -1,
            "filename": "hms_import-0.10.8.tar.gz",
            "has_sig": false,
            "md5_digest": "41fcc74b3856f110f672ef22fad93385",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": ">=3.8,<4.0",
            "size": 58366,
            "upload_time": "2023-10-02T19:15:12",
            "upload_time_iso_8601": "2023-10-02T19:15:12.961991Z",
            "url": "https://files.pythonhosted.org/packages/a6/e8/43e7869d915ce92e93a93abbbd1e2b18bb2b05c076540947cde693debbd9/hms_import-0.10.8.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2023-10-02 19:15:12",
    "github": false,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "lcname": "hms-import"
}
        
Elapsed time: 0.14022s