{ "info": { "author": "Calin Vlad", "author_email": "vlad.s.calin@gmail.com", "bugtrack_url": null, "classifiers": [ "License :: OSI Approved :: MIT License", "Programming Language :: Python :: 3.4", "Programming Language :: Python :: 3.5", "Programming Language :: Python :: 3.6", "Topic :: Database" ], "description": "fillmydb\n========\n\nFill your database with mocked instances.\n\nWrap you ORM model into a `ModelWrapper`, specify how your fields should look\nlike and then generate how many instances you want of each model.\n\n\nInstallation\n------------\n\n- `pip install fillmydb[peewee]` if you plan to use it with peewee models\n- `pip install fillmydb[django]` if you plan to use it with djanog models **(not implemented yet)**\n- `pip install fillmydb[sqlalchemy]` if you plan to use it with sqlalchemy models **(not implemented yet)**\n\n\nUsage with `fake-factory `_\n------------------------------------------------------------\n\n\nGenerating instances for a single model::\n\n import faker\n\n factory = faker.Factory.create()\n\n wrapper = ModelWrapper(TestModel)\n\n wrapper[TestModel].client_name = FieldSpec(factory.name)\n wrapper[TestModel].description = FieldSpec(factory.text)\n wrapper[TestModel].password_hash = FieldSpec(factory.binary, length=25)\n wrapper[TestModel].email = FieldSpec(factory.email)\n wrapper[TestModel].visits = FieldSpec(factory.pyint)\n\n item = wrapper.generate(100)\n\n\nGenerating instances for multipe models::\n\n from tests.models import User, Post, Like\n import faker\n\n factory = faker.Factory.create()\n\n wrapper = ModelWrapper(User, Like, Post)\n\n wrapper[User].name = FieldSpec(factory.name)\n wrapper[User].username = FieldSpec(factory.user_name)\n wrapper[User].description = FieldSpec(factory.text)\n wrapper[User].password_hash = FieldSpec(factory.binary, length=25)\n wrapper[User].email = FieldSpec(factory.email)\n wrapper[User].visits = FieldSpec(factory.pyint)\n\n wrapper[Post].title = FieldSpec(lambda _: \"test\", 1)\n wrapper[Post].text = FieldSpec(factory.text)\n\n # generating 10 users, 100 likes and 20 posts \n wrapper.generate(10, 100, 20)\n\nGeneral workflow\n----------------\n\nPseudo-code::\n\n initial_to_order_queue()\n while models_to_process():\n model = get_next_model()\n\n if model.has_unresolved_dependency():\n push_back_to_queue(model)\n\n # process model\n for _ in range(number_of_instances):\n for field in model.fields():\n # resolve_field(field)\n if field == ForeignKey:\n field = get_random_ref_model_instance()\n else:\n field = resolve_normal()\n mark_as_processed(model)", "description_content_type": null, "docs_url": null, "download_url": "UNKNOWN", "downloads": { "last_day": -1, "last_month": -1, "last_week": -1 }, "home_page": "https://github.com/vladcalin/fillmydb", "keywords": null, "license": "MIT", "maintainer": null, "maintainer_email": null, "name": "fillmydb", "package_url": "https://pypi.org/project/fillmydb/", "platform": "UNKNOWN", "project_url": "https://pypi.org/project/fillmydb/", "project_urls": { "Download": "UNKNOWN", "Homepage": "https://github.com/vladcalin/fillmydb" }, "release_url": "https://pypi.org/project/fillmydb/0.1.0/", "requires_dist": null, "requires_python": null, "summary": "Fill your database with mocked instances.", "version": "0.1.0" }, "last_serial": 2283714, "releases": { "0.1.0": [ { "comment_text": "built for Windows-8", "digests": { "md5": "2c4caa820e7f483b0e86e8943c2fc6fb", "sha256": "f9422eb5c86c50b53fa9bfebac9341dda9ad633e21fa6c675f3d6a6a31df4742" }, "downloads": -1, "filename": "fillmydb-0.1.0.win-amd64.zip", "has_sig": false, "md5_digest": "2c4caa820e7f483b0e86e8943c2fc6fb", "packagetype": "bdist_dumb", "python_version": "any", "requires_python": null, "size": 22111, "upload_time": "2016-08-16T08:03:48", "url": "https://files.pythonhosted.org/packages/5b/bc/f855b377bbf969b4a857ac48e33f67d1270f80b0e3f1f8d6ef3b0879b581/fillmydb-0.1.0.win-amd64.zip" }, { "comment_text": "", "digests": { "md5": "c4c87e81e58509008b0f37e3ec114c37", "sha256": "d3e2341c71431f280b632bf9de85289e6e6f0583e431f4a014914c1c28615fc0" }, "downloads": -1, "filename": "fillmydb-0.1.0.zip", "has_sig": false, "md5_digest": "c4c87e81e58509008b0f37e3ec114c37", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 9580, "upload_time": "2016-08-14T13:42:19", "url": "https://files.pythonhosted.org/packages/dc/85/04c983b8fd8d98b2339dc108bf7bae7e856a606fb6e9f463a035e70950fe/fillmydb-0.1.0.zip" } ] }, "urls": [ { "comment_text": "built for Windows-8", "digests": { "md5": "2c4caa820e7f483b0e86e8943c2fc6fb", "sha256": "f9422eb5c86c50b53fa9bfebac9341dda9ad633e21fa6c675f3d6a6a31df4742" }, "downloads": -1, "filename": "fillmydb-0.1.0.win-amd64.zip", "has_sig": false, "md5_digest": "2c4caa820e7f483b0e86e8943c2fc6fb", "packagetype": "bdist_dumb", "python_version": "any", "requires_python": null, "size": 22111, "upload_time": "2016-08-16T08:03:48", "url": "https://files.pythonhosted.org/packages/5b/bc/f855b377bbf969b4a857ac48e33f67d1270f80b0e3f1f8d6ef3b0879b581/fillmydb-0.1.0.win-amd64.zip" }, { "comment_text": "", "digests": { "md5": "c4c87e81e58509008b0f37e3ec114c37", "sha256": "d3e2341c71431f280b632bf9de85289e6e6f0583e431f4a014914c1c28615fc0" }, "downloads": -1, "filename": "fillmydb-0.1.0.zip", "has_sig": false, "md5_digest": "c4c87e81e58509008b0f37e3ec114c37", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 9580, "upload_time": "2016-08-14T13:42:19", "url": "https://files.pythonhosted.org/packages/dc/85/04c983b8fd8d98b2339dc108bf7bae7e856a606fb6e9f463a035e70950fe/fillmydb-0.1.0.zip" } ] }