{"id":20292477,"url":"https://github.com/mauricelambert/webscriptsclient","last_synced_at":"2025-10-17T17:46:00.547Z","repository":{"id":62588555,"uuid":"445655448","full_name":"mauricelambert/WebScriptsClient","owner":"mauricelambert","description":"This package implements the \"official\" WebScripts client. This package implements client for default WebScripts features.","archived":false,"fork":false,"pushed_at":"2022-02-15T19:41:51.000Z","size":187,"stargazers_count":2,"open_issues_count":0,"forks_count":1,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-01-14T09:14:39.827Z","etag":null,"topics":["api-client","cli","pypi","python-package","python3","webscripts"],"latest_commit_sha":null,"homepage":"https://webscripts.readthedocs.io/en/latest/","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"gpl-3.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/mauricelambert.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE.txt","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2022-01-07T21:20:18.000Z","updated_at":"2023-02-13T19:59:42.000Z","dependencies_parsed_at":"2022-11-03T17:54:58.224Z","dependency_job_id":null,"html_url":"https://github.com/mauricelambert/WebScriptsClient","commit_stats":null,"previous_names":[],"tags_count":1,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mauricelambert%2FWebScriptsClient","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mauricelambert%2FWebScriptsClient/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mauricelambert%2FWebScriptsClient/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mauricelambert%2FWebScriptsClient/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/mauricelambert","download_url":"https://codeload.github.com/mauricelambert/WebScriptsClient/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":241787485,"owners_count":20020101,"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":["api-client","cli","pypi","python-package","python3","webscripts"],"created_at":"2024-11-14T15:17:25.743Z","updated_at":"2025-10-17T17:45:55.501Z","avatar_url":"https://github.com/mauricelambert.png","language":"Python","readme":"![WebScripts Logo](https://mauricelambert.github.io/info/python/code/WebScripts/small_logo.png \"WebScripts logo\")\r\n\r\n# WebScriptsClient\r\n\r\n## Description\r\n\r\nThis package implements the \"official\" WebScriptsClient as a python module with a CLI.\r\n\r\nFeatures implemented:\r\n\r\n - Get scripts, arguments and informations\r\n - Execute scripts on WebScripts Server\r\n - Download file from WebScripts Server\r\n - Upload file on WebScripts Server\r\n - Send requests or reports to WebScripts Administrator\r\n - Test the WebScripts Server\r\n\r\n## Requirements\r\n\r\nThis package require:\r\n\r\n - python3\r\n - python3 Standard Library\r\n\r\n## Installation\r\n\r\n```bash\r\npip install WebScriptsClient\r\n```\r\n\r\n## Usages\r\n\r\n### Command line\r\n\r\n#### Module\r\n\r\n```bash\r\npython3 -m WebScriptsClient -h\r\n```\r\n\r\n#### Python executable\r\n\r\n```bash\r\npython3 WebScriptsClient.pyz --help\r\n```\r\n\r\n#### Command\r\n\r\n```bash\r\n# Tests\r\nWebScriptsClient -v -u Admin -p Admin test http://127.0.0.1:8000/web/                                  # Test your WebScripts Server with verbose mode (log level DEBUG)\r\n\r\n# Informations\r\nWebScriptsClient info http://127.0.0.1:8000/web/                                                       # Script informations without authentication\r\nWebScriptsClient -a AdminAdminAdminAdminAdminAdminAdminAdminAdminAdminAdminAdminAdminAdminAdminAdminAdminAdminAdminAdminAdminAdminAdminAdminAdminAdminAdminAdminAdminAdminAdminAdmin info -a -c -d -s \"test_config.py\" \"/auth/\" http://127.0.0.1:8000/web/    # Get informations about test_config.py and /auth/ scripts without category, description and arguments (authenticated with API key)\r\n\r\n# Execution\r\nWebScriptsClient -A exec \"test_config.py\" http://127.0.0.1:8000/web/                                   # Run a script named test_config.py without arguments using the API key (prompt, interactive mode)\r\npython -c \"print('test')\" | WebScriptsClient -u Admin -p Admin exec \"test_config.py\" -o test.txt -I http://127.0.0.1:8000/web/ # Run a script named test_config.py without arguments, using username and password for authentication, redirect output in file named test.txt and use STDIN as inputs\r\nWebScriptsClient -u Admin -p Admin exec \"test_config.py\" -I test.txt http://127.0.0.1:8000/web/        # Run a script named test_config.py without arguments, using username and password for authentication and using test.txt as inputs\r\nWebScriptsClient -u Admin -p Admin exec \"test_config.py --test test3 --test4 -t\" -i \"test1\" \"test2\" http://127.0.0.1:8000/web/ # Run a script named test_config.py with arguments, using username and password for authentication and using inputs\r\n\r\n# Upload\r\nWebScriptsClient -u Admin -p Admin upload -r 1000 -w 1000 -d 1000 -f test.txt test.txt http://127.0.0.1:8000/web/ # Upload a local file named test.txt on WebScripts Server with read, write and delete permissions equal to 1000 (group Admin in default WebScripts database) using the default Admin account. The file will be named test.txt on the WebScripts Server.\r\nWebScriptsClient -u Admin -p Admin upload -6 -b -C -H -c dGVzdA== test.txt http://127.0.0.1:8000/web/             # Upload a file content on WebScripts Server using Base64 encoding, without compression, as binary and hidden file. The file will be named test.txt on the WebScripts Server.\r\npython -c \"print('test')\" | WebScriptsClient -u Admin -p Admin upload test.txt http://127.0.0.1:8000/web/         # Upload a file content from STDIN on the WebScript Server. The file will be named test.txt on the WebScripts Server.\r\n\r\n# Download\r\nWebScriptsClient -u Admin -p Admin download -f \"LICENSE.txt\" \"test.txt\" http://127.0.0.1:8000/web/     # Download files (LICENSE.txt and test.txt) from WebScripts Server\r\nWebScriptsClient -u Admin -p Admin download -s -f \"LICENSE.txt\" \"test.txt\" http://127.0.0.1:8000/web/  # Download files (LICENSE.txt and test.txt) from WebScripts Server and the save it locally with same names\r\nWebScriptsClient -u Admin -p Admin download -o test.txt -f \"LICENSE.txt\" \"test.txt\" http://127.0.0.1:8000/web/ # Download files (LICENSE.txt and test.txt) from WebScripts Server and save it locally in test.txt (file concatenation)\r\n\r\n# Request or report\r\nWebScriptsClient -u Admin -P request -s title -n Maurice -r request -c 500 http://127.0.0.1:8000/web/  # Request or report to WebScripts Administrator using username and password (prompt, interactive mode), adding Subject, Name, Message and the HTTP error code\r\n```\r\n\r\n### Python script\r\n\r\n```python\r\nfrom WebScriptsClient import WebScriptsClient\r\n\r\nclient = WebScriptsClient(\"http://127.0.0.1:8000/web/\", username=\"Admin\", password=\"Admin\", api_key=\"AdminAdminAdminAdminAdminAdminAdminAdminAdminAdminAdminAdminAdminAdminAdminAdminAdminAdminAdminAdminAdminAdminAdminAdminAdminAdminAdminAdminAdminAdminAdminAdmin\")\r\nclient.auth()\r\n\r\n# Informations\r\nscripts = client.get_scripts(refresh=False)\r\n\r\n# Execution\r\narguments = client.args_command_to_webscripts([\"--test\", \"test1\", \"test3\"])\r\ninputs = client.args_command_to_webscripts([\"--test\", \"test1\", \"test3\"], is_inputs=True)\r\nfor output, error, code in client.execute_script(\"test_config.py\", arguments, inputs):\r\n    print(output, end=\"\")\r\nprint(f\"Error code: {code}\")\r\nprint(f\"Error: {error}\")\r\n\r\n# Upload\r\nclient.upload(\"upload.txt\", open(\"upload.txt\"), no_compression=False, is_base64=False, hidden=False, binary=False, read_permissions=0, write_permissions=1000, delete_permissions=1000)\r\n\r\n# Download\r\nfile = client.download(\"upload.txt\", save=True)\r\n\r\n# Request\r\nclient.request(\"Access\", \"I need access to test_config.py\", \"Maurice LAMBERT\", error_code=500)\r\n```\r\n\r\n## Links\r\n\r\n - [Github Page](https://github.com/mauricelambert/WebScriptsClient/)\r\n - [Documentation](https://mauricelambert.github.io/info/python/code/WebScriptsClient.html)\r\n - [Pypi package](https://pypi.org/project/WebScriptsClient/)\r\n - [Python Executable](https://mauricelambert.github.io/info/python/code/WebScriptsClient.pyz)\r\n - [Windows Executable](https://github.com/mauricelambert/WebScriptsClient/releases/download/v0.0.3/WebScriptsClient.exe)\r\n\r\n## Help\r\n\r\n```text\r\npython WebScriptsClient.py --help\r\nusage: WebScriptsClient.py [-h] [-v] [-i] [-u USERNAME] [-p PASSWORD | -P] [-a API_KEY | -A] {info,exec,upload,download,request,test} ... url\r\n\r\nThis package is the \"official\" WebScripts client. This package implements client for default WebScripts features.\r\n\r\npositional arguments:\r\n  {info,exec,upload,download,request,test}\r\n                        Use default features of the WebScripts server.\r\n    info                Get the available scripts, arguments, and information about them.\r\n    exec                Execute a script on WebScripts Server.\r\n    upload              Upload a file on WebScripts Server.\r\n    download            Download files from WebScripts Server.\r\n    request             Request or report to WebScripts administrator.\r\n    test                Test WebScripts server and client.\r\n  url                   URL of the WebScripts server, example: http://127.0.0.1:8000\r\n\r\noptional arguments:\r\n  -h, --help            show this help message and exit\r\n  -v, --verbose         Verbose mode (print logs).\r\n  -i, --insecure        Do not check SSL certificate.\r\n  -u USERNAME, --username USERNAME\r\n                        WebScripts username to use for this connection.\r\n  -p PASSWORD, --password PASSWORD\r\n                        WebScripts password to use for this connection.\r\n  -P, --password-prompt\r\n                        Interactive password prompt.\r\n  -a API_KEY, --api-key API_KEY\r\n                        WebScripts password to use for this connection.\r\n  -A, --api-key-prompt  Interactive API key prompt.\r\n```\r\n\r\n```text\r\npython WebScriptsClient.py info --help\r\nusage: WebScriptsClient.py info [-h] [-a] [-d] [-c] [-s SCRIPTS [SCRIPTS ...]]\r\n\r\noptional arguments:\r\n  -h, --help            show this help message and exit\r\n  -a, --no-arguments    Do not print arguments.\r\n  -d, --no-descriptions\r\n                        Do not print description.\r\n  -c, --no-categories   Do not print categories.\r\n  -s SCRIPTS [SCRIPTS ...], --scripts SCRIPTS [SCRIPTS ...]\r\n                        Information about specific scripts.\r\n```\r\n\r\n```text\r\npython WebScriptsClient.py exec --help\r\nusage: WebScriptsClient.py exec [-h] [-o [OUTPUT_FILENAME]] [-i INPUTS [INPUTS ...] | -I [INPUT_FILENAME]] command\r\n\r\npositional arguments:\r\n  command               Command to execute script on WebScripts Server.\r\n\r\noptional arguments:\r\n  -h, --help            show this help message and exit\r\n  -o [OUTPUT_FILENAME], --output-filename [OUTPUT_FILENAME], --output [OUTPUT_FILENAME]\r\n                        Output file to save the result.\r\n  -i INPUTS [INPUTS ...], --inputs INPUTS [INPUTS ...]\r\n                        Inputs value for script inputs.\r\n  -I [INPUT_FILENAME], --input-filename [INPUT_FILENAME], --input [INPUT_FILENAME]\r\n                        Input file for script inputs.\r\n```\r\n\r\n```text\r\npython WebScriptsClient.py upload --help\r\nusage: WebScriptsClient.py upload [-h] [-6] [-C] [-H] [-b] [-r READ_PERMISSION] [-w WRITE_PERMISSION] [-d DELETE_PERMISSION] [-f FILE | -c CONTENT] filename\r\n\r\npositional arguments:\r\n  filename              The file name of the uploaded file.\r\n\r\noptional arguments:\r\n  -h, --help            show this help message and exit\r\n  -6, --base64, --64    Upload a base64 encoded file on the server.\r\n  -C, --no-compression  Do not compress the file on the server.\r\n  -H, --hidden          Hide the file on the server.\r\n  -b, --binary, --bin   Upload a binary file on the server.\r\n  -r READ_PERMISSION, --read-permission READ_PERMISSION, --read READ_PERMISSION\r\n                        Read permission on the server.\r\n  -w WRITE_PERMISSION, --write-permission WRITE_PERMISSION, --write WRITE_PERMISSION\r\n                        Write permission on the server.\r\n  -d DELETE_PERMISSION, --delete-permission DELETE_PERMISSION, --delete DELETE_PERMISSION\r\n                        Delete permission on the server.\r\n  -f FILE, --file FILE  The filename of the file to upload on the server.\r\n  -c CONTENT, --content CONTENT\r\n                        Content of the file.\r\n```\r\n\r\n```text\r\npython WebScriptsClient.py download --help\r\nusage: WebScriptsClient.py download [-h] -f FILENAMES [FILENAMES ...] [-o [OUTPUT_FILENAME]] [-s]\r\n\r\noptional arguments:\r\n  -h, --help            show this help message and exit\r\n  -f FILENAMES [FILENAMES ...], --filenames FILENAMES [FILENAMES ...]\r\n                        Filenames to download.\r\n  -o [OUTPUT_FILENAME], --output-filename [OUTPUT_FILENAME], --output [OUTPUT_FILENAME]\r\n                        Filename to write the downloaded content.\r\n  -s, --save            Save the download in the same local filename.\r\n```\r\n\r\n```text\r\npython WebScriptsClient.py request --help\r\nusage: WebScriptsClient.py request [-h] [-s SUBJECT] [-n NAME] [-r REQUEST] [-c ERROR_CODE]\r\n\r\noptional arguments:\r\n  -h, --help            show this help message and exit\r\n  -s SUBJECT, --subject SUBJECT\r\n                        The request/report subject.\r\n  -n NAME, --name NAME  Your name (Firstname LASTNAME).\r\n  -r REQUEST, --request REQUEST\r\n                        The request/report.\r\n  -c ERROR_CODE, --error-code ERROR_CODE\r\n                        The HTTP error code {403, 404, 406, 500 ...}.\r\n```\r\n\r\n```text\r\npython WebScriptsClient.py test --help\r\nusage: WebScriptsClient.py test [-h]\r\n\r\noptional arguments:\r\n  -h, --help  show this help message and exit\r\n```\r\n\r\n## Licence\r\n\r\nLicensed under the [GPL, version 3](https://www.gnu.org/licenses/).\r\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmauricelambert%2Fwebscriptsclient","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmauricelambert%2Fwebscriptsclient","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmauricelambert%2Fwebscriptsclient/lists"}