pytoolbox


Namepytoolbox JSON
Version 14.8.2 PyPI version JSON
download
home_pagehttps://github.com/davidfischer-ch/pytoolbox
SummaryToolbox for Python scripts
upload_time2024-04-03 10:21:58
maintainerNone
docs_urlNone
authorDavid Fischer
requires_python>=3.11
licenseEUPL 1.1
keywords celery ffmpeg django flask json juju mock pillow rsync rtp selenium smpte 2022-1 screen subprocess
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage
            =========
Pytoolbox
=========

.. image:: https://badge.fury.io/py/pytoolbox.png
   :target: http://badge.fury.io/py/pytoolbox

.. image:: https://github.com/davidfischer-ch/pytoolbox/actions/workflows/python-package.yml/badge.svg
   :target: https://github.com/davidfischer-ch/pytoolbox

.. image:: https://coveralls.io/repos/davidfischer-ch/pytoolbox/badge.png
   :target: https://coveralls.io/r/davidfischer-ch/pytoolbox

Afraid of red status ? Please click on the link, sometimes this is not my fault ;-)

This module is a Toolbox for Python scripts.

Documentation: https://pytoolbox.readthedocs.org

Repository: https://github.com/davidfischer-ch/pytoolbox

This library supports Python 3.11 and more recent.

------------------------------------
What the release number stands for ?
------------------------------------

I do my best to follow this interesting recommendation : `Semantic Versioning 2.0.0 <http://semver.org/>`_

-------------------
How to install it ?
-------------------

Install some packages that are not handled by pip::

    $ sudo apt install liblzma-dev libxml2-dev libxslt-dev libyaml-dev libz-dev
    $ sudo apt install ffmpeg git-core python3-dev python3-gi python3-pip screen

If planning to use the `imaging` extra, especially the `exif` classes, then you'll have to install::

    $ sudo apt install libcairo2 libcairo2-dev libexiv2-dev libgexiv2-dev libgirepository1.0-dev

The gir1.2-gexiv2-0.10 should also be installed, maybe its already the case.

You may find useful to read `PyGObject's documentation <https://pygobject.readthedocs.io/en/latest/getting_started.html>`_.

If planning to use the vision feature, then you have to install some requirements for dlib::

    $ sudo apt install build-essential cmake pkg-config

See https://learnopencv.com/install-dlib-on-ubuntu/ for an up-to-date procedure.

Make sure that pip is up-to-date (PIPception)::

    $ source /some/python3/venv/bin/active
    $ pip install --upgrade pip setuptools wheel

Then, you only need to run ``setup.py``::

    $ source /some/python3/venv/bin/activate
    $ pip install .

--------------------------------
How to enable features/modules ?
--------------------------------

Example::

    $ python setup.py install --help

    Common commands: (see '--help-commands' for more)

      setup.py build      will build the package underneath 'build/'
      setup.py install    will install the package

    Global options:
      --verbose (-v)  run verbosely (default)
      --quiet (-q)    run quietly (turns verbosity off)
      --dry-run (-n)  don't actually do anything
      --help (-h)     show detailed help message
      --no-user-cfg   ignore pydistutils.cfg in your home directory

    Options for 'WithExtra' command:
      ...
      --extra-all                          Install dependencies for All Modules.
      --extra-atlassian                    Install dependencies for Atlassian.
      --extra-aws                          Install dependencies for AWS.
      --extra-django                       Install dependencies for Django.
      --extra-django-filter                Install dependencies for Django Filter.
      --extra-django-formtools             Install dependencies for Django Form Tools.
      --extra-flask                        Install dependencies for Flask.
      --extra-imaging                      Install dependencies for Imaging.
      --extra-jinja2                       Install dependencies for Jinja2.
      --extra-mongodb                      Install dependencies for MongoDB.
      --extra-network                      Install dependencies for Networking.
      --extra-pandas                       Install dependencies for Pandas.
      --extra-rest-framework               Install dependencies for Django REST Framework.
      --extra-selenium                     Install dependencies for Selenium.
      --extra-smpte2022                    Install dependencies for SMPTE-2022.
      --extra-unittest                     Install dependencies for Unit Test.
      --extra-vision                       Install dependencies for Vision.
      --extra-voluptuous                   Install dependencies for Voluptuous.
      --extra-doc                          Install dependencies for Pytoolbox Docs.
      --extra-test                         Install dependencies for Pytoolbox Tests.

    usage: setup.py [global_opts] cmd1 [cmd1_opts] [cmd2 [cmd2_opts] ...]
       or: setup.py --help [cmd1 cmd2 ...]
       or: setup.py --help-commands
       or: setup.py cmd --help


    $ python setup.py install --extra-smpte2022

