daemonpy


Namedaemonpy JSON
Version 2.0.3 PyPI version JSON
download
home_pagehttps://vroncevic.github.io/daemonpy/
SummaryCreating Daemon process
upload_time2024-01-06 18:44:18
maintainer
docs_urlNone
authorVladimir Roncevic
requires_python>=3.10
licenseGPL 2024 Free software to use and distributed it.
keywords unix linux daemon process
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage No coveralls.
            <img align="right" src="https://raw.githubusercontent.com/vroncevic/daemonpy/dev/docs/daemonpy_logo.png" width="25%">

# Creating Daemon process

**daemonpy** is package for creating Daemon processes.

Developed in **[python](https://www.python.org/)** code: **100%**.

The README is used to introduce the modules and provide instructions on
how to install the modules, any machine dependencies it may have and any
other information that should be provided before the modules are installed.

[![daemonpy python checker](https://github.com/vroncevic/daemonpy/actions/workflows/daemonpy_python_checker.yml/badge.svg)](https://github.com/vroncevic/daemonpy/actions/workflows/daemonpy_python_checker.yml) [![daemonpy package checker](https://github.com/vroncevic/daemonpy/actions/workflows/daemonpy_package_checker.yml/badge.svg)](https://github.com/vroncevic/daemonpy/actions/workflows/daemonpy_package.yml) [![GitHub issues open](https://img.shields.io/github/issues/vroncevic/daemonpy.svg)](https://github.com/vroncevic/daemonpy/issues) [![GitHub contributors](https://img.shields.io/github/contributors/vroncevic/daemonpy.svg)](https://github.com/vroncevic/daemonpy/graphs/contributors)

<!-- START doctoc generated TOC please keep comment here to allow auto update -->
<!-- DON'T EDIT THIS SECTION, INSTEAD RE-RUN doctoc TO UPDATE -->
**Table of Contents**

- [Installation](#installation)
    - [Install using pip](#install-using-pip)
    - [Install using build](#install-using-build)
    - [Install using py setup](#install-using-py-setup)
    - [Install using docker](#install-using-docker)
- [Usage](#usage)
- [Dependencies](#dependencies)
- [Package structure](#package-structure)
- [Docs](#docs)
- [Copyright and Licence](#copyright-and-licence)

<!-- END doctoc generated TOC please keep comment here to allow auto update -->

### Installation

Used next development environment

![debian linux os](https://raw.githubusercontent.com/vroncevic/daemonpy/dev/docs/debtux.png)

[![daemonpy python3 build](https://github.com/vroncevic/daemonpy/actions/workflows/daemonpy_python3_build.yml/badge.svg)](https://github.com/vroncevic/daemonpy/actions/workflows/daemonpy_python3_build.yml)

Currently there are three ways to install package
* Install process based on using pip mechanism
* Install process based on build mechanism
* Install process based on setup.py mechanism
* Install process based on docker mechanism

##### Install using pip

Python package is located at **[pypi.org](https://pypi.org/project/daemonpy/)**.

You can install by using pip

```bash
# python3
pip3 install daemonpy
```

##### Install using build

Navigate to **[release page](https://github.com/vroncevic/daemonpy/releases)** download and extract release archive.

To install **daemonpy** type the following

```bash
tar xvzf daemonpy-x.y.z.tar.gz
cd daemonpy-x.y.z
# python3
pip3 install -r requirements.txt
python3 -m build
pip3 install dist/daemonpy-x.y.z-py3-none-any.whl
```

##### Install using py setup

Navigate to **[release page](https://github.com/vroncevic/daemonpy/releases)** download and extract release archive.

To install **daemonpy**, locate and run setup.py with arguments

```bash
tar xvzf daemonpy-x.y.z.tar.gz
cd daemonpy-x.y.z
# python3
pip3 install -r requirements.txt
python3 setup.py install_lib
python3 setup.py install_egg_info
```

##### Install using docker

You can use Dockerfile to create image/container.

### Usage

Create short example
```python
#!/usr/bin/env python

'''
 Module
     mydaemon.py
 Copyright
     Copyright (C) 2020 - 2024 Vladimir Roncevic <elektron.ronca@gmail.com>
     mydaemon is free software: you can redistribute it and/or modify it
     under the terms of the GNU General Public License as published by the
     Free Software Foundation, either version 3 of the License, or
     (at your option) any later version.
     mydaemon is distributed in the hope that it will be useful, but
     WITHOUT ANY WARRANTY; without even the implied warranty of
     MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
     See the GNU General Public License for more details.
     You should have received a copy of the GNU General Public License along
     with this program. If not, see <http://www.gnu.org/licenses/>.
 Info
     Defines class MyDaemon with attribute(s) and method(s).
     Set an operation for Daemon process.
'''

import sys
from time import sleep

try:
    from daemonpy import Daemon
except ImportError as ats_error:
    MESSAGE = '\n{0}\n{1}\n'.format(__file__, ats_error)
    sys.exit(MESSAGE)  # Force close python ATS ##############################


class MyDaemon(Daemon):
    '''
        Defines class MyDaemon with attribute(s) and method(s).
        Set an operation for Daemon process.
        It defines:

            :attributes:
                | None
            :methods:
                | run - run Daemon process (defined method).
    '''

    def run(self):
        '''
            Run Daemon process with time sleep example.

            :exceptions: None
        '''
        while True:
            sleep(1)

if __name__ == '__main__':
    DAEMON = MyDaemon('/tmp/daemon-example.pid')
    DAEMON.usage(sys.argv[1])
```

### Dependencies

These modules requires other modules and libraries
* [daemonpy - Python App/Tool/Script Utilities](https://pypi.org/project/daemonpy/)

### Package structure

**daemonpy** is based on OOP.

Package structure

```bash
    daemonpy/
        ├── daemon_usage.py
        ├── file_descriptor.py
        ├── file_process_id.py
        ├── __init__.py
        └── unix_operations.py
```

### Docs

[![Documentation Status](https://readthedocs.org/projects/daemonpy/badge/?version=latest)](https://daemonpy.readthedocs.io/en/latest/?badge=latest)

More documentation and info at

* [daemonpy.readthedocs.io](https://daemonpy.readthedocs.io)
* [www.python.org](https://www.python.org/)

### Contributing

[Contributing to daemonpy](CONTRIBUTING.md)

### Copyright and licence

[![License: GPL v3](https://img.shields.io/badge/License-GPLv3-blue.svg)](https://www.gnu.org/licenses/gpl-3.0) [![License](https://img.shields.io/badge/License-Apache%202.0-blue.svg)](https://opensource.org/licenses/Apache-2.0)

Copyright (C) 2020 - 2024 by [vroncevic.github.io/daemonpy](https://vroncevic.github.io/daemonpy/)

**daemonpy** is free software; you can redistribute it and/or modify
it under the same terms as Python itself, either Python version 2.x/3.x or,
at your option, any later version of Python 3 you may have available.

Lets help and support PSF.

[![Python Software Foundation](https://raw.githubusercontent.com/vroncevic/daemonpy/dev/docs/psf-logo-alpha.png)](https://www.python.org/psf/)

[![Donate](https://www.paypalobjects.com/en_US/i/btn/btn_donateCC_LG.gif)](https://www.python.org/psf/donations/)

            

Raw data

            {
    "_id": null,
    "home_page": "https://vroncevic.github.io/daemonpy/",
    "name": "daemonpy",
    "maintainer": "",
    "docs_url": null,
    "requires_python": ">=3.10",
    "maintainer_email": "",
    "keywords": "Unix,Linux,Daemon,Process",
    "author": "Vladimir Roncevic",
    "author_email": "elektron.ronca@gmail.com",
    "download_url": "https://files.pythonhosted.org/packages/fd/a8/642aa566ae3d29b5fe7c6e245e0621e812ba7b9099ec7c137ddf7c9422c9/daemonpy-2.0.3.tar.gz",
    "platform": "any",
    "description": "<img align=\"right\" src=\"https://raw.githubusercontent.com/vroncevic/daemonpy/dev/docs/daemonpy_logo.png\" width=\"25%\">\n\n# Creating Daemon process\n\n**daemonpy** is package for creating Daemon processes.\n\nDeveloped in **[python](https://www.python.org/)** code: **100%**.\n\nThe README is used to introduce the modules and provide instructions on\nhow to install the modules, any machine dependencies it may have and any\nother information that should be provided before the modules are installed.\n\n[![daemonpy python checker](https://github.com/vroncevic/daemonpy/actions/workflows/daemonpy_python_checker.yml/badge.svg)](https://github.com/vroncevic/daemonpy/actions/workflows/daemonpy_python_checker.yml) [![daemonpy package checker](https://github.com/vroncevic/daemonpy/actions/workflows/daemonpy_package_checker.yml/badge.svg)](https://github.com/vroncevic/daemonpy/actions/workflows/daemonpy_package.yml) [![GitHub issues open](https://img.shields.io/github/issues/vroncevic/daemonpy.svg)](https://github.com/vroncevic/daemonpy/issues) [![GitHub contributors](https://img.shields.io/github/contributors/vroncevic/daemonpy.svg)](https://github.com/vroncevic/daemonpy/graphs/contributors)\n\n<!-- START doctoc generated TOC please keep comment here to allow auto update -->\n<!-- DON'T EDIT THIS SECTION, INSTEAD RE-RUN doctoc TO UPDATE -->\n**Table of Contents**\n\n- [Installation](#installation)\n    - [Install using pip](#install-using-pip)\n    - [Install using build](#install-using-build)\n    - [Install using py setup](#install-using-py-setup)\n    - [Install using docker](#install-using-docker)\n- [Usage](#usage)\n- [Dependencies](#dependencies)\n- [Package structure](#package-structure)\n- [Docs](#docs)\n- [Copyright and Licence](#copyright-and-licence)\n\n<!-- END doctoc generated TOC please keep comment here to allow auto update -->\n\n### Installation\n\nUsed next development environment\n\n![debian linux os](https://raw.githubusercontent.com/vroncevic/daemonpy/dev/docs/debtux.png)\n\n[![daemonpy python3 build](https://github.com/vroncevic/daemonpy/actions/workflows/daemonpy_python3_build.yml/badge.svg)](https://github.com/vroncevic/daemonpy/actions/workflows/daemonpy_python3_build.yml)\n\nCurrently there are three ways to install package\n* Install process based on using pip mechanism\n* Install process based on build mechanism\n* Install process based on setup.py mechanism\n* Install process based on docker mechanism\n\n##### Install using pip\n\nPython package is located at **[pypi.org](https://pypi.org/project/daemonpy/)**.\n\nYou can install by using pip\n\n```bash\n# python3\npip3 install daemonpy\n```\n\n##### Install using build\n\nNavigate to **[release page](https://github.com/vroncevic/daemonpy/releases)** download and extract release archive.\n\nTo install **daemonpy** type the following\n\n```bash\ntar xvzf daemonpy-x.y.z.tar.gz\ncd daemonpy-x.y.z\n# python3\npip3 install -r requirements.txt\npython3 -m build\npip3 install dist/daemonpy-x.y.z-py3-none-any.whl\n```\n\n##### Install using py setup\n\nNavigate to **[release page](https://github.com/vroncevic/daemonpy/releases)** download and extract release archive.\n\nTo install **daemonpy**, locate and run setup.py with arguments\n\n```bash\ntar xvzf daemonpy-x.y.z.tar.gz\ncd daemonpy-x.y.z\n# python3\npip3 install -r requirements.txt\npython3 setup.py install_lib\npython3 setup.py install_egg_info\n```\n\n##### Install using docker\n\nYou can use Dockerfile to create image/container.\n\n### Usage\n\nCreate short example\n```python\n#!/usr/bin/env python\n\n'''\n Module\n     mydaemon.py\n Copyright\n     Copyright (C) 2020 - 2024 Vladimir Roncevic <elektron.ronca@gmail.com>\n     mydaemon is free software: you can redistribute it and/or modify it\n     under the terms of the GNU General Public License as published by the\n     Free Software Foundation, either version 3 of the License, or\n     (at your option) any later version.\n     mydaemon is distributed in the hope that it will be useful, but\n     WITHOUT ANY WARRANTY; without even the implied warranty of\n     MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n     See the GNU General Public License for more details.\n     You should have received a copy of the GNU General Public License along\n     with this program. If not, see <http://www.gnu.org/licenses/>.\n Info\n     Defines class MyDaemon with attribute(s) and method(s).\n     Set an operation for Daemon process.\n'''\n\nimport sys\nfrom time import sleep\n\ntry:\n    from daemonpy import Daemon\nexcept ImportError as ats_error:\n    MESSAGE = '\\n{0}\\n{1}\\n'.format(__file__, ats_error)\n    sys.exit(MESSAGE)  # Force close python ATS ##############################\n\n\nclass MyDaemon(Daemon):\n    '''\n        Defines class MyDaemon with attribute(s) and method(s).\n        Set an operation for Daemon process.\n        It defines:\n\n            :attributes:\n                | None\n            :methods:\n                | run - run Daemon process (defined method).\n    '''\n\n    def run(self):\n        '''\n            Run Daemon process with time sleep example.\n\n            :exceptions: None\n        '''\n        while True:\n            sleep(1)\n\nif __name__ == '__main__':\n    DAEMON = MyDaemon('/tmp/daemon-example.pid')\n    DAEMON.usage(sys.argv[1])\n```\n\n### Dependencies\n\nThese modules requires other modules and libraries\n* [daemonpy - Python App/Tool/Script Utilities](https://pypi.org/project/daemonpy/)\n\n### Package structure\n\n**daemonpy** is based on OOP.\n\nPackage structure\n\n```bash\n    daemonpy/\n        \u251c\u2500\u2500 daemon_usage.py\n        \u251c\u2500\u2500 file_descriptor.py\n        \u251c\u2500\u2500 file_process_id.py\n        \u251c\u2500\u2500 __init__.py\n        \u2514\u2500\u2500 unix_operations.py\n```\n\n### Docs\n\n[![Documentation Status](https://readthedocs.org/projects/daemonpy/badge/?version=latest)](https://daemonpy.readthedocs.io/en/latest/?badge=latest)\n\nMore documentation and info at\n\n* [daemonpy.readthedocs.io](https://daemonpy.readthedocs.io)\n* [www.python.org](https://www.python.org/)\n\n### Contributing\n\n[Contributing to daemonpy](CONTRIBUTING.md)\n\n### Copyright and licence\n\n[![License: GPL v3](https://img.shields.io/badge/License-GPLv3-blue.svg)](https://www.gnu.org/licenses/gpl-3.0) [![License](https://img.shields.io/badge/License-Apache%202.0-blue.svg)](https://opensource.org/licenses/Apache-2.0)\n\nCopyright (C) 2020 - 2024 by [vroncevic.github.io/daemonpy](https://vroncevic.github.io/daemonpy/)\n\n**daemonpy** is free software; you can redistribute it and/or modify\nit under the same terms as Python itself, either Python version 2.x/3.x or,\nat your option, any later version of Python 3 you may have available.\n\nLets help and support PSF.\n\n[![Python Software Foundation](https://raw.githubusercontent.com/vroncevic/daemonpy/dev/docs/psf-logo-alpha.png)](https://www.python.org/psf/)\n\n[![Donate](https://www.paypalobjects.com/en_US/i/btn/btn_donateCC_LG.gif)](https://www.python.org/psf/donations/)\n",
    "bugtrack_url": null,
    "license": "GPL 2024 Free software to use and distributed it.",
    "summary": "Creating Daemon process",
    "version": "2.0.3",
    "project_urls": {
        "Homepage": "https://vroncevic.github.io/daemonpy/"
    },
    "split_keywords": [
        "unix",
        "linux",
        "daemon",
        "process"
    ],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "9e85f30d31056f1e13585610d3ac57edfcd4ba2ba7938c80f1e6ec8cb94eea36",
                "md5": "83729957b62226cc6cc8f5280375ad70",
                "sha256": "da974eca5d578c7a805ce59c5585d7c9a1b8f28ebaced5c9dc28b306e4f9ad86"
            },
            "downloads": -1,
            "filename": "daemonpy-2.0.3-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "83729957b62226cc6cc8f5280375ad70",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": ">=3.10",
            "size": 26227,
            "upload_time": "2024-01-06T18:44:16",
            "upload_time_iso_8601": "2024-01-06T18:44:16.234831Z",
            "url": "https://files.pythonhosted.org/packages/9e/85/f30d31056f1e13585610d3ac57edfcd4ba2ba7938c80f1e6ec8cb94eea36/daemonpy-2.0.3-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "fda8642aa566ae3d29b5fe7c6e245e0621e812ba7b9099ec7c137ddf7c9422c9",
                "md5": "29f3f9c95b9b3964e3b165143f49f0fe",
                "sha256": "29ec128a4ee2c81646fba752d8ec8dc9a5387a12e0901ad57479a355c1bdb27e"
            },
            "downloads": -1,
            "filename": "daemonpy-2.0.3.tar.gz",
            "has_sig": false,
            "md5_digest": "29f3f9c95b9b3964e3b165143f49f0fe",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": ">=3.10",
            "size": 22950,
            "upload_time": "2024-01-06T18:44:18",
            "upload_time_iso_8601": "2024-01-06T18:44:18.047523Z",
            "url": "https://files.pythonhosted.org/packages/fd/a8/642aa566ae3d29b5fe7c6e245e0621e812ba7b9099ec7c137ddf7c9422c9/daemonpy-2.0.3.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2024-01-06 18:44:18",
    "github": false,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "lcname": "daemonpy"
}
        
Elapsed time: 0.20471s