cpp-uuid


Namecpp-uuid JSON
Version 1.0.1 PyPI version JSON
download
home_page
SummaryPython UUID module written in C++
upload_time2023-12-19 13:35:23
maintainer
docs_urlNone
author
requires_python>=3.8
licenseMIT License Copyright (c) 2023 Dmitriy Makeev Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
keywords python3 fast uuid uuid4 c++ cpp
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage No coveralls.
            Fast python UUID module written in C++
########################################################

.. image:: https://github.com/DmitriyMakeev/cpp_uuid/actions/workflows/build.yml/badge.svg?branch=main
  :alt: Build status

``cpp_uuid`` is a Python library written in ``C++``.
It provides an API that, in most cases, covers usage of Python's builtin ``UUID`` class.
The library implements generate, convert to string and parse UUIDs version 4.
It is also possible to convert UUIDs from ``uuid`` standard or compare between them.

In most cases you can just replace import section of your code.

.. code-block:: python

    from cpp_uuid import UUID, uuid4

    item_uuid = uuid4()
    other_uuid = UUID('c5fcf05c-6320-47ec-98c0-be84fdb1c321')

Module tested on Python versions from 3.8 to 3.12.

This library uses ``UUID4`` generation from `crashoz/uuid_v4 library <https://github.com/crashoz/uuid_v4>`_.


Benchmarks
""""""""""""""""""""""""""""""""""""""""""""""""""""""""

Performance comparisons were made with the standard ``uuid`` and the ``fastuuid`` library,
which is written in ``Rust``.

.. list-table:: Benchmark results (10 :sup:`6` times for each test)
   :width: 100%
   :widths: 40 20 20 20
   :header-rows: 1

   * -
     - ``uuid`` (ms)
     - ``fastuuid`` (ms)
     - ``cpp_uuid`` (ms)
   * - UUID from str
     - 1543
     - 251
     - 172
   * - UUID from bytes
     - 1112
     - 280
     - 381
   * - uuid4()
     - 2676
     - 1049
     - 131
   * - str(uuid)
     - 859
     - 229
     - 120
   * - uuid.bytes
     - 152
     - 134
     - 90
   * - hash(uuid)
     - 151
     - 104
     - 56
   * - compare UUIDs
     - 123
     - 68
     - 46

            

Raw data

            {
    "_id": null,
    "home_page": "",
    "name": "cpp-uuid",
    "maintainer": "",
    "docs_url": null,
    "requires_python": ">=3.8",
    "maintainer_email": "",
    "keywords": "python3,fast,uuid,uuid4,c++,cpp",
    "author": "",
    "author_email": "Dmitriy Makeev <makeev.dimitry@gmail.com>",
    "download_url": "https://files.pythonhosted.org/packages/33/72/1c5dcc44be3700090261552db1e4db36382722c5952e57f680c48b2ac5fa/cpp-uuid-1.0.1.tar.gz",
    "platform": null,
    "description": "Fast python UUID module written in C++\n########################################################\n\n.. image:: https://github.com/DmitriyMakeev/cpp_uuid/actions/workflows/build.yml/badge.svg?branch=main\n  :alt: Build status\n\n``cpp_uuid`` is a Python library written in ``C++``.\nIt provides an API that, in most cases, covers usage of Python's builtin ``UUID`` class.\nThe library implements generate, convert to string and parse UUIDs version 4.\nIt is also possible to convert UUIDs from ``uuid`` standard or compare between them.\n\nIn most cases you can just replace import section of your code.\n\n.. code-block:: python\n\n    from cpp_uuid import UUID, uuid4\n\n    item_uuid = uuid4()\n    other_uuid = UUID('c5fcf05c-6320-47ec-98c0-be84fdb1c321')\n\nModule tested on Python versions from 3.8 to 3.12.\n\nThis library uses ``UUID4`` generation from `crashoz/uuid_v4 library <https://github.com/crashoz/uuid_v4>`_.\n\n\nBenchmarks\n\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\n\nPerformance comparisons were made with the standard ``uuid`` and the ``fastuuid`` library,\nwhich is written in ``Rust``.\n\n.. list-table:: Benchmark results (10 :sup:`6` times for each test)\n   :width: 100%\n   :widths: 40 20 20 20\n   :header-rows: 1\n\n   * -\n     - ``uuid`` (ms)\n     - ``fastuuid`` (ms)\n     - ``cpp_uuid`` (ms)\n   * - UUID from str\n     - 1543\n     - 251\n     - 172\n   * - UUID from bytes\n     - 1112\n     - 280\n     - 381\n   * - uuid4()\n     - 2676\n     - 1049\n     - 131\n   * - str(uuid)\n     - 859\n     - 229\n     - 120\n   * - uuid.bytes\n     - 152\n     - 134\n     - 90\n   * - hash(uuid)\n     - 151\n     - 104\n     - 56\n   * - compare UUIDs\n     - 123\n     - 68\n     - 46\n",
    "bugtrack_url": null,
    "license": "MIT License  Copyright (c) 2023 Dmitriy Makeev  Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the \"Software\"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:  The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.  THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. ",
    "summary": "Python UUID module written in C++",
    "version": "1.0.1",
    "project_urls": {
        "Source": "https://github.com/DmitriyMakeev/cpp_uuid"
    },
    "split_keywords": [
        "python3",
        "fast",
        "uuid",
        "uuid4",
        "c++",
        "cpp"
    ],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "33721c5dcc44be3700090261552db1e4db36382722c5952e57f680c48b2ac5fa",
                "md5": "f201fc7a7ae070ddb8dd97c6b9dfdf30",
                "sha256": "71db9c479faaffd81efa91a2a8ad63ffb8f1f4ce6e584abb9dd48666846fc0cf"
            },
            "downloads": -1,
            "filename": "cpp-uuid-1.0.1.tar.gz",
            "has_sig": false,
            "md5_digest": "f201fc7a7ae070ddb8dd97c6b9dfdf30",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": ">=3.8",
            "size": 11176,
            "upload_time": "2023-12-19T13:35:23",
            "upload_time_iso_8601": "2023-12-19T13:35:23.873892Z",
            "url": "https://files.pythonhosted.org/packages/33/72/1c5dcc44be3700090261552db1e4db36382722c5952e57f680c48b2ac5fa/cpp-uuid-1.0.1.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2023-12-19 13:35:23",
    "github": true,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "github_user": "DmitriyMakeev",
    "github_project": "cpp_uuid",
    "travis_ci": false,
    "coveralls": false,
    "github_actions": true,
    "lcname": "cpp-uuid"
}
        
Elapsed time: 0.15408s