Another way to do this, with ``pip``::

    $ pip install -e .[django,flask,mongo,smpte2022]

-----------------------
How to check coverage ?
-----------------------

::

    $ source /some/python3/venv/bin/activate
    $ pip install -e .[all,test]
    $ flake8 pytoolbox
    $ pytest
    $ xdg-open htmlcov/index.html

Remarks:

* All Django related modules are excluded from tests!
* However I am using them with Django 1.8 up to 3.1.0.

---------------
How to use it ?
---------------

Here is an example ``hello.py`` using the cmd function provided by ``pytoolbox``::

    $ from pytoolbox.subprocess import cmd
    $ print(cmd('echo Hello World!')['stdout'])

-------------------------------
How to generate documentation ?
-------------------------------

The documentation is generated by `Sphinx <http://sphinx-doc.org/ext/autodoc.html>`_.
In fact most of this documentation is extracted from the docstrings of the code.

Here is the procedure::

    $ source /some/python3/venv/bin/activate
    $ pip install -e .[docs]
    $ xdg-open docs/build/html/index.html

-------------------------------------------------
How to add it to dependencies of my own project ?
-------------------------------------------------

Here is an example ``setup.py`` for a project called *my-cool-project*::

	from setuptools import setup

	setup(
      name='my-cool-project',
		  version='0.8',
		  author='Firstname Lastname',
		  author_email='author@something.com',
		  install_requires=['...', 'pytoolbox>=14<15', '...'],
		  tests_require=['...', 'pytest', '...'],
		  license='GPLv3',
		  url='https://github.com/nickname/my-cool-project',
		  packages=['my_cool_project'])


See `pip vcs support <http://www.pip-installer.org/en/latest/logic.html#vcs-support>`_ to get further details about this.

You also need to install ``git-core``, but it is probably already the case, at least on your development computer ;-)

2012 - 2024 David Fischer

            

