slycat-web-client


Nameslycat-web-client JSON
Version 4.3.0 PyPI version JSON
download
home_pagehttps://github.com/sandialabs/slycat
SummarySlycat web client utilties for interacting with the Slycat data analysis and visualization server.
upload_time2024-11-04 16:22:48
maintainerNone
docs_urlNone
authorShawn Martin
requires_pythonNone
licenseSandia
keywords
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI
coveralls test coverage No coveralls.
            # Slycat Web Client
The Slycat web client provides a Python package for interacting with the Slycat web server.

Slycat is a web based data analysis and visualization platform created at Sandia
National Labs.  You can read about it at https://slycat.readthedocs.io/en/latest/.
Slycat is open source and can be downloaded from https://github.com/sandialabs/slycat.

The Slycat web client provides a Python package which can be used
to interact with the Slycat web server.  The web client provides Python routines
to query the Slycat server and create Slycat data analysis models.

## Installation

```sh
pip install slycat-web-client
```

If you are working behind a proxy, you might also need, e.g.

```sh
pip install slycat-web-client --proxy your-proxy:your-port
```

If you are getting SSL certificate errors, you can use:

```sh
pip install slycat-web-client --trusted-host pypi.org --trusted-host files.pythonhosted.org
```

Be aware that the last option is insecure.  The better approach is to 
fix your SSL certificate and/or point Python to a copy of the certificate.
This can be done using:

```sh
pip config set global.cert path-to-your-certificate
```

Note: that for the Slycat web client to work, you must have a Slycat server running.  
See https://slycat.readthedocs.io/en/latest/ for details on setting up a server.

## Basic Use

The Slycat web client can be imported from within a Python file using

    import slycat.web.client

Some examples using the web client can be found in the slycat/web/client
source directory.  These can be run using, e.g.

```sh
$ python list_markings.py
```

or

```sh
$ python -m slycat.web.client.list_markings
```

## User Authentication

The Slycat server requires user authentication.  The slycat.web.client
module provides the options for the authentication process.

For example, to use standard password authentication for a Slycat
server running on https://localhost:9000 without a security certificate,
use:

```sh
$ python -m slycat.web.client.list_markings.py --user slycat --port 9000 --no-verify
```

Or, to access a Kerberos authenticated server running at slycat.sandia.gov,
use:

```sh
$ python -m slycat.web.client.list_markings.py --host https://slycat.sandia.gov --kerberos
```

## Kerberos

