salt-portal-backup


Namesalt-portal-backup JSON
Version 0.1.0 PyPI version JSON
download
home_pageNone
SummaryBackup projects, stations, calibrations and measurements from Salt Portal to a SQLite database.
upload_time2024-08-27 12:12:51
maintainerNone
docs_urlNone
authorNone
requires_python>=3.8
licenseNone
keywords
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage No coveralls.
            # Salt Portal Backup

[![PyPI - Version](https://img.shields.io/pypi/v/salt-portal-backup.svg)](https://pypi.org/project/salt-portal-backup)
[![PyPI - Python Version](https://img.shields.io/pypi/pyversions/salt-portal-backup.svg)](https://pypi.org/project/salt-portal-backup)

-----

Backup projects, stations, calibrations and measurements from Salt Portal to a SQLite database.

Disclaimer: This project is not affiliated, associated, authorized, endorsed by, or in any way 
connected with Fathom Scientific Ltd, the provider of the Salt Portal.


## Table of Contents

- [Installation as package](#installation-as-package)
  - [Usage in python code](#usage-in-python-code)
  - [Usage as CLI](#usage-as-cli)
- [Download Windows executable](#download-windows-executable)
  - [Usage CLI](#usage-cli)
- [Building the pyinstaller exe](#building-the-pyinstaller-exe)
- [Database schema](#database-schema)
- [License](#license)

## Installation as package

```console
pip install salt-portal-backup
```

### Usage in python code

```python
from salt_portal_backup import run_backup

# without providing path to the database file
# backup will be stored in the user home directory
# with name salt_portal_yyyymmdd_hhmmss.db where yyyymmdd_hhmmss
# is the current date and time
run_backup(username='myusername', password='mypassword')

# provide location for the backup adding database_path keyword
# example below will create the my_backup.db database in the current
# working directory of the python session
run_backup(username='myusername', password='mypassword', 
           database_path='my_backup.db')
```

### Usage as CLI

Run in the environment where salt-portal-backup is installed:

```console
python -m salt_portal_backup.backup --help
```

## Download Windows executable

A windows stand-alone executable made with pyinstaller is available under [Releases](https://github.com/rhkarls/salt-portal-backup/releases) on Github.

### Usage CLI

Interaction with the CLI is the same was when calling the python script.

```console
salt_portal_backup.exe --help

Usage: salt_portal_backup.exe [OPTIONS]

  Backup projects, stations, calibrations and measurements from Salt Portal to
  a SQLite database.

Options:
  -u, --username TEXT         The Salt Portal login username. Will be prompted
                              if not provided.
  -p, --password TEXT         The Salt Portal login password. Will be prompted
                              if not provided.
  -o, --output_database TEXT  Path to the SQLite database to store the backup
                              in. The database is created if not excisting,
                              and it is recommended to use a new database for
                              each backup. If not provided, the database will
                              be created in the users home folder and named
                              with the current date and time time.
  --version                   Show the version and exit.
  --help                      Show this message and exit.

```

Example output, when calling without any options:

```console
salt_portal_backup.exe
Salt Portal username: myusername
Salt Portal password: (input is hidden)
Backup to C:\Users\myusername\salt_portal_20240826_135932.db
 projects:  33%|████████████████████████▎                                                | 3/9 [01:25<02:31, 25.22s/it]
 station in project:  12%|███████▉                                                       | 1/8 [00:01<00:11,  1.66s/it]
 measurement at station:  34%|███████████████████▍                                     | 17/50 [00:10<00:16,  1.96it/s]
```

## Building the pyinstaller exe

```console
pyinstaller src/salt_portal_backup/backup.py --onefile --name salt_portal_backup --icon static/icon-256.ico
```

## Database schema

![erd_v1](static/salt_portal_db_v1.png)

## License

`salt-portal-backup` is distributed under the terms of the [BSD-3-Clause](https://spdx.org/licenses/BSD-3-Clause.html) license.

            

Raw data

            {
    "_id": null,
    "home_page": null,
    "name": "salt-portal-backup",
    "maintainer": null,
    "docs_url": null,
    "requires_python": ">=3.8",
    "maintainer_email": null,
    "keywords": null,
    "author": null,
    "author_email": "Reinert Huseby Karlsen <rhkarls@proton.me>",
    "download_url": "https://files.pythonhosted.org/packages/cd/f4/21794aa4e3d0fce4b0bee98547ba90a86fa014ce5fe20968e6c8e514a837/salt_portal_backup-0.1.0.tar.gz",
    "platform": null,
    "description": "# Salt Portal Backup\n\n[![PyPI - Version](https://img.shields.io/pypi/v/salt-portal-backup.svg)](https://pypi.org/project/salt-portal-backup)\n[![PyPI - Python Version](https://img.shields.io/pypi/pyversions/salt-portal-backup.svg)](https://pypi.org/project/salt-portal-backup)\n\n-----\n\nBackup projects, stations, calibrations and measurements from Salt Portal to a SQLite database.\n\nDisclaimer: This project is not affiliated, associated, authorized, endorsed by, or in any way \nconnected with Fathom Scientific Ltd, the provider of the Salt Portal.\n\n\n## Table of Contents\n\n- [Installation as package](#installation-as-package)\n  - [Usage in python code](#usage-in-python-code)\n  - [Usage as CLI](#usage-as-cli)\n- [Download Windows executable](#download-windows-executable)\n  - [Usage CLI](#usage-cli)\n- [Building the pyinstaller exe](#building-the-pyinstaller-exe)\n- [Database schema](#database-schema)\n- [License](#license)\n\n## Installation as package\n\n```console\npip install salt-portal-backup\n```\n\n### Usage in python code\n\n```python\nfrom salt_portal_backup import run_backup\n\n# without providing path to the database file\n# backup will be stored in the user home directory\n# with name salt_portal_yyyymmdd_hhmmss.db where yyyymmdd_hhmmss\n# is the current date and time\nrun_backup(username='myusername', password='mypassword')\n\n# provide location for the backup adding database_path keyword\n# example below will create the my_backup.db database in the current\n# working directory of the python session\nrun_backup(username='myusername', password='mypassword', \n           database_path='my_backup.db')\n```\n\n### Usage as CLI\n\nRun in the environment where salt-portal-backup is installed:\n\n```console\npython -m salt_portal_backup.backup --help\n```\n\n## Download Windows executable\n\nA windows stand-alone executable made with pyinstaller is available under [Releases](https://github.com/rhkarls/salt-portal-backup/releases) on Github.\n\n### Usage CLI\n\nInteraction with the CLI is the same was when calling the python script.\n\n```console\nsalt_portal_backup.exe --help\n\nUsage: salt_portal_backup.exe [OPTIONS]\n\n  Backup projects, stations, calibrations and measurements from Salt Portal to\n  a SQLite database.\n\nOptions:\n  -u, --username TEXT         The Salt Portal login username. Will be prompted\n                              if not provided.\n  -p, --password TEXT         The Salt Portal login password. Will be prompted\n                              if not provided.\n  -o, --output_database TEXT  Path to the SQLite database to store the backup\n                              in. The database is created if not excisting,\n                              and it is recommended to use a new database for\n                              each backup. If not provided, the database will\n                              be created in the users home folder and named\n                              with the current date and time time.\n  --version                   Show the version and exit.\n  --help                      Show this message and exit.\n\n```\n\nExample output, when calling without any options:\n\n```console\nsalt_portal_backup.exe\nSalt Portal username: myusername\nSalt Portal password: (input is hidden)\nBackup to C:\\Users\\myusername\\salt_portal_20240826_135932.db\n projects:  33%|\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u258e                                                | 3/9 [01:25<02:31, 25.22s/it]\n station in project:  12%|\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2589                                                       | 1/8 [00:01<00:11,  1.66s/it]\n measurement at station:  34%|\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u258d                                     | 17/50 [00:10<00:16,  1.96it/s]\n```\n\n## Building the pyinstaller exe\n\n```console\npyinstaller src/salt_portal_backup/backup.py --onefile --name salt_portal_backup --icon static/icon-256.ico\n```\n\n## Database schema\n\n![erd_v1](static/salt_portal_db_v1.png)\n\n## License\n\n`salt-portal-backup` is distributed under the terms of the [BSD-3-Clause](https://spdx.org/licenses/BSD-3-Clause.html) license.\n",
    "bugtrack_url": null,
    "license": null,
    "summary": "Backup projects, stations, calibrations and measurements from Salt Portal to a SQLite database.",
    "version": "0.1.0",
    "project_urls": {
        "Documentation": "https://github.com/rhkarls/salt-portal-backup#readme",
        "Issues": "https://github.com/rhkarls/salt-portal-backup/issues",
        "Source": "https://github.com/rhkarls/salt-portal-backup"
    },
    "split_keywords": [],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "6b2cf0f71e5a73b3c1ad76f1333932b95b7dc37075fe9d883d3a5dda1e4080f0",
                "md5": "0e554d450964e68a133d3ad8eed32223",
                "sha256": "41371bf4feacfc2b607c5f3dc1c64ddb0a6e32751067725b7ce4aec825f22dba"
            },
            "downloads": -1,
            "filename": "salt_portal_backup-0.1.0-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "0e554d450964e68a133d3ad8eed32223",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": ">=3.8",
            "size": 12462,
            "upload_time": "2024-08-27T12:12:49",
            "upload_time_iso_8601": "2024-08-27T12:12:49.810764Z",
            "url": "https://files.pythonhosted.org/packages/6b/2c/f0f71e5a73b3c1ad76f1333932b95b7dc37075fe9d883d3a5dda1e4080f0/salt_portal_backup-0.1.0-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "cdf421794aa4e3d0fce4b0bee98547ba90a86fa014ce5fe20968e6c8e514a837",
                "md5": "c60894eb97c17c4a8ebfed9bb859b2d0",
                "sha256": "705f836e89026e01493cf48262ef6ead7f0eb4c8c0b27ac42601d96203e4ba25"
            },
            "downloads": -1,
            "filename": "salt_portal_backup-0.1.0.tar.gz",
            "has_sig": false,
            "md5_digest": "c60894eb97c17c4a8ebfed9bb859b2d0",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": ">=3.8",
            "size": 573970,
            "upload_time": "2024-08-27T12:12:51",
            "upload_time_iso_8601": "2024-08-27T12:12:51.574355Z",
            "url": "https://files.pythonhosted.org/packages/cd/f4/21794aa4e3d0fce4b0bee98547ba90a86fa014ce5fe20968e6c8e514a837/salt_portal_backup-0.1.0.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2024-08-27 12:12:51",
    "github": true,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "github_user": "rhkarls",
    "github_project": "salt-portal-backup#readme",
    "travis_ci": false,
    "coveralls": false,
    "github_actions": false,
    "lcname": "salt-portal-backup"
}
        
Elapsed time: 0.46682s