{ "info": { "author": "Chris Timperley", "author_email": "ctimperley@cmu.edu", "bugtrack_url": null, "classifiers": [ "Intended Audience :: Developers", "Natural Language :: English", "Programming Language :: Python", "Programming Language :: Python :: 3", "Programming Language :: Python :: 3.5", "Programming Language :: Python :: 3.6", "Programming Language :: Python :: 3.7" ], "description": ".. -*-restructuredtext-*-\n\nfluffycow\n=========\n\n.. image:: https://travis-ci.org/ChrisTimperley/fluffycow.svg?branch=master\n :target: https://travis-ci.org/ChrisTimperley/fluffycow\n\n.. image:: https://badge.fury.io/py/fluffycow.svg\n :target: https://badge.fury.io/py/fluffycow\n\n.. image:: https://img.shields.io/pypi/pyversions/fluffycow.svg\n :target: https://pypi.org/project/fluffycow\n\n\nA simple and elegant library for generating complex random objects in Python.\n\n\n.. image:: https://static.boredpanda.com/blog/wp-content/uploads/2014/03/cute-fluffy-animals-33.jpg\n\n(image credit: `Matt Lautner `_.)\n\n\nInstallation\n------------\n\nTo install the latest release from `PyPI `_:\n\n.. code::\n\n $ pip install fluffycow\n\nTo install the latest development release:\n\n.. code::\n\n $ git clone https://github.com/ChrisTimperley/fluffycow\n $ cd fluffycow\n $ python setup.py install\n\n\nExamples\n--------\n\nTo generate 10 lists containing 5 random numbers:\n\n.. code:: python\n\n import fluffycow as g\n\n gen = g.list(g.random(), 5)\n for i in range(10):\n l = next(gen)\n print(l)\n\n \"\"\"\n [0.8620918485892981, 0.4794836848262348, 0.262162063050416, 0.01909426938513137, 0.36506899628784006]\n [0.9397902843125912, 0.9883123343094299, 0.5728170848781718, 0.2430986751635641, 0.6504376531611539]\n [0.6530962809522628, 0.629805285301596, 0.7484217313556808, 0.4781887755635098, 0.7702516815623411]\n [0.6049464336804768, 0.6857354552123759, 0.4401119070721792, 0.16269631684472152, 0.4501522526776762]\n [0.6754685790929789, 0.14883325162091654, 0.7543575544723128, 0.7400186451945051, 0.7872586706933858]\n [0.6093352430215464, 0.601878065077082, 0.9864251783225236, 0.5652106608585465, 0.2000072917817054]\n [0.5288773016226057, 0.3473820645776373, 0.5181819860433858, 0.9795605815396756, 0.0941069188895195]\n [0.577403816680611, 0.6006088487133505, 0.7401053882982396, 0.9243339819764703, 0.8737058738019327]\n [0.15168246955860343, 0.9826794936881696, 0.8700116634339362, 0.23066589924280112, 0.6455718073363804]\n [0.4953407037944514, 0.4235910957127196, 0.9817109582233142, 0.19140229868504488, 0.4238482591507997]\n \"\"\"\n\n\nTo generate 5 random cows \ud83d\udc04:\n\n.. code:: python\n\n import fluffycow as g\n import attr\n\n @attr.s\n class Cow:\n age = attr.ib(type=int)\n fluffiness = attr.ib(type=float)\n\n # provide generators for each keyword argument,\n gen = g.factory(Cow,\n age=g.randint(0, 50),\n fluffiness=g.gauss(5.0, 1.5))\n\n # or for each positional argument,\n gen = g.factory(Cow, g.randint(0, 50), g.gauss(5.0, 1.5))\n\n # or mix positional and keyword arguments\n gen = g.factory(Cow,\n g.randint(0, 50),\n fluffiness=g.gauss(5.0, 1.5))\n\n # generate some fluffy cows\n for i in range(5):\n cow = next(gen)\n print(cow)\n\n \"\"\"\n Cow(age=16, fluffiness=6.737730437364233)\n Cow(age=30, fluffiness=3.6106200949734806)\n Cow(age=4, fluffiness=5.856278892241928)\n Cow(age=40, fluffiness=4.274460173984223)\n Cow(age=8, fluffiness=4.26886806010291)\n \"\"\"\n\n\nTo generate a farm containing a random mixture of 10 animals:\n\n.. code:: python\n\n @attr.s\n class Cow:\n age = attr.ib(type=int)\n fluffiness = attr.ib(type=float)\n\n @attr.s\n class Chicken:\n sass = attr.ib(type=int)\n\n @attr.s\n class Sheep:\n fluffiness = attr.ib(type=float)\n\n def farm():\n cows = g.factory(Cow,\n age=g.randint(0, 30),\n fluffiness=g.gauss(5.0, 1.5))\n chickens = g.object(Chicken, g.randint(0, 10))\n sheep = g.object(Sheep, g.gauss(4.5, 1.0))\n\n animals = g.mux(cows, chickens, sheep)\n for i in range(10):\n animal = next(animals)\n print(animal)\n\n \"\"\"\n Cow(age=15, fluffiness=4.13522619329628)\n Cow(age=6, fluffiness=6.132266751335851)\n Sheep(fluffiness=4.996947740687185)\n Cow(age=25, fluffiness=4.268442712380023)\n Sheep(fluffiness=4.92952572321737)\n Chicken(sass=5)\n Cow(age=28, fluffiness=5.155204522890905)\n Sheep(fluffiness=3.9241924681246094)\n Sheep(fluffiness=3.676097181435127)\n Sheep(fluffiness=2.713429568549102)\n \"\"\"", "description_content_type": "", "docs_url": null, "download_url": "", "downloads": { "last_day": -1, "last_month": -1, "last_week": -1 }, "home_page": "https://github.com/ChrisTimperley/fluffycow", "keywords": "random,fuzzing,dsl", "license": "Apache License 2.0", "maintainer": "", "maintainer_email": "", "name": "fluffycow", "package_url": "https://pypi.org/project/fluffycow/", "platform": "", "project_url": "https://pypi.org/project/fluffycow/", "project_urls": { "Homepage": "https://github.com/ChrisTimperley/fluffycow" }, "release_url": "https://pypi.org/project/fluffycow/0.0.5/", "requires_dist": null, "requires_python": ">=3.5", "summary": "A domain-specific language for generating random inputs", "version": "0.0.5" }, "last_serial": 5106337, "releases": { "0.0.1": [ { "comment_text": "", "digests": { "md5": "4df867cab4424799a50b64afd6ed4afe", "sha256": "ffffd7232cef47700107614d8e9abf9f89470324029df2cc2df6400a29e90a27" }, "downloads": -1, "filename": "fluffycow-0.0.1.tar.gz", "has_sig": false, "md5_digest": "4df867cab4424799a50b64afd6ed4afe", "packagetype": "sdist", "python_version": "source", "requires_python": ">=3.5", "size": 2062, "upload_time": "2019-03-26T22:13:53", "url": "https://files.pythonhosted.org/packages/d3/c7/b570b59309bb08f70ab6b0c4bb2e8740a03e6dc333953ba994a2595354d8/fluffycow-0.0.1.tar.gz" } ], "0.0.2": [ { "comment_text": "", "digests": { "md5": "7feff523699d920b1003a65838625351", "sha256": "a4b3fac592509b01164be279cc687d07866b9177b86d5035ef6566972e9a169c" }, "downloads": -1, "filename": "fluffycow-0.0.2.tar.gz", "has_sig": false, "md5_digest": "7feff523699d920b1003a65838625351", "packagetype": "sdist", "python_version": "source", "requires_python": ">=3.5", "size": 2268, "upload_time": "2019-03-26T22:30:54", "url": "https://files.pythonhosted.org/packages/1b/42/24917e78d10d12b29d4f0591fd8666a8f8135acb9d938d4b4bc7d2d7ff25/fluffycow-0.0.2.tar.gz" } ], "0.0.3": [ { "comment_text": "", "digests": { "md5": "c8bc65b66d3fbe7050ddf774f0588cd9", "sha256": "06793e58df7d9f78193330e244fe130426dd03cc4da805c4f4df1264d5ff2557" }, "downloads": -1, "filename": "fluffycow-0.0.3.tar.gz", "has_sig": false, "md5_digest": "c8bc65b66d3fbe7050ddf774f0588cd9", "packagetype": "sdist", "python_version": "source", "requires_python": ">=3.5", "size": 4229, "upload_time": "2019-03-27T00:51:00", "url": "https://files.pythonhosted.org/packages/f8/2a/a36aa58df3a872185705820d6e09d110df134b2ea14de913844f48aff17f/fluffycow-0.0.3.tar.gz" } ], "0.0.4": [ { "comment_text": "", "digests": { "md5": "82bb569ca2063256081df3cbf8084872", "sha256": "fd5206e4ecc59aa1400480c2b8e6f87ccadca09768e0940ea44aaa8dc3840249" }, "downloads": -1, "filename": "fluffycow-0.0.4.tar.gz", "has_sig": false, "md5_digest": "82bb569ca2063256081df3cbf8084872", "packagetype": "sdist", "python_version": "source", "requires_python": ">=3.5", "size": 4229, "upload_time": "2019-03-28T17:32:23", "url": "https://files.pythonhosted.org/packages/2a/ef/ef1df4d97edf251270cc6e7b209ba0cd0bd6bb5ff593c7fd5551ac6994f3/fluffycow-0.0.4.tar.gz" } ], "0.0.5": [ { "comment_text": "", "digests": { "md5": "b1300982c724b179424b26d7c0c5eb64", "sha256": "cdcee1e57d270fb0f75a64cb9bacbd93f28f3ccd9fad07167c64ee6f1003cd8f" }, "downloads": -1, "filename": "fluffycow-0.0.5.tar.gz", "has_sig": false, "md5_digest": "b1300982c724b179424b26d7c0c5eb64", "packagetype": "sdist", "python_version": "source", "requires_python": ">=3.5", "size": 4203, "upload_time": "2019-04-06T02:07:48", "url": "https://files.pythonhosted.org/packages/18/c4/16f2c7623f440bd5576fa132341917cd305f70d2590547c76ebe67a0ecc3/fluffycow-0.0.5.tar.gz" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "b1300982c724b179424b26d7c0c5eb64", "sha256": "cdcee1e57d270fb0f75a64cb9bacbd93f28f3ccd9fad07167c64ee6f1003cd8f" }, "downloads": -1, "filename": "fluffycow-0.0.5.tar.gz", "has_sig": false, "md5_digest": "b1300982c724b179424b26d7c0c5eb64", "packagetype": "sdist", "python_version": "source", "requires_python": ">=3.5", "size": 4203, "upload_time": "2019-04-06T02:07:48", "url": "https://files.pythonhosted.org/packages/18/c4/16f2c7623f440bd5576fa132341917cd305f70d2590547c76ebe67a0ecc3/fluffycow-0.0.5.tar.gz" } ] }