The --kerberos option relies on a working Kerberos installation on your system.  Sometimes
this will fail.  If you get an error related to Kerberos credentials (e.g. "Couldn't find
Kerberos ticket," or "User not Kerberos authenticated"), try:

```sh
$ kinit
```

Then re-run the original command.

## Proxies/Certificates

If you are separated from the Slycat server by a proxy, or have not set up a security
certificate, you will have to use the slycat.web.client proxy settings.  The proxy
settings are available using the flags:

* --http-proxy
* --https-proxy
* --verify
* --no-verify

The proxy flags are by default set to "no proxy".  If you have proxies set in the
environment variables, they will be ignored.  The proxy flags are used as follows
(for example):

```sh
$ python -m slycat.web.client.list_markings.py --http-proxy http://your.http.proxy --https-proxy https://your.https.proxy
```

The verify flag can be used to pass a security certificate as a command line argument and
the --no-verify flag can be used to ignore the security certificates altogether.
 
## General Utilities

The simplest examples of interacting with the Slycat server issue
requests for markings and projects, e.g.

```sh
$ python -m slycat.web.client.list_markings.py
$ python -m slcyat.web.client.list_projects.py
```

To examine a particular model or project, use

```sh
$ python -m slycat.web.client.get_model.py mid
$ python -m slycat.web.client.get_project.py pid
```

where mid and pid are the hash identifiers for a Slycat model
or project residing on the Slycat server.  These IDs can be extracted
from the URL in the Slycat web browser client, or by using
Info -> Model Details from the browser.

## Creating Models

The slycat.web.client provides a command line option for creating Slycat
models.  For example, to create a sample CCA model using random data, use:

```sh
$ python -m slycat.web.client.cca_random.py
```

To create a sample CCA model from a CSV file, use:

```sh
$ python -m slycat.web.client.cca_csv.py slycat-data/cars.csv --input Cylinders Displacement Weight Year --output MPG Horsepower Acceleration
```

where "slycat-data/cars.csv" is from the slycat-data git repository at
https://github.com/sandialabs/slycat-data.

Note that when a model is created, the URL is given in the console and
can be copied into a web browser to display the model.  The model ID
can also be extracted from this URL (it is the hash at the end of the URL).

## Dial-A-Cluster (DAC) Models

Dial-A-Cluster models can be loaded using different formats.  The first
format is the generic dial-a-cluster format, described more fully in
the Slycat user manual.

To upload a DAC generic .zip file, use

```sh
$ dac_gen dac-gen.zip
```

This will create a model from a single .zip file containing the appropriate
folders with the pre-computed distance or PCA matrices.

## Parameter Space Models

A Parameter Space model can be created from .csv file using the 
ps_csv script.  From the command line, use:

```sh
$ python -m slycat.web.client.ps_csv slycat-data/cars.csv --input-columns Cylinders Displacement Weight Year --output-columns MPG Horsepower Acceleration
```

To push up a .csv file from a python script, use the slycat-web-client
module.  For example:

```{python}
import slycat.web.client.ps_csv as ps_csv

# parameter space file
CARS_FILE = ['../../slycat-data/cars.csv']

# input/output columns for cars data file
CARS_INPUT = ['--input-columns', 'Model', 'Cylinders', 'Displacement', 'Weight', 'Year']
CARS_OUTPUT = ['--output-columns', 'MPG', 'Horsepower', 'Acceleration']

# create PS model from cars file
ps_parser = ps_csv.parser()
arguments = ps_parser.parse_args(CARS_FILE + CARS_INPUT + CARS_OUTPUT)
ps_csv.create_model(arguments, ps_csv.log)     

```

## API

You should be able to find the API for slycat.web.client at 
https://slycat.readthedocs.io/en/latest/.

## Contact

Shawn Martin -- smartin@sandia.gov

Distributed under the Sandia license. See LICENSE file for more information.

            

Raw data

            {
    "_id": null,
    "home_page": "https://github.com/sandialabs/slycat",
    "name": "slycat-web-client",
    "maintainer": null,
    "docs_url": null,
    "requires_python": null,
    "maintainer_email": null,
    "keywords": null,
    "author": "Shawn Martin",
    "author_email": "smartin@sandia.gov",
    "download_url": "https://files.pythonhosted.org/packages/1c/0f/631ed0f309011d58fd254a1c62f745115943ba52cff4b0be9773a6d39ed1/slycat-web-client-4.3.0.tar.gz",
    "platform": null,
    "description": "# Slycat Web Client\r\nThe Slycat web client provides a Python package for interacting with the Slycat web server.\r\n\r\nSlycat is a web based data analysis and visualization platform created at Sandia\r\nNational Labs.  You can read about it at https://slycat.readthedocs.io/en/latest/.\r\nSlycat is open source and can be downloaded from https://github.com/sandialabs/slycat.\r\n\r\nThe Slycat web client provides a Python package which can be used\r\nto interact with the Slycat web server.  The web client provides Python routines\r\nto query the Slycat server and create Slycat data analysis models.\r\n\r\n## Installation\r\n\r\n```sh\r\npip install slycat-web-client\r\n```\r\n\r\nIf you are working behind a proxy, you might also need, e.g.\r\n\r\n```sh\r\npip install slycat-web-client --proxy your-proxy:your-port\r\n```\r\n\r\nIf you are getting SSL certificate errors, you can use:\r\n\r\n```sh\r\npip install slycat-web-client --trusted-host pypi.org --trusted-host files.pythonhosted.org\r\n```\r\n\r\nBe aware that the last option is insecure.  The better approach is to \r\nfix your SSL certificate and/or point Python to a copy of the certificate.\r\nThis can be done using:\r\n\r\n```sh\r\npip config set global.cert path-to-your-certificate\r\n```\r\n\r\nNote: that for the Slycat web client to work, you must have a Slycat server running.  \r\nSee https://slycat.readthedocs.io/en/latest/ for details on setting up a server.\r\n\r\n## Basic Use\r\n\r\nThe Slycat web client can be imported from within a Python file using\r\n\r\n    import slycat.web.client\r\n\r\nSome examples using the web client can be found in the slycat/web/client\r\nsource directory.  These can be run using, e.g.\r\n\r\n```sh\r\n$ python list_markings.py\r\n```\r\n\r\nor\r\n\r\n```sh\r\n$ python -m slycat.web.client.list_markings\r\n```\r\n\r\n## User Authentication\r\n\r\nThe Slycat server requires user authentication.  The slycat.web.client\r\nmodule provides the options for the authentication process.\r\n\r\nFor example, to use standard password authentication for a Slycat\r\nserver running on https://localhost:9000 without a security certificate,\r\nuse:\r\n\r\n```sh\r\n$ python -m slycat.web.client.list_markings.py --user slycat --port 9000 --no-verify\r\n```\r\n\r\nOr, to access a Kerberos authenticated server running at slycat.sandia.gov,\r\nuse:\r\n\r\n```sh\r\n$ python -m slycat.web.client.list_markings.py --host https://slycat.sandia.gov --kerberos\r\n```\r\n\r\n## Kerberos\r\n\r\nThe --kerberos option relies on a working Kerberos installation on your system.  Sometimes\r\nthis will fail.  If you get an error related to Kerberos credentials (e.g. \"Couldn't find\r\nKerberos ticket,\" or \"User not Kerberos authenticated\"), try:\r\n\r\n```sh\r\n$ kinit\r\n```\r\n\r\nThen re-run the original command.\r\n\r\n## Proxies/Certificates\r\n\r\nIf you are separated from the Slycat server by a proxy, or have not set up a security\r\ncertificate, you will have to use the slycat.web.client proxy settings.  The proxy\r\nsettings are available using the flags:\r\n\r\n* --http-proxy\r\n* --https-proxy\r\n* --verify\r\n* --no-verify\r\n\r\nThe proxy flags are by default set to \"no proxy\".  If you have proxies set in the\r\nenvironment variables, they will be ignored.  The proxy flags are used as follows\r\n(for example):\r\n\r\n```sh\r\n$ python -m slycat.web.client.list_markings.py --http-proxy http://your.http.proxy --https-proxy https://your.https.proxy\r\n```\r\n\r\nThe verify flag can be used to pass a security certificate as a command line argument and\r\nthe --no-verify flag can be used to ignore the security certificates altogether.\r\n \r\n## General Utilities\r\n\r\nThe simplest examples of interacting with the Slycat server issue\r\nrequests for markings and projects, e.g.\r\n\r\n```sh\r\n$ python -m slycat.web.client.list_markings.py\r\n$ python -m slcyat.web.client.list_projects.py\r\n```\r\n\r\nTo examine a particular model or project, use\r\n\r\n```sh\r\n$ python -m slycat.web.client.get_model.py mid\r\n$ python -m slycat.web.client.get_project.py pid\r\n```\r\n\r\nwhere mid and pid are the hash identifiers for a Slycat model\r\nor project residing on the Slycat server.  These IDs can be extracted\r\nfrom the URL in the Slycat web browser client, or by using\r\nInfo -> Model Details from the browser.\r\n\r\n## Creating Models\r\n\r\nThe slycat.web.client provides a command line option for creating Slycat\r\nmodels.  For example, to create a sample CCA model using random data, use:\r\n\r\n```sh\r\n$ python -m slycat.web.client.cca_random.py\r\n```\r\n\r\nTo create a sample CCA model from a CSV file, use:\r\n\r\n```sh\r\n$ python -m slycat.web.client.cca_csv.py slycat-data/cars.csv --input Cylinders Displacement Weight Year --output MPG Horsepower Acceleration\r\n```\r\n\r\nwhere \"slycat-data/cars.csv\" is from the slycat-data git repository at\r\nhttps://github.com/sandialabs/slycat-data.\r\n\r\nNote that when a model is created, the URL is given in the console and\r\ncan be copied into a web browser to display the model.  The model ID\r\ncan also be extracted from this URL (it is the hash at the end of the URL).\r\n\r\n## Dial-A-Cluster (DAC) Models\r\n\r\nDial-A-Cluster models can be loaded using different formats.  The first\r\nformat is the generic dial-a-cluster format, described more fully in\r\nthe Slycat user manual.\r\n\r\nTo upload a DAC generic .zip file, use\r\n\r\n```sh\r\n$ dac_gen dac-gen.zip\r\n```\r\n\r\nThis will create a model from a single .zip file containing the appropriate\r\nfolders with the pre-computed distance or PCA matrices.\r\n\r\n## Parameter Space Models\r\n\r\nA Parameter Space model can be created from .csv file using the \r\nps_csv script.  From the command line, use:\r\n\r\n```sh\r\n$ python -m slycat.web.client.ps_csv slycat-data/cars.csv --input-columns Cylinders Displacement Weight Year --output-columns MPG Horsepower Acceleration\r\n```\r\n\r\nTo push up a .csv file from a python script, use the slycat-web-client\r\nmodule.  For example:\r\n\r\n```{python}\r\nimport slycat.web.client.ps_csv as ps_csv\r\n\r\n# parameter space file\r\nCARS_FILE = ['../../slycat-data/cars.csv']\r\n\r\n# input/output columns for cars data file\r\nCARS_INPUT = ['--input-columns', 'Model', 'Cylinders', 'Displacement', 'Weight', 'Year']\r\nCARS_OUTPUT = ['--output-columns', 'MPG', 'Horsepower', 'Acceleration']\r\n\r\n# create PS model from cars file\r\nps_parser = ps_csv.parser()\r\narguments = ps_parser.parse_args(CARS_FILE + CARS_INPUT + CARS_OUTPUT)\r\nps_csv.create_model(arguments, ps_csv.log)     \r\n\r\n```\r\n\r\n## API\r\n\r\nYou should be able to find the API for slycat.web.client at \r\nhttps://slycat.readthedocs.io/en/latest/.\r\n\r\n## Contact\r\n\r\nShawn Martin -- smartin@sandia.gov\r\n\r\nDistributed under the Sandia license. See LICENSE file for more information.\r\n",
    "bugtrack_url": null,
    "license": "Sandia",
    "summary": "Slycat web client utilties for interacting with the Slycat data analysis and visualization server.",
    "version": "4.3.0",
    "project_urls": {
        "Homepage": "https://github.com/sandialabs/slycat"
    },
    "split_keywords": [],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "f67b9bef8f1330d7a132a21b2c235397988b46ac8eb706c302eec53d63afdf16",
                "md5": "c5ce00a88174df348c8ed09ccd69d3c3",
                "sha256": "ffbbc4bd1efaa6eb1d7ffaea5c49188b8b73f8cdc0bc15d496f3062df4aa1b1b"
            },
            "downloads": -1,
            "filename": "slycat_web_client-4.3.0-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "c5ce00a88174df348c8ed09ccd69d3c3",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": null,
            "size": 56507,
            "upload_time": "2024-11-04T16:22:46",
            "upload_time_iso_8601": "2024-11-04T16:22:46.909995Z",
            "url": "https://files.pythonhosted.org/packages/f6/7b/9bef8f1330d7a132a21b2c235397988b46ac8eb706c302eec53d63afdf16/slycat_web_client-4.3.0-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "1c0f631ed0f309011d58fd254a1c62f745115943ba52cff4b0be9773a6d39ed1",
                "md5": "e66fe1563b043c47f3770c2014c60732",
                "sha256": "169f758c38d307086e6889217ca2fa5a0e3238150004390d3406d9b51b4dcc4c"
            },
            "downloads": -1,
            "filename": "slycat-web-client-4.3.0.tar.gz",
            "has_sig": false,
            "md5_digest": "e66fe1563b043c47f3770c2014c60732",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": null,
            "size": 48299,
            "upload_time": "2024-11-04T16:22:48",
            "upload_time_iso_8601": "2024-11-04T16:22:48.670968Z",
            "url": "https://files.pythonhosted.org/packages/1c/0f/631ed0f309011d58fd254a1c62f745115943ba52cff4b0be9773a6d39ed1/slycat-web-client-4.3.0.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2024-11-04 16:22:48",
    "github": true,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "github_user": "sandialabs",
    "github_project": "slycat",
    "travis_ci": true,
    "coveralls": false,
    "github_actions": false,
    "lcname": "slycat-web-client"
}
        
Elapsed time: 1.01227s