Raw data

            {
    "_id": null,
    "home_page": "https://github.com/davidfischer-ch/pytoolbox",
    "name": "pytoolbox",
    "maintainer": null,
    "docs_url": null,
    "requires_python": ">=3.11",
    "maintainer_email": null,
    "keywords": "celery, ffmpeg, django, flask, json, juju, mock, pillow, rsync, rtp, selenium, smpte 2022-1, screen, subprocess",
    "author": "David Fischer",
    "author_email": "david@fisch3r.net",
    "download_url": "https://files.pythonhosted.org/packages/84/0f/7fda785a865e99038601f575b368cbcb6125d7055bc6244338b576b77041/pytoolbox-14.8.2.tar.gz",
    "platform": null,
    "description": "=========\nPytoolbox\n=========\n\n.. image:: https://badge.fury.io/py/pytoolbox.png\n   :target: http://badge.fury.io/py/pytoolbox\n\n.. image:: https://github.com/davidfischer-ch/pytoolbox/actions/workflows/python-package.yml/badge.svg\n   :target: https://github.com/davidfischer-ch/pytoolbox\n\n.. image:: https://coveralls.io/repos/davidfischer-ch/pytoolbox/badge.png\n   :target: https://coveralls.io/r/davidfischer-ch/pytoolbox\n\nAfraid of red status ? Please click on the link, sometimes this is not my fault ;-)\n\nThis module is a Toolbox for Python scripts.\n\nDocumentation: https://pytoolbox.readthedocs.org\n\nRepository: https://github.com/davidfischer-ch/pytoolbox\n\nThis library supports Python 3.11 and more recent.\n\n------------------------------------\nWhat the release number stands for ?\n------------------------------------\n\nI do my best to follow this interesting recommendation : `Semantic Versioning 2.0.0 <http://semver.org/>`_\n\n-------------------\nHow to install it ?\n-------------------\n\nInstall some packages that are not handled by pip::\n\n    $ sudo apt install liblzma-dev libxml2-dev libxslt-dev libyaml-dev libz-dev\n    $ sudo apt install ffmpeg git-core python3-dev python3-gi python3-pip screen\n\nIf planning to use the `imaging` extra, especially the `exif` classes, then you'll have to install::\n\n    $ sudo apt install libcairo2 libcairo2-dev libexiv2-dev libgexiv2-dev libgirepository1.0-dev\n\nThe gir1.2-gexiv2-0.10 should also be installed, maybe its already the case.\n\nYou may find useful to read `PyGObject's documentation <https://pygobject.readthedocs.io/en/latest/getting_started.html>`_.\n\nIf planning to use the vision feature, then you have to install some requirements for dlib::\n\n    $ sudo apt install build-essential cmake pkg-config\n\nSee https://learnopencv.com/install-dlib-on-ubuntu/ for an up-to-date procedure.\n\nMake sure that pip is up-to-date (PIPception)::\n\n    $ source /some/python3/venv/bin/active\n    $ pip install --upgrade pip setuptools wheel\n\nThen, you only need to run ``setup.py``::\n\n    $ source /some/python3/venv/bin/activate\n    $ pip install .\n\n--------------------------------\nHow to enable features/modules ?\n--------------------------------\n\nExample::\n\n    $ python setup.py install --help\n\n    Common commands: (see '--help-commands' for more)\n\n      setup.py build      will build the package underneath 'build/'\n      setup.py install    will install the package\n\n    Global options:\n      --verbose (-v)  run verbosely (default)\n      --quiet (-q)    run quietly (turns verbosity off)\n      --dry-run (-n)  don't actually do anything\n      --help (-h)     show detailed help message\n      --no-user-cfg   ignore pydistutils.cfg in your home directory\n\n    Options for 'WithExtra' command:\n      ...\n      --extra-all                          Install dependencies for All Modules.\n      --extra-atlassian                    Install dependencies for Atlassian.\n      --extra-aws                          Install dependencies for AWS.\n      --extra-django                       Install dependencies for Django.\n      --extra-django-filter                Install dependencies for Django Filter.\n      --extra-django-formtools             Install dependencies for Django Form Tools.\n      --extra-flask                        Install dependencies for Flask.\n      --extra-imaging                      Install dependencies for Imaging.\n      --extra-jinja2                       Install dependencies for Jinja2.\n      --extra-mongodb                      Install dependencies for MongoDB.\n      --extra-network                      Install dependencies for Networking.\n      --extra-pandas                       Install dependencies for Pandas.\n      --extra-rest-framework               Install dependencies for Django REST Framework.\n      --extra-selenium                     Install dependencies for Selenium.\n      --extra-smpte2022                    Install dependencies for SMPTE-2022.\n      --extra-unittest                     Install dependencies for Unit Test.\n      --extra-vision                       Install dependencies for Vision.\n      --extra-voluptuous                   Install dependencies for Voluptuous.\n      --extra-doc                          Install dependencies for Pytoolbox Docs.\n      --extra-test                         Install dependencies for Pytoolbox Tests.\n\n    usage: setup.py [global_opts] cmd1 [cmd1_opts] [cmd2 [cmd2_opts] ...]\n       or: setup.py --help [cmd1 cmd2 ...]\n       or: setup.py --help-commands\n       or: setup.py cmd --help\n\n\n    $ python setup.py install --extra-smpte2022\n\nAnother way to do this, with ``pip``::\n\n    $ pip install -e .[django,flask,mongo,smpte2022]\n\n-----------------------\nHow to check coverage ?\n-----------------------\n\n::\n\n    $ source /some/python3/venv/bin/activate\n    $ pip install -e .[all,test]\n    $ flake8 pytoolbox\n    $ pytest\n    $ xdg-open htmlcov/index.html\n\nRemarks:\n\n* All Django related modules are excluded from tests!\n* However I am using them with Django 1.8 up to 3.1.0.\n\n---------------\nHow to use it ?\n---------------\n\nHere is an example ``hello.py`` using the cmd function provided by ``pytoolbox``::\n\n    $ from pytoolbox.subprocess import cmd\n    $ print(cmd('echo Hello World!')['stdout'])\n\n-------------------------------\nHow to generate documentation ?\n-------------------------------\n\nThe documentation is generated by `Sphinx <http://sphinx-doc.org/ext/autodoc.html>`_.\nIn fact most of this documentation is extracted from the docstrings of the code.\n\nHere is the procedure::\n\n    $ source /some/python3/venv/bin/activate\n    $ pip install -e .[docs]\n    $ xdg-open docs/build/html/index.html\n\n-------------------------------------------------\nHow to add it to dependencies of my own project ?\n-------------------------------------------------\n\nHere is an example ``setup.py`` for a project called *my-cool-project*::\n\n\tfrom setuptools import setup\n\n\tsetup(\n      name='my-cool-project',\n\t\t  version='0.8',\n\t\t  author='Firstname Lastname',\n\t\t  author_email='author@something.com',\n\t\t  install_requires=['...', 'pytoolbox>=14<15', '...'],\n\t\t  tests_require=['...', 'pytest', '...'],\n\t\t  license='GPLv3',\n\t\t  url='https://github.com/nickname/my-cool-project',\n\t\t  packages=['my_cool_project'])\n\n\nSee `pip vcs support <http://www.pip-installer.org/en/latest/logic.html#vcs-support>`_ to get further details about this.\n\nYou also need to install ``git-core``, but it is probably already the case, at least on your development computer ;-)\n\n2012 - 2024 David Fischer\n",
    "bugtrack_url": null,
    "license": "EUPL 1.1",
    "summary": "Toolbox for Python scripts",
    "version": "14.8.2",
    "project_urls": {
        "Homepage": "https://github.com/davidfischer-ch/pytoolbox"
    },
    "split_keywords": [
        "celery",
        " ffmpeg",
        " django",
        " flask",
        " json",
        " juju",
        " mock",
        " pillow",
        " rsync",
        " rtp",
        " selenium",
        " smpte 2022-1",
        " screen",
        " subprocess"
    ],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "dc133dce64332e9c9a28c1f22b496f9281ba5acc475bfd9a0d9e2e41c521f6fa",
                "md5": "7ef787902e6492bce3555208b94a00da",
                "sha256": "a3484e7447c0072bc9cfe3eada8ee9083aea803c5fa4589556d6c64eb084f459"
            },
            "downloads": -1,
            "filename": "pytoolbox-14.8.2-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "7ef787902e6492bce3555208b94a00da",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": ">=3.11",
            "size": 187280,
            "upload_time": "2024-04-03T10:21:55",
            "upload_time_iso_8601": "2024-04-03T10:21:55.645928Z",
            "url": "https://files.pythonhosted.org/packages/dc/13/3dce64332e9c9a28c1f22b496f9281ba5acc475bfd9a0d9e2e41c521f6fa/pytoolbox-14.8.2-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "840f7fda785a865e99038601f575b368cbcb6125d7055bc6244338b576b77041",
                "md5": "a729e6b5dfe27812579a2a4a0bbbfb3e",
                "sha256": "81ded789c1adc0b94823df1c587fcf557d17c58fbe265db38afebb656684d6ea"
            },
            "downloads": -1,
            "filename": "pytoolbox-14.8.2.tar.gz",
            "has_sig": false,
            "md5_digest": "a729e6b5dfe27812579a2a4a0bbbfb3e",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": ">=3.11",
            "size": 180382,
            "upload_time": "2024-04-03T10:21:58",
            "upload_time_iso_8601": "2024-04-03T10:21:58.083462Z",
            "url": "https://files.pythonhosted.org/packages/84/0f/7fda785a865e99038601f575b368cbcb6125d7055bc6244338b576b77041/pytoolbox-14.8.2.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2024-04-03 10:21:58",
    "github": true,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "github_user": "davidfischer-ch",
    "github_project": "pytoolbox",
    "travis_ci": false,
    "coveralls": true,
    "github_actions": true,
    "lcname": "pytoolbox"
}
        
Elapsed time: 0.23270s