{ "info": { "author": "Giacomo Alzetta", "author_email": "giacomo.alzetta@gmail.com", "bugtrack_url": null, "classifiers": [ "Development Status :: 3 - Alpha", "Intended Audience :: Developers", "License :: OSI Approved :: Apache Software License", "Programming Language :: Python :: 3", "Programming Language :: Python :: 3.6", "Topic :: Software Development :: Testing" ], "description": "# Feanor CSV\n\nFeanor is an artisan of CSV files. It can generate complex CSV files or file bundles for examples and tests.\n\n**Note:** Feanor is currently in development. All releases prior to `1.0.0` should be considered alpha releases\nand both the command line interface and the library API might change significantly between releases.\nRelease `1.0.0` will provide a stable API and stable command line interface for the `1.x` series.\n\n\n## Usage\n\n```\n$ feanor --help\nusage: feanor [-h] [--no-header] [-L LIBRARY] [-C GLOBAL_CONFIGURATION]\n [-r RANDOM_MODULE] [-s RANDOM_SEED] [--version]\n (-n N | -b N | --stream-mode STREAM_MODE)\n {expr,cmdline} ...\n\noptional arguments:\n -h, --help show this help message and exit\n --no-header Do not add header to the output.\n -L LIBRARY, --library LIBRARY\n The library to use.\n -C GLOBAL_CONFIGURATION, --global-configuration GLOBAL_CONFIGURATION\n The global configuration for arbitraries.\n -r RANDOM_MODULE, --random-module RANDOM_MODULE\n The random module to be used to generate random data.\n -s RANDOM_SEED, --random-seed RANDOM_SEED\n The random seed to use for this run.\n --version show program's version number and exit\n -n N, --num-rows N The number of rows of the produced CSV\n -b N, --num-bytes N The approximate number of bytes of the produced CSV\n --stream-mode STREAM_MODE\n\nSchema definition:\n {expr,cmdline} Commands to define a CSV schema.\n```\n\nChecking the version:\n\n```\n$ feanor --version\nfeanor 0.5.0\n```\n\n## Arbitrary types\n\nEach arbitrary is assigned an \"arbitrary type\", which describes how to generate the values.\nThe syntax of the arbitrary type is the following:\n\n # [ CONFIG ]\n\nWhere `ARBITRARY_NAME` must match `\\w+` and `CONFIG` is a python `dict` literal.\n\nFor example the built-in `int` arbitrary type can be used in the following ways:\n\n - `%int` or `%int{}`: default configuration\n - `%int{\"min\": 10}`: do not generate numbers smaller than `10` (inclusive).\n - `%int{\"max\": 10}`: do not generate numbers bigger than `10` (inclusive).\n - `%int{\"min\": 10, \"max\":1000}`: generate numbers between `10` and `1000` (both inclusive).\n\n\n## Feanor DSL Expressions\n\nValues are defined by a simple DSL that allows you to combine multiple arbitraries in different ways and they\nallow to express complex logic for your data generation.\n\n### Arbitrary definitions\n\nAn arbitrary definition is simply its type and follows the syntax `#[CONFIG]` as explained before.\n\n\n### Assignments\n\nYou can assign a name to a certain expression with the syntax `()=`.\n\n\n### References\n\nYou can refer to the values of an expression to which you assigned a name by using the syntax `@`.\n\n### Concatenation\n\nYou can concatenate multiple values using the syntax ` . ` or ` \u00b7 `.\n\n### Choice\n\nYou can define an expression that can randomly take a value by using the choice operator `|` using the\nsyntax ` | `.\n\nThe value of such expression will take the value of `expr_1` for `50%` of the time and the value of `expr_2`\nthe other times. You can specify the chances with the syntax: `expr_1 <0.3|0.7> expr_2`.\nIn this case the expression will evaluate to `expr_1` only `30%` of the time and to `expr_2` the remaining `70%`\nof the time. You may omit one of the two numbers, hence `expr_1 <0.3|> expr_2` is equivalent to the last\nexpression.\n\nIf the sum of the left and right weight add up to a value smaller than `1` then the remaining portion\nis the chance of the value to be empty. For example `expr_1 <0.25|0.25> expr_2` defines\nan expression that in `25%` of the time evaluates to `expr_1`, `25%` of the time evaluates to `expr_2`\nand `50%` of the time evaluates to `None` (i.e. empty)\n\n### Merge\n\nYou can define an expression that can merge values of two different expressions using the `+` operator.\n\nFor example `%int + %float` is an expression that evaluates to the sum of a random integer and a random float.\n\n\n## Examples\n\n**NOTE:** the following examples all specify the option `-s 0`. This is used solely for reproducibility reason.\nThe common use cases for Feanor do not need to specify a random seed and in fact doing so often defeats the purpose of the tool.\n\n### Using the `cmdline` subcommand\n\nGenerate 10 rows with random integers:\n\n```\n$ feanor -s 0 -n 10 cmdline -c a '%int' -c b '%int'\na,b\n885440,403958\n794772,933488\n441001,42450\n271493,536110\n509532,424604\n962838,821872\n870163,318046\n499748,375441\n611720,934973\n952225,229053\n```\n\nGenerate about 1 kilobyte of rows with 2 random integers in them and write result to `/tmp/out.csv`:\n\n```\n$ feanor -s 0 -b 1024 cmdline -c a '%int' -c b '%int' /tmp/out.csv\n$ head /tmp/out.csv \na,b\n885440,403958\n794772,933488\n441001,42450\n271493,536110\n509532,424604\n962838,821872\n870163,318046\n499748,375441\n611720,934973\n```\n\n\n\nGenerate 10 rows with random integers, the first column between `0` and `10`, the second column between `0` and `1000`:\n\n```\n$ feanor -s 0 -n 10 cmdline -c a '%int{\"min\":0, \"max\":10}' -c b '%int{\"min\": 0, \"max\":1000}'\na,b\n6,776\n6,41\n4,988\n8,497\n6,940\n4,991\n7,366\n9,913\n3,516\n2,288\n```\n\nGenerate 10 rows with random integers and their sum:\n\n```\n$ feanor -s 0 -n 10 cmdline -c a '%int' -c b '%int' -c c '@a+@b'\na,b,c\n885440,403958,1289398\n794772,933488,1728260\n441001,42450,483451\n271493,536110,807603\n509532,424604,934136\n962838,821872,1784710\n870163,318046,1188209\n499748,375441,875189\n611720,934973,1546693\n952225,229053,1181278\n```\n\n### Using the `expr` subcommand\n\nGenerate 10 rows with random integers:\n\n```\n$ feanor -s 0 -n 10 expr -c a,b '%int\u00b7%int'\na,b\n885440,403958\n794772,933488\n441001,42450\n271493,536110\n509532,424604\n962838,821872\n870163,318046\n499748,375441\n611720,934973\n952225,229053\n```\n\nGenerate about 1 kilobyte of rows with 2 random integers in them and write result to `/tmp/out.csv`:\n\n```\n$ feanor -s 0 -b 1024 expr -c a,b /tmp/out.csv '%int\u00b7%int'\n$ head /tmp/out.csv \na,b\n885440,403958\n794772,933488\n441001,42450\n271493,536110\n509532,424604\n962838,821872\n870163,318046\n499748,375441\n611720,934973\n```\n\n\n\nGenerate 10 rows with random integers, the first column between `0` and `10`, the second column between `0` and `1000`:\n\n```\n$ feanor -s 0 -n 10 expr -c a,b '%int{\"min\":0, \"max\":10}\u00b7%int{\"min\": 0, \"max\":1000}'\na,b\n6,776\n6,41\n4,988\n8,497\n6,940\n4,991\n7,366\n9,913\n3,516\n2,288\n```\n\nGenerate 10 rows with random integers and their sum:\n\n```\n$ feanor -s 0 -n 10 expr -c a,b,c '(%int)=a\u00b7(%int)=b\u00b7(@a+@b)'\na,b,c\n885440,403958,1289398\n794772,933488,1728260\n441001,42450,483451\n271493,536110,807603\n509532,424604,934136\n962838,821872,1784710\n870163,318046,1188209\n499748,375441,875189\n611720,934973,1546693\n952225,229053,1181278\n```\n\nor also:\n\n```\n$ feanor -s 0 -n 10 expr -c a,b,c 'let a:=%int b:=%int in @a\u00b7@b\u00b7(@a+@b)'\na,b,c\n885440,403958,1289398\n794772,933488,1728260\n441001,42450,483451\n271493,536110,807603\n509532,424604,934136\n962838,821872,1784710\n870163,318046,1188209\n499748,375441,875189\n611720,934973,1546693\n952225,229053,1181278\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/Bakuriu/feanor-csv", "keywords": "csv generation schema", "license": "", "maintainer": "", "maintainer_email": "", "name": "feanor-csv", "package_url": "https://pypi.org/project/feanor-csv/", "platform": "", "project_url": "https://pypi.org/project/feanor-csv/", "project_urls": { "Bug Reports": "https://github.com/Bakuriu/feanor-csv/issues", "Homepage": "https://github.com/Bakuriu/feanor-csv", "Source": "https://github.com/Bakuriu/feanor-csv" }, "release_url": "https://pypi.org/project/feanor-csv/0.5.0/", "requires_dist": [ "ply", "check-manifest; extra == 'dev'" ], "requires_python": "", "summary": "The ultimate CSV artisan.", "version": "0.5.0" }, "last_serial": 4297398, "releases": { "0.2.1": [ { "comment_text": "", "digests": { "md5": "e4174b730f5c9bee036187e4d7c1a37a", "sha256": "56f1c38db642f4e259b24462253a8829d2c5e532b5f9e9f3be4d5b44fd7980a8" }, "downloads": -1, "filename": "feanor_csv-0.2.1-py3-none-any.whl", "has_sig": false, "md5_digest": "e4174b730f5c9bee036187e4d7c1a37a", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": null, "size": 11060, "upload_time": "2018-07-23T19:18:48", "url": "https://files.pythonhosted.org/packages/63/a6/6d24d0d250db4549a94808b0919be4c9f755747dfd8bc17d0dfc18461401/feanor_csv-0.2.1-py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "422240333cefcc557bfe0e0838846656", "sha256": "81376e6170bb342139617eca5a1df8919b1222721e27cf8d7367424ddbf706e5" }, "downloads": -1, "filename": "feanor-csv-0.2.1.tar.gz", "has_sig": false, "md5_digest": "422240333cefcc557bfe0e0838846656", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 9307, "upload_time": "2018-07-23T19:18:50", "url": "https://files.pythonhosted.org/packages/14/86/7ba15241c5ba851f21106ad514feef3405f2a962eebb706d6cb24eda57bb/feanor-csv-0.2.1.tar.gz" } ], "0.3.1": [ { "comment_text": "", "digests": { "md5": "1e4515983b362bb1bc3341b407785fe0", "sha256": "310ab6de2f55b15ecaa9af36616e4ccec4902d8f6f1664cb88c3a4445e622405" }, "downloads": -1, "filename": "feanor_csv-0.3.1-py3-none-any.whl", "has_sig": false, "md5_digest": "1e4515983b362bb1bc3341b407785fe0", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": null, "size": 23086, "upload_time": "2018-08-02T22:33:30", "url": "https://files.pythonhosted.org/packages/4a/b8/7e352a5c6b884e953ed1fad97dae23390290371dce2e5bfa226bb570068d/feanor_csv-0.3.1-py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "ce80cc204944487a4e018947027e2384", "sha256": "f9989e8aa19e4cde0d2da633f407d794087945ad4af91bfae9828eb410c97e76" }, "downloads": -1, "filename": "feanor-csv-0.3.1.tar.gz", "has_sig": false, "md5_digest": "ce80cc204944487a4e018947027e2384", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 17563, "upload_time": "2018-08-02T22:33:31", "url": "https://files.pythonhosted.org/packages/b0/0d/6d8c245fba2437c8af8cc7a6d584792c9f057575f819443d20e0416588dd/feanor-csv-0.3.1.tar.gz" } ], "0.3.2": [ { "comment_text": "", "digests": { "md5": "007c9e59dc2a67888f6f77e587a558dd", "sha256": "660d05f87c994733eb39990adab70032afa4c73be9b2f5ff695a18d93de7939a" }, "downloads": -1, "filename": "feanor_csv-0.3.2-py3.6.egg", "has_sig": false, "md5_digest": "007c9e59dc2a67888f6f77e587a558dd", "packagetype": "bdist_egg", "python_version": "3.6", "requires_python": null, "size": 64679, "upload_time": "2018-08-29T17:12:53", "url": "https://files.pythonhosted.org/packages/be/1a/2d366f3a20765f2aa0efdfa1901b2b587c5914bcf295a3d28ef4303d9807/feanor_csv-0.3.2-py3.6.egg" }, { "comment_text": "", "digests": { "md5": "26f3958e7f00e9071a369de06f6fb498", "sha256": "dfcd6480f73a57e0f9e512f719b2b0fe25857d28d0369650e8ed489f9b98e158" }, "downloads": -1, "filename": "feanor_csv-0.3.2-py3-none-any.whl", "has_sig": false, "md5_digest": "26f3958e7f00e9071a369de06f6fb498", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": null, "size": 24592, "upload_time": "2018-08-10T20:55:40", "url": "https://files.pythonhosted.org/packages/be/7b/c15cfa1d59b66c987ee83c916e3c85df2070ca8cb70b8e572ed8478a842d/feanor_csv-0.3.2-py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "8ba9be2f4786222830db304d59bdb908", "sha256": "a38259736456696ddf2e608c03902c2af3cfbd4186ba97a3f638feb3a0e2f36e" }, "downloads": -1, "filename": "feanor-csv-0.3.2.tar.gz", "has_sig": false, "md5_digest": "8ba9be2f4786222830db304d59bdb908", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 19063, "upload_time": "2018-08-10T20:55:42", "url": "https://files.pythonhosted.org/packages/ae/e7/1482e0284278eceb38bc2003d77f5ac47c8d9f2e986086e7fdf5aad1ef68/feanor-csv-0.3.2.tar.gz" } ], "0.4.0": [ { "comment_text": "", "digests": { "md5": "8d1f8c8fdf216407d4518e06599af4f6", "sha256": "e1ec45c390f1e88eef172ba1d2911e047abfb13bdc366e4e51249f88afae7a0a" }, "downloads": -1, "filename": "feanor_csv-0.4.0-py3-none-any.whl", "has_sig": false, "md5_digest": "8d1f8c8fdf216407d4518e06599af4f6", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": null, "size": 25944, "upload_time": "2018-08-29T17:12:51", "url": "https://files.pythonhosted.org/packages/2a/38/ae1a8070d0c775f3297a81de4b8c41255c28cfca69c65b0b365e418f80f7/feanor_csv-0.4.0-py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "78d394736a5714a84e55893deaf76cf6", "sha256": "3e3bfcdd05546ea9f3bfd932c0d8bd729698132d5d06ffce1d117b3976c3985e" }, "downloads": -1, "filename": "feanor-csv-0.4.0.tar.gz", "has_sig": false, "md5_digest": "78d394736a5714a84e55893deaf76cf6", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 20963, "upload_time": "2018-08-29T17:12:56", "url": "https://files.pythonhosted.org/packages/8c/02/facb6206bf1ea234236c947d61d124bc1dc6d7ba04cd484ffb2b04b84059/feanor-csv-0.4.0.tar.gz" } ], "0.5.0": [ { "comment_text": "", "digests": { "md5": "8832aafebfcc9c4a4f0fc07c2ef6dd6d", "sha256": "2ceadbf67ba6deabbcbcea7a661eebad05aecf3770abfc73af83b47e48503ef3" }, "downloads": -1, "filename": "feanor_csv-0.5.0-py3-none-any.whl", "has_sig": false, "md5_digest": "8832aafebfcc9c4a4f0fc07c2ef6dd6d", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": null, "size": 28298, "upload_time": "2018-09-21T18:41:47", "url": "https://files.pythonhosted.org/packages/c3/d0/a1864051eeac080d6d9ea46ea62e8943af19b65f2326aae6f24e62963508/feanor_csv-0.5.0-py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "136ebd4af5351d770809a0e96d46e56b", "sha256": "482028d2aadf2b01f1e274d90f3a323c5b8917baf5a9e9a6e61fc09e1d34949d" }, "downloads": -1, "filename": "feanor-csv-0.5.0.tar.gz", "has_sig": false, "md5_digest": "136ebd4af5351d770809a0e96d46e56b", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 23127, "upload_time": "2018-09-21T18:41:49", "url": "https://files.pythonhosted.org/packages/68/e0/6432f1c2fb8f38cd249448ca472cc5e1495d0e31695a6d07ec618af06515/feanor-csv-0.5.0.tar.gz" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "8832aafebfcc9c4a4f0fc07c2ef6dd6d", "sha256": "2ceadbf67ba6deabbcbcea7a661eebad05aecf3770abfc73af83b47e48503ef3" }, "downloads": -1, "filename": "feanor_csv-0.5.0-py3-none-any.whl", "has_sig": false, "md5_digest": "8832aafebfcc9c4a4f0fc07c2ef6dd6d", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": null, "size": 28298, "upload_time": "2018-09-21T18:41:47", "url": "https://files.pythonhosted.org/packages/c3/d0/a1864051eeac080d6d9ea46ea62e8943af19b65f2326aae6f24e62963508/feanor_csv-0.5.0-py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "136ebd4af5351d770809a0e96d46e56b", "sha256": "482028d2aadf2b01f1e274d90f3a323c5b8917baf5a9e9a6e61fc09e1d34949d" }, "downloads": -1, "filename": "feanor-csv-0.5.0.tar.gz", "has_sig": false, "md5_digest": "136ebd4af5351d770809a0e96d46e56b", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 23127, "upload_time": "2018-09-21T18:41:49", "url": "https://files.pythonhosted.org/packages/68/e0/6432f1c2fb8f38cd249448ca472cc5e1495d0e31695a6d07ec618af06515/feanor-csv-0.5.0.tar.gz" } ] }