dtypes


Namedtypes JSON
Version 0.0.1 PyPI version JSON
download
home_pagehttps://github.com/DrInfiniteExplorer/dtypes
Summaryctypes but usable
upload_time2022-05-22 16:17:02
maintainer
docs_urlNone
authorPierre LeMoine
requires_python>=3.6
license
keywords
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage No coveralls.
            # dtypes

Yo yo what's this?

Well it's ✨`dtypes`✨ which is extra stuff to make `ctypes` usable. Or as the my future kids like to say, _"`dtypes` is on `ctypes` like butter is on toast"_.

Who wants to do

```py
class Yolo(ctypes.structure):
    _fields_ = [
        ("a", ctypes.c_int),
        ("b", ctypes.c_float),
        ("c", ctypes.c_double),
    ]
```

when you can do

```py
from dtypes.structify import structify

@structify
class Yolo(ctypes.structure):
    a : ctypes.c_int
    b : ctypes.c_float
    c : ctypes.c_double
```

And then, who wants to deal with the messy and incomplete way of working with forward declarations in pure ctypes?

```py
class Yeet(ctypes.structure):
    pass

class Chonko(ctypes.structure):
    _fields_ = [
        ("yeet", ctypes.POINTER(Yeet)),
    ]

Yeet._fields_ =[
    ("chonker", Chonko),
    ("this", ctypes.POINTER(Yeet),
]
```

when you can do

```py

from dtypes.structify import structify
from dtypes.fwd import fwd, ThisPtr, Pointer

Yeet = fwd()

@structify
class Chonko(ctypes.structure):
    yeet : Pointer(Yeet)

@structify
class Yeet(ctypes.structure, Yeet):
    chonker : Chonko
    this    : ThisPtr
]
```


            

Raw data

            {
    "_id": null,
    "home_page": "https://github.com/DrInfiniteExplorer/dtypes",
    "name": "dtypes",
    "maintainer": "",
    "docs_url": null,
    "requires_python": ">=3.6",
    "maintainer_email": "",
    "keywords": "",
    "author": "Pierre LeMoine",
    "author_email": "pypi@luben.se",
    "download_url": "https://files.pythonhosted.org/packages/a1/54/49fffeed2831b2c78cad1efd6abf4e06e0af85ffb365bb6e0bc380e2db73/dtypes-0.0.1.tar.gz",
    "platform": null,
    "description": "# dtypes\n\nYo yo what's this?\n\nWell it's \u2728`dtypes`\u2728 which is extra stuff to make `ctypes` usable. Or as the my future kids like to say, _\"`dtypes` is on `ctypes` like butter is on toast\"_.\n\nWho wants to do\n\n```py\nclass Yolo(ctypes.structure):\n    _fields_ = [\n        (\"a\", ctypes.c_int),\n        (\"b\", ctypes.c_float),\n        (\"c\", ctypes.c_double),\n    ]\n```\n\nwhen you can do\n\n```py\nfrom dtypes.structify import structify\n\n@structify\nclass Yolo(ctypes.structure):\n    a : ctypes.c_int\n    b : ctypes.c_float\n    c : ctypes.c_double\n```\n\nAnd then, who wants to deal with the messy and incomplete way of working with forward declarations in pure ctypes?\n\n```py\nclass Yeet(ctypes.structure):\n    pass\n\nclass Chonko(ctypes.structure):\n    _fields_ = [\n        (\"yeet\", ctypes.POINTER(Yeet)),\n    ]\n\nYeet._fields_ =[\n    (\"chonker\", Chonko),\n    (\"this\", ctypes.POINTER(Yeet),\n]\n```\n\nwhen you can do\n\n```py\n\nfrom dtypes.structify import structify\nfrom dtypes.fwd import fwd, ThisPtr, Pointer\n\nYeet = fwd()\n\n@structify\nclass Chonko(ctypes.structure):\n    yeet : Pointer(Yeet)\n\n@structify\nclass Yeet(ctypes.structure, Yeet):\n    chonker : Chonko\n    this    : ThisPtr\n]\n```\n\n",
    "bugtrack_url": null,
    "license": "",
    "summary": "ctypes but usable",
    "version": "0.0.1",
    "project_urls": {
        "Homepage": "https://github.com/DrInfiniteExplorer/dtypes",
        "clickbait": "https://bit.ly/3qS8UTo"
    },
    "split_keywords": [],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "09a6397d3b1e0e4ece7e614f7dacbed33b6dd2afc4c06554954d42b60b08d262",
                "md5": "083d3bd78c6661a1853e8bcda609c0e1",
                "sha256": "469d6f7a9fbaf733adae589142e2311077dc870687867f72b1d36d11d718d649"
            },
            "downloads": -1,
            "filename": "dtypes-0.0.1-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "083d3bd78c6661a1853e8bcda609c0e1",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": ">=3.6",
            "size": 7323,
            "upload_time": "2022-05-22T16:17:01",
            "upload_time_iso_8601": "2022-05-22T16:17:01.080386Z",
            "url": "https://files.pythonhosted.org/packages/09/a6/397d3b1e0e4ece7e614f7dacbed33b6dd2afc4c06554954d42b60b08d262/dtypes-0.0.1-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "a15449fffeed2831b2c78cad1efd6abf4e06e0af85ffb365bb6e0bc380e2db73",
                "md5": "168292bf34d488eb28beb28e002d7eb8",
                "sha256": "8f437ffb69605301a68adec6327e165e8c53892bfb13734b4a5f5b123bdab391"
            },
            "downloads": -1,
            "filename": "dtypes-0.0.1.tar.gz",
            "has_sig": false,
            "md5_digest": "168292bf34d488eb28beb28e002d7eb8",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": ">=3.6",
            "size": 6356,
            "upload_time": "2022-05-22T16:17:02",
            "upload_time_iso_8601": "2022-05-22T16:17:02.536791Z",
            "url": "https://files.pythonhosted.org/packages/a1/54/49fffeed2831b2c78cad1efd6abf4e06e0af85ffb365bb6e0bc380e2db73/dtypes-0.0.1.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2022-05-22 16:17:02",
    "github": true,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "github_user": "DrInfiniteExplorer",
    "github_project": "dtypes",
    "travis_ci": false,
    "coveralls": false,
    "github_actions": true,
    "lcname": "dtypes"
}
        
Elapsed time: 0.24941s