{ "info": { "author": "teitei-tk", "author_email": "teitei.tk@gmail.com", "bugtrack_url": null, "classifiers": [ "Development Status :: 3 - Alpha", "License :: OSI Approved :: MIT License", "Programming Language :: Python", "Programming Language :: Python :: 2.6", "Programming Language :: Python :: 2.7", "Programming Language :: Python :: 3", "Topic :: Database", "Topic :: Database :: Front-Ends", "Topic :: Software Development", "Topic :: Software Development :: Libraries" ], "description": "JohnnieRunner\n=============\n\nJohnnieRunner is SQLAlchemy Wrapper for Active Record pattern O/R Mapper\n\nDependencies\n------------\n\n- Python2.7 or Later\n- SQLAlchemy >= 1.0.8\n- MySQL-Python >= 1.2.5\n\nSupport RDBMS\n-------------\n\n- MySQL\n\nGoal\n----\n\n- Add Rails like ActiveRecord Api\n- Database Migration\n- All Supports of SQLAlchemy RDBMS\n\nUsage\n-----\n\nPrepare\n~~~~~~~\n\n1. generate testing database\n\n .. code:: bash\n\n $ mysql -u root -p\n mysql> create database johnnie;\n Query OK, 1 row affected (0.01 sec)\n\n mysql> exit;\n Bye\n\n2. define O/R Mapper structure\n\n .. code:: python\n\n from johnnie import AbstractModel, create_session\n from johnnie.types import Column, String, Integer\n\n session = create_session('localhost', 'root', 'root user password', 'johnnie')\n\n\n class Repositories(AbstractModel):\n class Meta:\n session = session\n\n id = Column('id', Integer(unsigned=True), primary_key=True)\n name = Column('name', String(255), nullable=False)\n author = Column('author', String(255), nullable=False)\n url = Column('url', String(255), nullable=False)\n\n3. create model table\n\n .. code:: bash\n\n $ python\n >>> from hoge import Repositories\n >>> Repositories.metadata.create_all(Repositories.get_session_engine())\n >>> exit()\n\nExample\n~~~~~~~\n\n1. create entity\n\n .. code:: bash\n\n >>> from hoge import Repositories\n >>> entity = Repositories(name=\"JohnnieRunner\", author=\"teitei-tk\", url=\"https://github.com/teitei-tk/JohnnieRunner\")\n\n or\n\n >>> entity_data = {\"name\": \"JohnnieRunner\", \"author\": \"teitei-tk\", \"url\": \"https://github.com/teitei-tk/JohnnieRunner\"}\n >>> entity = Repositories.new(entity_data)\n\n2. create record\n\n .. code:: bash\n\n >>> entity.save()\n True\n\n .. code:: sql\n\n mysql> select * from repositories;\n +----+---------------+-----------+--------------------------------------------+\n | id | name | author | url |\n +----+---------------+-----------+--------------------------------------------+\n | 1 | JohnnieRunner | teitei-tk | https://github.com/teitei-tk/JohnnieRunner |\n +----+---------------+-----------+--------------------------------------------+\n 1 row in set (0.00 sec)\n mysql>\n\n3. read record\n\n .. code:: bash\n\n >>> entity = Repositories.get(1)\n\n or\n\n >>> entity = Repositories.find(1)\n\n >>> entity.name\n u\"JohnnieRunner\"\n >>> entity.author\n u\"teitei-tk\"\n >>> entity.url\n u\"https://github.com/teitei-tk/JohnnieRunner\"\n\n4. update record\n\n .. code:: bash\n\n >>> entity.name = u\"update_test\"\n >>> entity.save()\n True\n\n .. code:: sql\n\n mysql> select * from repositories;\n +----+-------------+-----------+--------------------------------------------+\n | id | name | author | url |\n +----+-------------+-----------+--------------------------------------------+\n | 1 | update_test | teitei-tk | https://github.com/teitei-tk/JohnnieRunner |\n +----+-------------+-----------+--------------------------------------------+\n mysql>\n\n5. delete record\n\n .. code:: bash\n\n >>> entity.delete()\n True\n\n .. code:: sql\n\n mysql> select * from repositories;\n Empty set (0.00 sec)\n\nTODO\n----\n\n- [ ] Add DB Data Types\n- [ ] Easy generate table index\n- [ ] Easy Table RelationShips\n- [ ] Database Migration\n- [ ] RDBMS Support other than MySQL\n\nLicense\n-------\n\n- MIT", "description_content_type": null, "docs_url": null, "download_url": "https://github.com/teitei-tk/JohnnieRunner/archive/master.tar.gz", "downloads": { "last_day": -1, "last_month": -1, "last_week": -1 }, "home_page": "https://github.com/teitei-tk/JohnnieRunner", "keywords": "orm,ormapper,o/r mapper,ActiveRecord,SQLAlchemy", "license": "MIT", "maintainer": null, "maintainer_email": null, "name": "JohnnieRunner", "package_url": "https://pypi.org/project/JohnnieRunner/", "platform": "UNKNOWN", "project_url": "https://pypi.org/project/JohnnieRunner/", "project_urls": { "Download": "https://github.com/teitei-tk/JohnnieRunner/archive/master.tar.gz", "Homepage": "https://github.com/teitei-tk/JohnnieRunner" }, "release_url": "https://pypi.org/project/JohnnieRunner/0.0.1/", "requires_dist": null, "requires_python": null, "summary": "JohnnieRunner is SQLAlchemy Wrapper for Active Record pattern O/R Mapper", "version": "0.0.1" }, "last_serial": 1733479, "releases": { "0.0.1": [ { "comment_text": "", "digests": { "md5": "dffba24a4037fbbee100e45159a3c84b", "sha256": "25372a69d656d4f76b1a25c04f624b86783123b800aad3a953302d498e466092" }, "downloads": -1, "filename": "JohnnieRunner-0.0.1.tar.gz", "has_sig": false, "md5_digest": "dffba24a4037fbbee100e45159a3c84b", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 4513, "upload_time": "2015-09-22T16:54:56", "url": "https://files.pythonhosted.org/packages/12/b2/f6d9b60613095ab2bf1534a91c5962f08da1094171b86d6f39d335d28a8d/JohnnieRunner-0.0.1.tar.gz" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "dffba24a4037fbbee100e45159a3c84b", "sha256": "25372a69d656d4f76b1a25c04f624b86783123b800aad3a953302d498e466092" }, "downloads": -1, "filename": "JohnnieRunner-0.0.1.tar.gz", "has_sig": false, "md5_digest": "dffba24a4037fbbee100e45159a3c84b", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 4513, "upload_time": "2015-09-22T16:54:56", "url": "https://files.pythonhosted.org/packages/12/b2/f6d9b60613095ab2bf1534a91c5962f08da1094171b86d6f39d335d28a8d/JohnnieRunner-0.0.1.tar.gz" } ] }