{"id":23331094,"url":"https://github.com/sassoftware/python-swat","last_synced_at":"2025-04-15T03:53:37.346Z","repository":{"id":11442140,"uuid":"69033524","full_name":"sassoftware/python-swat","owner":"sassoftware","description":"The SAS Scripting Wrapper for Analytics Transfer (SWAT) package is the Python client to SAS Cloud Analytic Services (CAS).  It allows users to execute CAS actions and process the results all from Python.","archived":false,"fork":false,"pushed_at":"2024-12-05T19:44:25.000Z","size":13920,"stargazers_count":153,"open_issues_count":36,"forks_count":63,"subscribers_count":37,"default_branch":"main","last_synced_at":"2025-04-07T18:08:55.731Z","etag":null,"topics":["python","sas","sas-osp","sas-swat"],"latest_commit_sha":null,"homepage":"","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"other","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/sassoftware.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":"CONTRIBUTING.md","funding":null,"license":"LICENSE.md","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":"SUPPORT.md","governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2016-09-23T14:42:18.000Z","updated_at":"2025-04-04T18:23:37.000Z","dependencies_parsed_at":"2024-06-07T17:31:57.438Z","dependency_job_id":"59bcf3b4-aded-4aea-b3b6-eaa09aa943ee","html_url":"https://github.com/sassoftware/python-swat","commit_stats":{"total_commits":582,"total_committers":20,"mean_commits":29.1,"dds":"0.20446735395189009","last_synced_commit":"5f81609bc2b740bb2b4382f3adf9c4a47db0ba05"},"previous_names":[],"tags_count":49,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sassoftware%2Fpython-swat","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sassoftware%2Fpython-swat/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sassoftware%2Fpython-swat/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sassoftware%2Fpython-swat/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/sassoftware","download_url":"https://codeload.github.com/sassoftware/python-swat/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":249003955,"owners_count":21196794,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["python","sas","sas-osp","sas-swat"],"created_at":"2024-12-20T22:30:56.342Z","updated_at":"2025-04-15T03:53:37.313Z","avatar_url":"https://github.com/sassoftware.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"\n# SAS Scripting Wrapper for Analytics Transfer (SWAT)\n## Overview\n\nThe **SAS SWAT** package is a Python interface to the **SAS Cloud Analytic \nServices (CAS)** engine (the centerpiece of the \n[SAS Viya](http://www.sas.com/en_us/software/viya.html) framework).\nWith this package, you can load and analyze data sets of any size on your\ndesktop or in the cloud.  Since **CAS** can be used on a local desktop\nor in a hosted cloud environment, you can analyze extremely large data \nsets using as much processing power as you need, while still retaining \nthe ease-of-use of Python on the client side.\n\nUsing **SWAT**, you can execute workflows of **CAS** analytic actions,\nthen pull down the summarized data to further process on the client side\nin Python, or to merge with data from other sources using familiar\n[Pandas](http://pandas.pydata.org) data structures.  In fact, the \n**SWAT** package mimics much of the API of the Pandas package so that\nusing CAS should feel familiar to current Pandas users.\n\nWith the best-of-breed **SAS** analytics in the cloud and the use of\nPython and its large collection of open source packages, the **SWAT**\npackage gives you access to the best of both worlds.\n\nTo view updates to this project see the [Change Log](https://github.com/sassoftware/python-swat/blob/master/CHANGELOG.md).\n\n# Prerequisites\n\nTo access the CAS binary protocol (recommended), you need the following:\n\n* **64-bit** Python 3.7 to 3.12 on Windows or Linux (see shared library notes below)\n\nThe binary protocol requires pre-compiled components found in the\n`pip` installer only.  These pieces are not available as source code and\nare under a separate license (see documentation on SAS TK).  The binary protocol\noffers better performance than REST, especially when transferring larger\namounts of data.  It also offers more advanced data loading from the client\nand data formatting features.\n\nTo access the CAS REST interface only, you can use the pure Python code\nwhich runs in Python 3.7 to 3.12 on all platforms.  While not as fast as the\nbinary protocol, the pure Python interface is more portable.\n\n## Linux Library Dependencies\n\nSome Linux distributions may not install all of the needed shared libraries\nby default.  Most notably, the shared library `libnuma.so.1` is required to\nmake binary protocol connections to CAS.  If you do not have this library on\nyour machine you can install the `numactl` package for your distribution\nto make it available to SWAT.\n\n## Python Dependencies\n\nThe SWAT package uses many features of the Pandas Python package and other\ndependencies of Pandas.  If you do not already have version 0.16.0 or greater\nof Pandas installed, `pip` will install or update it for you when you\ninstall SWAT.\n\nIf you are using `pip` version 23.1 or later to install from a tar.gz file, the\npython wheel package is required.  If you do not have this package installed,\nyou can install it using `pip`.\n\n# Installation\n\nSWAT can be installed using `pip`:\n\n    pip install swat\n    \nYou can also install from the files on the \n[SWAT project releases page](https://github.com/sassoftware/python-swat/releases).\nSimply locate the file for your platform and install it using `pip` as \nfollows:\n\n    pip install https://github.com/sassoftware/python-swat/releases/download/vX.X.X/python-swat-X.X.X-platform.tar.gz\n\nWhere `X.X.X` is the release you want to install, and `platform` is the \nplatform you are installing on.  You can also use the source code distribution\nif you only want to use the CAS REST interface.  It does not contain support\nfor the binary protocol.\n\n\n# Getting Started\n\nFor the full documentation go to \n[sassoftware.github.io/python-swat](https://sassoftware.github.io/python-swat/).\nA simple example is shown below.\n\nOnce you have SWAT installed and you have a CAS server to connect to,\nyou can import swat and create a connection::\n\n    \u003e\u003e\u003e import swat\n    \u003e\u003e\u003e conn = swat.CAS(host, port, username, password)\n\nNote the default port for the Python SWAT connection is 5570.\n\nIf you are using python-swat version 1.8.0 or later to connect to a SAS Viya 3.5 CAS server using Kerberos, prior to connecting you must set the Service Principal Name (SPN) using the CASSPN environment variable.  For SAS Viya 3.5, the SPN string must start with 'sascas@', followed by the hostname.\n\n    export CASSPN=sascas@host\n\nIf you get an error message about the **TCP/IP negClientSSL support routine**, you \nlikely have an issue with your SSL certificate configuration.  See the \n[Encryption](https://sassoftware.github.io/python-swat/encryption.html) documentation\nfor more information.\n\nIf that is successful, you should be able to run an action on the\nCAS server::\n\n    \u003e\u003e\u003e out = conn.serverstatus()\n    NOTE: Grid node action status report: 1 nodes, 6 total actions executed.\n    \u003e\u003e\u003e print(out)\n    [About]\n    \n     {'CAS': 'Cloud Analytic Services',\n      'Copyright': 'Copyright © 2014-2016 SAS Institute Inc. All Rights Reserved.',\n      'System': {'Hostname': 'cas01',\n       'Model Number': 'x86_64',\n       'OS Family': 'LIN X64',\n       'OS Name': 'Linux',\n       'OS Release': '2.6.32-504.12.2.el6.x86_64',\n       'OS Version': '#1 SMP Sun Feb 1 12:14:02 EST 2015'},\n      'Version': '3.01',\n      'VersionLong': 'V.03.01M0D08232016',\n      'license': {'expires': '20Oct2016:00:00:00',\n       'gracePeriod': 62,\n       'site': 'SAS Institute Inc.',\n       'siteNum': 1,\n       'warningPeriod': 31}}\n    \n    [server]\n    \n     Server Status\n    \n        nodes  actions\n     0      1        6\n    \n    [nodestatus]\n    \n     Node Status\n    \n         name        role  uptime  running  stalled\n     0  cas01  controller   4.836        0        0\n    \n    + Elapsed: 0.0168s, user: 0.016s, sys: 0.001s, mem: 0.287mb\n\n    \u003e\u003e\u003e conn.close()\n\n# Contributing \nThe [Contributor Agreement](https://github.com/sassoftware/python-swat/blob/master/ContributorAgreement.txt) details on how contributions can be made to the project. The [Contributing](https://github.com/sassoftware/python-swat/blob/master/CONTRIBUTING.md) includes instructions and rules as it relates to making contributions on the project. \n\n# Licensing \nThe [LICENSE.md](https://github.com/sassoftware/python-swat/blob/master/LICENSE.md) states how this package is released and licensed. \n\n# Additional Resources\n- [Python-SWAT API Documentation](https://sassoftware.github.io/python-swat/)\n- [SAS Viya Documentation](https://support.sas.com/documentation/onlinedoc/viya/index.html)\n- [SAS Communities Library](https://communities.sas.com/t5/SAS-Communities-Library/tkb-p/library/label-name/Python)\n- [Q\u0026A Support](https://communities.sas.com/t5/Developers/bd-p/developers)\n- [Python](http://www.python.org/)\n- [SAS Viya](http://www.sas.com/en_us/software/viya.html)\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsassoftware%2Fpython-swat","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fsassoftware%2Fpython-swat","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsassoftware%2Fpython-swat/lists"}