{ "info": { "author": "ObjectBox", "author_email": "", "bugtrack_url": null, "classifiers": [ "Development Status :: 3 - Alpha", "Intended Audience :: Developers", "License :: OSI Approved :: Apache Software License", "Operating System :: MacOS", "Operating System :: Microsoft :: Windows", "Operating System :: POSIX :: Linux", "Programming Language :: C", "Programming Language :: C++", "Programming Language :: Python :: 3", "Programming Language :: Python :: 3.4", "Programming Language :: Python :: 3.5", "Programming Language :: Python :: 3.6", "Programming Language :: Python :: 3.7", "Programming Language :: Python :: 3.8", "Topic :: Database", "Topic :: Database :: Database Engines/Servers", "Topic :: Database :: Front-Ends", "Topic :: Software Development", "Topic :: Software Development :: Libraries" ], "description": "ObjectBox Python API\n====================\nObjectBox is a superfast database for objects, now also available for Python with a simple CRUD API.\n\n* Latest release: v0.1.0\n* Python version: 3.4+\n* Platforms supported: \n * Linux 64-bit\n * Linux ARMv6hf (e.g. Raspberry PI Zero)\n * Linux ARMv7hf (e.g. Raspberry PI 3)\n * MacOS 64-bit\n * Windows 64-bit\n\nGetting started\n---------------\nFirst of all, install the latest version:\n```bash\npip install --upgrade objectbox\n```\n\nTo start using ObjectBox as a storage for your data, you need to define your model first. \nThe model consists of Python classes annotated with `@Entity` decorator. \n\n### Model IDs and UIDs\nEach Entity has to have an ID (unique among entities). \nProperties need an ID as well (unique inside one Entity). \nBoth Entities and Properties must also have an UID, which is a globally unique identifier.\n\nFor other ObjectBox supported languages, the binding takes care of assigning these IDs/UIDs but this feature is not yet implemented for Python.\nTo learn more, see ObjectBox Java documentation: https://docs.objectbox.io/advanced/meta-model-ids-and-uids\n\n#### model.py\n```python\nfrom objectbox.model import *\n\n@Entity(id=1, uid=1)\nclass Person:\n id = Id(id=1, uid=1001)\n first_name = Property(str, id=2, uid=1002)\n last_name = Property(str, id=3, uid=1003)\n```\n\n### Using ObjectBox\nTo actually use the database, you launch (or \"build\") it with the model you've just defined.\nAfterwards, you can reuse the instance (`ob` in the example below) and use it to access \"Entity Boxes\" which hold your objects.\n\n#### program.py\n```python\nimport objectbox\n# from mypackage.model import Person\n\n# Configure ObjectBox: should be done only once in the whole program and the \"ob\" variable should be kept around\nmodel = objectbox.Model()\nmodel.entity(Person, last_property_id=objectbox.model.IdUid(3, 1003))\nmodel.last_entity_id = objectbox.model.IdUid(1, 1)\nob = objectbox.Builder().model(model).directory(\"db\").build()\n\n# Open the box of \"Person\" entity. This can be called many times but you can also pass the variable around\nbox = objectbox.Box(ob, Person)\n\nid = box.put(Person(first_name=\"Joe\", last_name=\"Green\")) # Create\nperson = box.get(id) # Read\nperson.last_name = \"Black\"\nbox.put(person) # Update\nbox.remove(person) # Delete\n```\n\nFor more information and code examples, see the tests folder. The docs for other languages may also help you understand the basics.\n* ObjectBox Java = https://docs.objectbox.io\n* ObjectBox Go - https://golang.objectbox.io\n* ObjectBox Swift - https://swift.objectbox.io\n\nSome features\n-------------\n* automatic transactions (ACID compliant)\n* bulk operations\n\nComing in the future\n-------------\nThe goodness you know from the other ObjectBox language-bindings, e.g.,\n* model management (no need to manually set id/uid)\n* automatic model migration (no schema upgrade scripts etc.)\n* powerful queries\n* relations (to-one, to-many)\n* asynchronous operations\n* secondary indexes \n\nContributing\n------------\nCurrently, the Python binding is in its very early stages and lots of features available in other languages are missing.\nIf you have a request for a specific feature, please open an issue. If you want to contribute, please feel free to open a PR.\nIn case it's a non-obvious contribution it might be better to discuss and align first in an issue. \n\nThis repo uses `virtualenv` when installing packages so in case you don't have it yet: `pip install virtualenv`.\n\nThe main prerequisite to using the Python APIs is the ObjectBox binary library (.so, .dylib, .dll depending on your platform) which actually implements the database functionality.\n\nThe library should be placed in the `objectbox/lib/[architecture]/` folder of the checked out repository.\n\n### Getting ObjectBox C-API library from pip\nThe easiest way is to get all the binaries from the latest release in PyPI.\n```bash\npip download objectbox\nunzip objectbox*.whl\ncp -r objectbox/lib [/path/to/your/git/objectbox/checkout]/objectbox/ \n``` \n\n### Downloading from the ObjectBox-C release\nAlternatively, you can get the appropriate release from the ObjectBox-C repository.\nHowever, you need to pay attention to the required version - see `required_version` in `objectbox/c.py`.\nIn the [ObjectBox C repository](https://github.com/objectbox/objectbox-c), you should find a download.sh script you can run.\n\n\n```bash\nwget https://raw.githubusercontent.com/objectbox/objectbox-c/master/download.sh\nchmod +x download.sh\n# replace [required_version] with the appropriate string then type N when the script asks about installing the library\n./download.sh [required_version]\ncp lib/*objectbox* [/path/to/your/git/objectbox/checkout]/objectbox/lib/$(uname -m)/\n```\n\nYou can run `make test` to make sure everything works as expected.\n\nLicense\n-------\n Copyright 2019 ObjectBox Ltd. All rights reserved.\n\n Licensed under the Apache License, Version 2.0 (the \"License\");\n you may not use this file except in compliance with the License.\n You may obtain a copy of the License at\n\n http://www.apache.org/licenses/LICENSE-2.0\n\n Unless required by applicable law or agreed to in writing, software\n distributed under the License is distributed on an \"AS IS\" BASIS,\n WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n See the License for the specific language governing permissions and\n limitations under the License.\n\n\n\n", "description_content_type": "text/markdown", "docs_url": null, "download_url": "", "downloads": { "last_day": -1, "last_month": -1, "last_week": -1 }, "home_page": "https://github.com/objectbox/objectbox-python", "keywords": "", "license": "Apache 2.0", "maintainer": "", "maintainer_email": "", "name": "objectbox", "package_url": "https://pypi.org/project/objectbox/", "platform": "", "project_url": "https://pypi.org/project/objectbox/", "project_urls": { "Homepage": "https://github.com/objectbox/objectbox-python" }, "release_url": "https://pypi.org/project/objectbox/0.1.0/", "requires_dist": [ "flatbuffers (==1.11)" ], "requires_python": ">=3.4, <4", "summary": "ObjectBox is a superfast database for objects", "version": "0.1.0" }, "last_serial": 5237781, "releases": { "0.1.0": [ { "comment_text": "", "digests": { "md5": "ef583bb2b90a2b2de6aa70258c3f96fe", "sha256": "184cfd96a92a56d2b163b98314919375951fc771f75847aa17e45f5d7c545602" }, "downloads": -1, "filename": "objectbox-0.1.0-py3-none-any.whl", "has_sig": false, "md5_digest": "ef583bb2b90a2b2de6aa70258c3f96fe", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": ">=3.4, <4", "size": 1717781, "upload_time": "2019-05-07T11:25:21", "url": "https://files.pythonhosted.org/packages/0e/0b/d1b48be7d0b7b9bfb8fbe53df0c77e84da3dedd26f6833ca74cdfc3dd459/objectbox-0.1.0-py3-none-any.whl" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "ef583bb2b90a2b2de6aa70258c3f96fe", "sha256": "184cfd96a92a56d2b163b98314919375951fc771f75847aa17e45f5d7c545602" }, "downloads": -1, "filename": "objectbox-0.1.0-py3-none-any.whl", "has_sig": false, "md5_digest": "ef583bb2b90a2b2de6aa70258c3f96fe", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": ">=3.4, <4", "size": 1717781, "upload_time": "2019-05-07T11:25:21", "url": "https://files.pythonhosted.org/packages/0e/0b/d1b48be7d0b7b9bfb8fbe53df0c77e84da3dedd26f6833ca74cdfc3dd459/objectbox-0.1.0-py3-none-any.whl" } ] }