netport


Namenetport JSON
Version 0.4.0 PyPI version JSON
download
home_pagehttps://github.com/IgalKolihman/netport
SummaryTool for managing resources on a remove machine using openapi
upload_time2023-01-27 14:46:14
maintainer
docs_urlNone
authorIgal Kolihman
requires_python>=3.7,<4.0
licenseMIT
keywords manager resources remote managing network networking openapi
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage No coveralls.
            # Netport

![Licence](https://badgen.net/pypi/license/netport)
![Python Versions](https://badgen.net/pypi/python/netport)
![Pypi Version](https://badgen.net/pypi/v/netport)
![Code Quality Status](https://github.com/IgalKolihman/netport/actions/workflows/pull_request.yaml/badge.svg)

Netport is a tool for managing single-access resources on the target Unix machine. Netport manages
the access to different types of resources on the operating system by not allowing multiple requests
to the same resource. For example ports, files, processes, network interfaces, and more...

# How it works

```mermaid
flowchart TD
    client([Client])
    server[/Netport Server\]
    database[(Database)]
    resources{{Resources}}
    ports(Ports)
    interfaces(Interfaces)
    fs(File System)
    proc(System Processes)
    info(System Info)
    
    client <--REST API requests--> server
    server <--stores server state---> database
    server <----> resources
    resources --- ports
    resources --- interfaces
    resources --- fs
    resources --- proc
    resources --- info
```

## Framework

Netport runs in a single python process on the target machine. It uses the
[FastAPI](https://fastapi.tiangolo.com/) framework to make a high performance and easy to use REST
api server. By using this api, users can easily perform a variety of requests to various resources.

There are many types of requests that can be made:

* Acquire a free port.
* Check if file exists
* Declare that a file is being used
* Start a process
* Get a list of already acquired resources

And many more...

## Backend Storage

In order to maintain an active memory of the used resources, Netport communicates with a database.
There are 2 types of supported databases that netport uses:

* Redis database
* Local pythonic database.

Both databases serve the same purpose for netport, but their inner functionality still a bit
different, with one draw back for the local database. **The local database doesn't save netport's
state after a shutdown or a reboot**.

The decision whether to use redis DB or a local one, depends by the user. In case of an unexpected
shutdown, with redis the state of netport will be stored and on reboot it will continue from where
it stopped. On the other hand, for much simpler systems this feature might be unnecessary
complicated.

# Installation

Make sure that python is installed on your machine (3.7 and above). Open your terminal and run the
following command:

```shell
pip install netport
```

> _It is advised to use a dedicated python virtual environment for netport._

# Developer Installation

Install poetry by following the instructions [here](https://python-poetry.org/docs/).

1. Clone this repository:

```shell
git clone https://github.com/IgalKolihman/netport.git
```

2. Install the development environment:

```shell
poetry install --with dev
```

# Usage

Please follow the [installation procedure](#installation) to be able to run Netport. After that
netport will be available to you as long as you are using it's virtual environment.

To run netport with basic configurations, run:

```shell
netport
```

After executing this command, a link will appear in the terminal to the server's url. The API
documentation will be available at: _**"http://host_ip:port/docs"**_

For more advanced information regarding netport execution, run the following command:

```shell
netport -h
```
            

Raw data

            {
    "_id": null,
    "home_page": "https://github.com/IgalKolihman/netport",
    "name": "netport",
    "maintainer": "",
    "docs_url": null,
    "requires_python": ">=3.7,<4.0",
    "maintainer_email": "",
    "keywords": "manager,resources,remote,managing,network,networking,openapi",
    "author": "Igal Kolihman",
    "author_email": "igalk.spam@gmail.com",
    "download_url": "https://files.pythonhosted.org/packages/07/ca/cb4915a8470db97780a80c1b668045ecbb63d92fee787c63f9be78a59a34/netport-0.4.0.tar.gz",
    "platform": null,
    "description": "# Netport\n\n![Licence](https://badgen.net/pypi/license/netport)\n![Python Versions](https://badgen.net/pypi/python/netport)\n![Pypi Version](https://badgen.net/pypi/v/netport)\n![Code Quality Status](https://github.com/IgalKolihman/netport/actions/workflows/pull_request.yaml/badge.svg)\n\nNetport is a tool for managing single-access resources on the target Unix machine. Netport manages\nthe access to different types of resources on the operating system by not allowing multiple requests\nto the same resource. For example ports, files, processes, network interfaces, and more...\n\n# How it works\n\n```mermaid\nflowchart TD\n    client([Client])\n    server[/Netport Server\\]\n    database[(Database)]\n    resources{{Resources}}\n    ports(Ports)\n    interfaces(Interfaces)\n    fs(File System)\n    proc(System Processes)\n    info(System Info)\n    \n    client <--REST API requests--> server\n    server <--stores server state---> database\n    server <----> resources\n    resources --- ports\n    resources --- interfaces\n    resources --- fs\n    resources --- proc\n    resources --- info\n```\n\n## Framework\n\nNetport runs in a single python process on the target machine. It uses the\n[FastAPI](https://fastapi.tiangolo.com/) framework to make a high performance and easy to use REST\napi server. By using this api, users can easily perform a variety of requests to various resources.\n\nThere are many types of requests that can be made:\n\n* Acquire a free port.\n* Check if file exists\n* Declare that a file is being used\n* Start a process\n* Get a list of already acquired resources\n\nAnd many more...\n\n## Backend Storage\n\nIn order to maintain an active memory of the used resources, Netport communicates with a database.\nThere are 2 types of supported databases that netport uses:\n\n* Redis database\n* Local pythonic database.\n\nBoth databases serve the same purpose for netport, but their inner functionality still a bit\ndifferent, with one draw back for the local database. **The local database doesn't save netport's\nstate after a shutdown or a reboot**.\n\nThe decision whether to use redis DB or a local one, depends by the user. In case of an unexpected\nshutdown, with redis the state of netport will be stored and on reboot it will continue from where\nit stopped. On the other hand, for much simpler systems this feature might be unnecessary\ncomplicated.\n\n# Installation\n\nMake sure that python is installed on your machine (3.7 and above). Open your terminal and run the\nfollowing command:\n\n```shell\npip install netport\n```\n\n> _It is advised to use a dedicated python virtual environment for netport._\n\n# Developer Installation\n\nInstall poetry by following the instructions [here](https://python-poetry.org/docs/).\n\n1. Clone this repository:\n\n```shell\ngit clone https://github.com/IgalKolihman/netport.git\n```\n\n2. Install the development environment:\n\n```shell\npoetry install --with dev\n```\n\n# Usage\n\nPlease follow the [installation procedure](#installation) to be able to run Netport. After that\nnetport will be available to you as long as you are using it's virtual environment.\n\nTo run netport with basic configurations, run:\n\n```shell\nnetport\n```\n\nAfter executing this command, a link will appear in the terminal to the server's url. The API\ndocumentation will be available at: _**\"http://host_ip:port/docs\"**_\n\nFor more advanced information regarding netport execution, run the following command:\n\n```shell\nnetport -h\n```",
    "bugtrack_url": null,
    "license": "MIT",
    "summary": "Tool for managing resources on a remove machine using openapi",
    "version": "0.4.0",
    "split_keywords": [
        "manager",
        "resources",
        "remote",
        "managing",
        "network",
        "networking",
        "openapi"
    ],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "70281e2b366ac995f2cbea66d4407616dac9b97159ac45f10090713447e3e23f",
                "md5": "56bed64623b1e4e151a961fc1f3b2778",
                "sha256": "6bd336ef127364c6835da89e80cebae3300f7f2ae543f03196e26011e243ed52"
            },
            "downloads": -1,
            "filename": "netport-0.4.0-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "56bed64623b1e4e151a961fc1f3b2778",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": ">=3.7,<4.0",
            "size": 10500,
            "upload_time": "2023-01-27T14:46:13",
            "upload_time_iso_8601": "2023-01-27T14:46:13.226304Z",
            "url": "https://files.pythonhosted.org/packages/70/28/1e2b366ac995f2cbea66d4407616dac9b97159ac45f10090713447e3e23f/netport-0.4.0-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "07cacb4915a8470db97780a80c1b668045ecbb63d92fee787c63f9be78a59a34",
                "md5": "c43d2f797f1295a20c0a0355fdbfb6b8",
                "sha256": "c9651dc6c4f78d156d68ee9cb6eb5aadbda8f3b9f356a7750d8b673e193e6a35"
            },
            "downloads": -1,
            "filename": "netport-0.4.0.tar.gz",
            "has_sig": false,
            "md5_digest": "c43d2f797f1295a20c0a0355fdbfb6b8",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": ">=3.7,<4.0",
            "size": 9452,
            "upload_time": "2023-01-27T14:46:14",
            "upload_time_iso_8601": "2023-01-27T14:46:14.372239Z",
            "url": "https://files.pythonhosted.org/packages/07/ca/cb4915a8470db97780a80c1b668045ecbb63d92fee787c63f9be78a59a34/netport-0.4.0.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2023-01-27 14:46:14",
    "github": true,
    "gitlab": false,
    "bitbucket": false,
    "github_user": "IgalKolihman",
    "github_project": "netport",
    "travis_ci": false,
    "coveralls": false,
    "github_actions": true,
    "lcname": "netport"
}
        
Elapsed time: 0.04369s