botlib


Namebotlib JSON
Version 202 PyPI version JSON
download
home_pagehttps://github.com/bthate/botlib
SummaryThe Python3 bot Namespace
upload_time2023-02-07 17:58:01
maintainer
docs_urlhttps://pythonhosted.org/botlib/
authorBart Thate
requires_python
licensePublic Domain
keywords
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage No coveralls.
            **NAME**


``BOTLIB`` - The Python3 ``bot`` Namespace


**DESCRIPTION**


``BOTLIB`` is a library providing the python3 ``bot`` namespace package. 

The bot package provides an Object class, that allows for save/load to/from
json files on disk. Objects can be searched with database functions and uses
read-only files to improve persistence and a type in filename for
reconstruction. Methods are factored out into functions to have a clean
namespace to read JSON data into.

``BOTLIB`` stores it's data on disk where objects are time versioned
and the last version saved on disk is served to the user layer. Files are JSON
dumps that are read-only so thus should provide (disk) persistence more chance.
Paths carry the type in the path name what makes reconstruction from filename
easier then reading type from the object.


**INSTALL**


install with pip or download from http://pypi.org/project/botlib:


``python3 -m pip install botlib``


**PROGRAMMING**


basic usage is this::

 >>> import bot
 >>> o = bot.Object()
 >>> o.key = "value"
 >>> o.key
 >>> 'value'

Objects try to mimic a dictionary while trying to be an object with normal
attribute access as well. hidden methods are provided, the methods are
factored out into functions like get, items, keys, register, set, update
and values.

load/save from/to disk::

 >>> from bot import Object, load, save
 >>> o = Object()
 >>> o.key = "value"
 >>> p = save(o)
 >>> obj = Object()
 >>> load(obj, p)
 >>> obj.key
 >>> 'value'

great for giving objects peristence by having their state stored in files::

 >>> from bot import Object, save
 >>> o = Object()
 >>> save(o)
 'bot.objects.Object/e71c9a1f456a4dcf813bb81d32c8e0f2/2021-08-31/15:31:05.717063'


**AUTHOR**


Bart Thate


**COPYRIGHT**


``BOTLIB`` is placed in the Public Domain.



            

Raw data

            {
    "_id": null,
    "home_page": "https://github.com/bthate/botlib",
    "name": "botlib",
    "maintainer": "",
    "docs_url": "https://pythonhosted.org/botlib/",
    "requires_python": "",
    "maintainer_email": "",
    "keywords": "",
    "author": "Bart Thate",
    "author_email": "bthate67@gmail.com",
    "download_url": "https://files.pythonhosted.org/packages/29/9b/17220f974c07c8ee92b0b6a39b91957c7dda525e14b5e3de85015af2c4a7/botlib-202.tar.gz",
    "platform": null,
    "description": "**NAME**\n\n\n``BOTLIB`` - The Python3 ``bot`` Namespace\n\n\n**DESCRIPTION**\n\n\n``BOTLIB`` is a library providing the python3 ``bot`` namespace package. \n\nThe bot package provides an Object class, that allows for save/load to/from\njson files on disk. Objects can be searched with database functions and uses\nread-only files to improve persistence and a type in filename for\nreconstruction. Methods are factored out into functions to have a clean\nnamespace to read JSON data into.\n\n``BOTLIB`` stores it's data on disk where objects are time versioned\nand the last version saved on disk is served to the user layer. Files are JSON\ndumps that are read-only so thus should provide (disk) persistence more chance.\nPaths carry the type in the path name what makes reconstruction from filename\neasier then reading type from the object.\n\n\n**INSTALL**\n\n\ninstall with pip or download from http://pypi.org/project/botlib:\n\n\n``python3 -m pip install botlib``\n\n\n**PROGRAMMING**\n\n\nbasic usage is this::\n\n >>> import bot\n >>> o = bot.Object()\n >>> o.key = \"value\"\n >>> o.key\n >>> 'value'\n\nObjects try to mimic a dictionary while trying to be an object with normal\nattribute access as well. hidden methods are provided, the methods are\nfactored out into functions like get, items, keys, register, set, update\nand values.\n\nload/save from/to disk::\n\n >>> from bot import Object, load, save\n >>> o = Object()\n >>> o.key = \"value\"\n >>> p = save(o)\n >>> obj = Object()\n >>> load(obj, p)\n >>> obj.key\n >>> 'value'\n\ngreat for giving objects peristence by having their state stored in files::\n\n >>> from bot import Object, save\n >>> o = Object()\n >>> save(o)\n 'bot.objects.Object/e71c9a1f456a4dcf813bb81d32c8e0f2/2021-08-31/15:31:05.717063'\n\n\n**AUTHOR**\n\n\nBart Thate\n\n\n**COPYRIGHT**\n\n\n``BOTLIB`` is placed in the Public Domain.\n\n\n",
    "bugtrack_url": null,
    "license": "Public Domain",
    "summary": "The Python3 bot Namespace",
    "version": "202",
    "split_keywords": [],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "fb9ef8cab7c8a51d56eb9262fb0cce456e259a1944a2194b910f2e46d20c823f",
                "md5": "b7fca52468c9c97faf816788127e7c7e",
                "sha256": "33ebc3c03d2f74292b77bbc127cf1a03c1aeaa97fa57292f67926a70737e3a28"
            },
            "downloads": -1,
            "filename": "botlib-202-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "b7fca52468c9c97faf816788127e7c7e",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": null,
            "size": 22085,
            "upload_time": "2023-02-07T17:57:59",
            "upload_time_iso_8601": "2023-02-07T17:57:59.535610Z",
            "url": "https://files.pythonhosted.org/packages/fb/9e/f8cab7c8a51d56eb9262fb0cce456e259a1944a2194b910f2e46d20c823f/botlib-202-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "299b17220f974c07c8ee92b0b6a39b91957c7dda525e14b5e3de85015af2c4a7",
                "md5": "7d05d40b3641416a45e9de2a6f9b9cf1",
                "sha256": "dff01eb184edffb2011307b62beec94c1bb9e33edeacb58fb301889c118f5eda"
            },
            "downloads": -1,
            "filename": "botlib-202.tar.gz",
            "has_sig": false,
            "md5_digest": "7d05d40b3641416a45e9de2a6f9b9cf1",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": null,
            "size": 18092,
            "upload_time": "2023-02-07T17:58:01",
            "upload_time_iso_8601": "2023-02-07T17:58:01.541981Z",
            "url": "https://files.pythonhosted.org/packages/29/9b/17220f974c07c8ee92b0b6a39b91957c7dda525e14b5e3de85015af2c4a7/botlib-202.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2023-02-07 17:58:01",
    "github": true,
    "gitlab": false,
    "bitbucket": false,
    "github_user": "bthate",
    "github_project": "botlib",
    "travis_ci": false,
    "coveralls": false,
    "github_actions": false,
    "lcname": "botlib"
}
        
Elapsed time: 0.03832s