psocket


Namepsocket JSON
Version 1.1.3 PyPI version JSON
download
home_pagehttps://github.com/c-pher/PSocket.git
SummaryThe cross-platform tool to work with remote connection using sockets
upload_time2023-05-26 10:54:31
maintainer
docs_urlNone
authorAndrey Komissarov
requires_python>=3.6
licenseMIT
keywords
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage No coveralls.
            [![PyPI version](https://badge.fury.io/py/psocket.svg)](https://badge.fury.io/py/psocket)
[![Build Status](https://travis-ci.org/c-pher/PSocket.svg?branch=master)](https://travis-ci.org/c-pher/PSocket)
[![Coverage Status](https://coveralls.io/repos/github/c-pher/PSocket/badge.svg?branch=master)](https://coveralls.io/github/c-pher/PSocket?branch=master)


# PSocket
The cross-platform simple tool to work with remote server through sockets. 
It can establish socket connection to a remote host:port, send commands and receive response.
No need to send byte-string. Use usual strings to send command.

## Installation
For most users, the recommended method to install is via pip:
```cmd
pip install psocket
```

or from source:

```cmd
python setup.py install
```

## Import
```python
from psocket import SocketClient
```
---
## Usage
```python
from psocket import SocketClient

client = SocketClient(host='172.16.0.48', port=3261)
print(client)
```
```python
from psocket import SocketClient

client = SocketClient(host='172.16.0.48', port=3261)
print(client.send_command('<commands>'))
```

---

## Changelog

##### 1.1.3 (26.05.2023)
- Reading completion from the socket fixed
- buffer size reduced to 4k
- Logger extended
- Refactoring

##### 1.1.2 (25.05.2023)
- buffer size increased to 8k
- debug log added

##### 1.1.1 (04.08.2022)

- Detect command is completed by \n\n

##### 1.1.0 (23.07.2022)

- log format changed

##### 1.0.9 (4.06.2022)

- response now split lines (instead of .split('\n'))
- logger now is static `SocketClient`
- "greeting" class attr added
- minor changes in logging format
- socket timeout log level changed from debug to warning

##### 1.0.8 (22.04.2022)

- Set blocking after command send with it

##### 1.0.7 (18.04.2022)

- ._socket_response() renamed to ._receive_all() and changed to read huge amount of data from socket
- buffer size changed to 4k (instead of 64k)
- .send_command() extended with "timeout=None" param

##### 1.0.6 (17.04.2022)

- refactored to manage logger state

##### 1.0.5 (6.04.2022)

- logger moved inside class as attr in order to get access to it from outside
- unknown attr access handling added
-

##### 1.0.4 (14.06.2021)

Added host address logging

##### 1.0.3 (12.03.2021)

- Added ability to disable logs
- "timeout connection" added as parameter with None default value

##### 1.0.2 (15.01.2020)

Added "initialize" param to the constructor

##### 1.0.1 (15.01.2020)

- "is_host_available()" renamed to "is_socket_available()" and updated
- used external logger from "plogger" package

##### 1.0.0a4 (15.01.2020)
- added init docstring
- init notation changed:
  - host is string
  - port is integer

##### 1.0.0a3 (14.01.2020)
- removed timeout from socket connection
- greeting and socket_response now are private methods

##### 1.0.0a2 (13.01.2020)
Reverted "client". Now it is an attribute again to keep session alive 

##### 1.0.0a1 (13.01.2020)
- Now connection creates with client property
- New methods added:
    - is_host_available() 
    - get_sock_name()
    - get_peer_name()

##### 1.0.0a0 (13.01.2020)
- initial commit

            

Raw data

            {
    "_id": null,
    "home_page": "https://github.com/c-pher/PSocket.git",
    "name": "psocket",
    "maintainer": "",
    "docs_url": null,
    "requires_python": ">=3.6",
    "maintainer_email": "",
    "keywords": "",
    "author": "Andrey Komissarov",
    "author_email": "a.komisssarov@gmail.com",
    "download_url": "https://files.pythonhosted.org/packages/43/79/f428fd0e741190562e6436adb29e46c7869edfa226ae34ac88274b0d9a03/psocket-1.1.3.tar.gz",
    "platform": null,
    "description": "[![PyPI version](https://badge.fury.io/py/psocket.svg)](https://badge.fury.io/py/psocket)\n[![Build Status](https://travis-ci.org/c-pher/PSocket.svg?branch=master)](https://travis-ci.org/c-pher/PSocket)\n[![Coverage Status](https://coveralls.io/repos/github/c-pher/PSocket/badge.svg?branch=master)](https://coveralls.io/github/c-pher/PSocket?branch=master)\n\n\n# PSocket\nThe cross-platform simple tool to work with remote server through sockets. \nIt can establish socket connection to a remote host:port, send commands and receive response.\nNo need to send byte-string. Use usual strings to send command.\n\n## Installation\nFor most users, the recommended method to install is via pip:\n```cmd\npip install psocket\n```\n\nor from source:\n\n```cmd\npython setup.py install\n```\n\n## Import\n```python\nfrom psocket import SocketClient\n```\n---\n## Usage\n```python\nfrom psocket import SocketClient\n\nclient = SocketClient(host='172.16.0.48', port=3261)\nprint(client)\n```\n```python\nfrom psocket import SocketClient\n\nclient = SocketClient(host='172.16.0.48', port=3261)\nprint(client.send_command('<commands>'))\n```\n\n---\n\n## Changelog\n\n##### 1.1.3 (26.05.2023)\n- Reading completion from the socket fixed\n- buffer size reduced to 4k\n- Logger extended\n- Refactoring\n\n##### 1.1.2 (25.05.2023)\n- buffer size increased to 8k\n- debug log added\n\n##### 1.1.1 (04.08.2022)\n\n- Detect command is completed by \\n\\n\n\n##### 1.1.0 (23.07.2022)\n\n- log format changed\n\n##### 1.0.9 (4.06.2022)\n\n- response now split lines (instead of .split('\\n'))\n- logger now is static `SocketClient`\n- \"greeting\" class attr added\n- minor changes in logging format\n- socket timeout log level changed from debug to warning\n\n##### 1.0.8 (22.04.2022)\n\n- Set blocking after command send with it\n\n##### 1.0.7 (18.04.2022)\n\n- ._socket_response() renamed to ._receive_all() and changed to read huge amount of data from socket\n- buffer size changed to 4k (instead of 64k)\n- .send_command() extended with \"timeout=None\" param\n\n##### 1.0.6 (17.04.2022)\n\n- refactored to manage logger state\n\n##### 1.0.5 (6.04.2022)\n\n- logger moved inside class as attr in order to get access to it from outside\n- unknown attr access handling added\n-\n\n##### 1.0.4 (14.06.2021)\n\nAdded host address logging\n\n##### 1.0.3 (12.03.2021)\n\n- Added ability to disable logs\n- \"timeout connection\" added as parameter with None default value\n\n##### 1.0.2 (15.01.2020)\n\nAdded \"initialize\" param to the constructor\n\n##### 1.0.1 (15.01.2020)\n\n- \"is_host_available()\" renamed to \"is_socket_available()\" and updated\n- used external logger from \"plogger\" package\n\n##### 1.0.0a4 (15.01.2020)\n- added init docstring\n- init notation changed:\n  - host is string\n  - port is integer\n\n##### 1.0.0a3 (14.01.2020)\n- removed timeout from socket connection\n- greeting and socket_response now are private methods\n\n##### 1.0.0a2 (13.01.2020)\nReverted \"client\". Now it is an attribute again to keep session alive \n\n##### 1.0.0a1 (13.01.2020)\n- Now connection creates with client property\n- New methods added:\n    - is_host_available() \n    - get_sock_name()\n    - get_peer_name()\n\n##### 1.0.0a0 (13.01.2020)\n- initial commit\n",
    "bugtrack_url": null,
    "license": "MIT",
    "summary": "The cross-platform tool to work with remote connection using sockets",
    "version": "1.1.3",
    "project_urls": {
        "Homepage": "https://github.com/c-pher/PSocket.git"
    },
    "split_keywords": [],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "aa969da7b5f726eaec83344c9c87bff87fd3da1dddb5800fccbce2080c53fbd5",
                "md5": "7fc6ac4649508566d6e8952de521abf8",
                "sha256": "cc264185dd8208b55109917e168a09b4d775eb902239f73f0d47ca94f207979b"
            },
            "downloads": -1,
            "filename": "psocket-1.1.3-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "7fc6ac4649508566d6e8952de521abf8",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": ">=3.6",
            "size": 5354,
            "upload_time": "2023-05-26T10:54:26",
            "upload_time_iso_8601": "2023-05-26T10:54:26.506835Z",
            "url": "https://files.pythonhosted.org/packages/aa/96/9da7b5f726eaec83344c9c87bff87fd3da1dddb5800fccbce2080c53fbd5/psocket-1.1.3-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "4379f428fd0e741190562e6436adb29e46c7869edfa226ae34ac88274b0d9a03",
                "md5": "2393b5a5616fab4c90206e2e29a190b1",
                "sha256": "d39bea70019069d739ea1e8c469048b93e932823085832f73e76ac3d148c7cf3"
            },
            "downloads": -1,
            "filename": "psocket-1.1.3.tar.gz",
            "has_sig": false,
            "md5_digest": "2393b5a5616fab4c90206e2e29a190b1",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": ">=3.6",
            "size": 5261,
            "upload_time": "2023-05-26T10:54:31",
            "upload_time_iso_8601": "2023-05-26T10:54:31.207287Z",
            "url": "https://files.pythonhosted.org/packages/43/79/f428fd0e741190562e6436adb29e46c7869edfa226ae34ac88274b0d9a03/psocket-1.1.3.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2023-05-26 10:54:31",
    "github": true,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "github_user": "c-pher",
    "github_project": "PSocket",
    "github_not_found": true,
    "lcname": "psocket"
}
        
Elapsed time: 0.15423s