m9g


Namem9g JSON
Version 0.0.6 PyPI version JSON
download
home_pagehttps://github.com/radiocutfm/m9g
SummaryDefine models for communication between components, handling MarshallinG (m9g)
upload_time2021-04-27 20:52:30
maintainer
docs_urlNone
authorLambda Sistemas
requires_python>=2.7, !=3.0.*, !=3.1.*, !=3.2.*, !=3.3.*, !=3.4.*, !=3.5.*, <4
license
keywords marshalling serialize communication model
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage No coveralls.
            ![Build Status](https://github.com/radiocutfm/m9g/workflows/Run%20tests/badge.svg)

## m9g : Define models for communication between components, handling MarshallinG (m9g)

### Usage


```python
import m9g
class Book(m9g.Model):
    id = m9g.IntField(pk=True)
    author = m9g.StringField()

book = Book(id=1, author="Hemingway")
book.serialize()  # JSON as default
'{"id": 1, "author": "Hemingway"}'
```


#### Complex types

```python
import datetime

class Author(m9g.Model):
    id = m9g.IntField(pk=True)
    authored_books = m9g.ListField(
            m9g.StringField()
    )
    birth_date = m9g.DateField()

author = Author(
    id=1,
    authored_books=[
            "The Torrents of Spring",
            "The Sun Also Raises",
            "A Farewell To Arms"
    ],
    birth_date = datetime.date(
            year=1899,
            month=7,
            day=21
    )
)
author.serialize()
'{"id": 1, "authored_books": ["The Torrents of Spring", "The Sun Also Raises", "A Farewell To Arms"], "birth_date": "1899-07-21"}'

```


## Contributing

### Run tests for python 2.7 / 3.6

```shell
    tox
```

### Run one-off test

```shell
    tox -- tests/<test_file>.py::<test_name>
```



            

Raw data

            {
    "_id": null,
    "home_page": "https://github.com/radiocutfm/m9g",
    "name": "m9g",
    "maintainer": "",
    "docs_url": null,
    "requires_python": ">=2.7, !=3.0.*, !=3.1.*, !=3.2.*, !=3.3.*, !=3.4.*, !=3.5.*, <4",
    "maintainer_email": "",
    "keywords": "marshalling serialize communication model",
    "author": "Lambda Sistemas",
    "author_email": "desarrollo@lambdasistemas.com.ar",
    "download_url": "https://files.pythonhosted.org/packages/7c/ef/2759126e10d442a650d182190382a34a134874e453dd7cd62a3ae54e4d90/m9g-0.0.6.tar.gz",
    "platform": "",
    "description": "![Build Status](https://github.com/radiocutfm/m9g/workflows/Run%20tests/badge.svg)\n\n## m9g : Define models for communication between components, handling MarshallinG (m9g)\n\n### Usage\n\n\n```python\nimport m9g\nclass Book(m9g.Model):\n    id = m9g.IntField(pk=True)\n    author = m9g.StringField()\n\nbook = Book(id=1, author=\"Hemingway\")\nbook.serialize()  # JSON as default\n'{\"id\": 1, \"author\": \"Hemingway\"}'\n```\n\n\n#### Complex types\n\n```python\nimport datetime\n\nclass Author(m9g.Model):\n    id = m9g.IntField(pk=True)\n    authored_books = m9g.ListField(\n            m9g.StringField()\n    )\n    birth_date = m9g.DateField()\n\nauthor = Author(\n    id=1,\n    authored_books=[\n            \"The Torrents of Spring\",\n            \"The Sun Also Raises\",\n            \"A Farewell To Arms\"\n    ],\n    birth_date = datetime.date(\n            year=1899,\n            month=7,\n            day=21\n    )\n)\nauthor.serialize()\n'{\"id\": 1, \"authored_books\": [\"The Torrents of Spring\", \"The Sun Also Raises\", \"A Farewell To Arms\"], \"birth_date\": \"1899-07-21\"}'\n\n```\n\n\n## Contributing\n\n### Run tests for python 2.7 / 3.6\n\n```shell\n    tox\n```\n\n### Run one-off test\n\n```shell\n    tox -- tests/<test_file>.py::<test_name>\n```\n\n\n",
    "bugtrack_url": null,
    "license": "",
    "summary": "Define models for communication between components, handling MarshallinG (m9g)",
    "version": "0.0.6",
    "split_keywords": [
        "marshalling",
        "serialize",
        "communication",
        "model"
    ],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "md5": "6cd1b8e4f23f0a7ad02bcea3d8d6242f",
                "sha256": "a770eca08017adb68f913b9978dd9fd77950ab0d28f1172f244d44de46f81e32"
            },
            "downloads": -1,
            "filename": "m9g-0.0.6-py2.py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "6cd1b8e4f23f0a7ad02bcea3d8d6242f",
            "packagetype": "bdist_wheel",
            "python_version": "py2.py3",
            "requires_python": ">=2.7, !=3.0.*, !=3.1.*, !=3.2.*, !=3.3.*, !=3.4.*, !=3.5.*, <4",
            "size": 21138,
            "upload_time": "2021-04-27T20:52:29",
            "upload_time_iso_8601": "2021-04-27T20:52:29.045152Z",
            "url": "https://files.pythonhosted.org/packages/4e/1a/6d9e5c4875ad4e6141cbd7412f6eff5861e1bbba5d70bc9727ee9bd3ad29/m9g-0.0.6-py2.py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "md5": "37e239591fea37ca997d23db61ec5988",
                "sha256": "087b1e0f0beb12b9c514aed4d6df94cfdc1e57a5a5105d560b01455c89ed5a7d"
            },
            "downloads": -1,
            "filename": "m9g-0.0.6.tar.gz",
            "has_sig": false,
            "md5_digest": "37e239591fea37ca997d23db61ec5988",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": ">=2.7, !=3.0.*, !=3.1.*, !=3.2.*, !=3.3.*, !=3.4.*, !=3.5.*, <4",
            "size": 22697,
            "upload_time": "2021-04-27T20:52:30",
            "upload_time_iso_8601": "2021-04-27T20:52:30.861767Z",
            "url": "https://files.pythonhosted.org/packages/7c/ef/2759126e10d442a650d182190382a34a134874e453dd7cd62a3ae54e4d90/m9g-0.0.6.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2021-04-27 20:52:30",
    "github": true,
    "gitlab": false,
    "bitbucket": false,
    "github_user": "radiocutfm",
    "github_project": "m9g",
    "lcname": "m9g"
}
        
Elapsed time: 0.02080s