{
"info": {
"author": "Juan Carlos",
"author_email": "juancarlospaco@gmail.com",
"bugtrack_url": null,
"classifiers": [
"Development Status :: 5 - Production/Stable",
"Environment :: Console",
"Environment :: Other Environment",
"Intended Audience :: Developers",
"Intended Audience :: Other Audience",
"Natural Language :: English",
"Operating System :: MacOS :: MacOS X",
"Operating System :: Microsoft :: Windows",
"Operating System :: OS Independent",
"Operating System :: POSIX :: Linux",
"Programming Language :: Python",
"Programming Language :: Python :: 3",
"Programming Language :: Python :: 3.7",
"Programming Language :: Python :: 3 :: Only",
"Programming Language :: Python :: Implementation :: CPython",
"Topic :: Software Development"
],
"description": "# Faster-than-CSV\n\n[](https://youtu.be/QiKwnlyhKrk?t=5)\n\n| Library | Speed |\n|-------------------------------|----------|\n| Pandas `read_csv()` | `20.09` |\n| NumPy `fromfile()` | `3.88` |\n| NumPy `genfromtxt()` | `4.00` |\n| NumPy `loadtxt()` | `1.26` |\n| csv (std lib) | `0.40` |\n| csv (list) | `0.38` |\n| csv (map) | `0.37` |\n| Faster_than_csv | `0.09` |\n\n- This CSV Lib is ~200 Lines of Code.\n\n\n\n- Benchmarks run on Docker from Dockerfile on this repo.\n- Speed is IRL time to complete 10000 CSV Parsings.\n- Lines Of Code counted using [CLOC](https://github.com/AlDanial/cloc).\n- Direct dependencies of the package when ready to run.\n- Benchmarks run on Docker from Dockerfile on this repo.\n- Stats as of year 2019.\n- x86_64 64Bit AMD, SSD, Arch Linux.\n\n \n\n\n# Use\n\n```python\nimport faster_than_csv as csv\n\ncsv.csv2list(\"example.csv\") # See Docs for more info.\n # Custom Separators supported.\ncsv.csv2json(\"example.csv\", indentation=4) # CSV to JSON, Pretty-Printed.\n\ncsv.csv2htmltable(\"example.csv\") # CSV to HTML+CSS Table (No JavaScript).\n\ncsv.read_clipboard() # CSV from the Clipboard.\n\ncsv.diff_csvs(\"example.csv\", \"anotherfile.csv\") # Diff optimized for CSVs.\n```\n- Input: CSV, TSV, Clipboard, File, Custom.\n- Output: CSV, TSV, HTML, JSON, NDJSON, Diff, File, Custom.\n\n\n# csv2dict()\n\n\n**Description:**\nTakes a path of a CSV file string, process CSV and returns a list of dictionaries.\nThis is very similar to `pandas.read_csv(filename)`.\n\n**Arguments:**\n- `csv_file_path` path of the CSV file, `str` type, required, must not be empty string.\n- `has_header` Set to `True` for CSV with Header, `bool` type, optional, defaults to `True`.\n- `separator` Separator character of the CSV data, `str` type, optional, defaults to `','`, must not be empty string.\n- `quote` Quote character of the CSV data, `str` type, optional, defaults to `'\"'`, must not be empty string.\n- `skipInitialSpace` Set to `True` to ignore empty blank whitespace at the start of the CSV file, `bool` type, optional, defaults to `False` since is not technically valid.\n\n**Returns:**\nData from the CSV, `dict` type.\n\n \n\n\n# read_clipboard()\n\n\n**Description:**\nReads CSV string from Clipboard, process CSV and returns a list of dictionaries.\nThis is very similar to `pandas.read_clipboard()`. This works on Linux, Mac, Windows.\n\n**Arguments:**\n- `has_header` Set to `True` for CSV with Header, `bool` type, optional, defaults to `True`.\n- `separator` Separator character of the CSV data, `str` type, optional, defaults to `','`, must not be empty string.\n- `quote` Quote character of the CSV data, `str` type, optional, defaults to `'\"'`, must not be empty string.\n- `skipInitialSpace` Set to `True` to ignore empty blank whitespace at the start of the CSV file, `bool` type, optional, defaults to `False` since is not technically valid.\n\n**Returns:**\nData from the CSV, `dict` type.\n\n \n\n\n# csv2json()\n\n\n**Description:**\nTakes a path of a CSV file string, process CSV and returns JSON.\n\n**Arguments:**\n- `csv_file_path` path of the CSV file, `str` type, required, must not be empty string.\n- `has_header` Set to `True` for CSV with Header, `bool` type, optional, defaults to `True`.\n- `separator` Separator character of the CSV data, `str` type, optional, defaults to `','`, must not be empty string.\n- `quote` Quote character of the CSV data, `str` type, optional, defaults to `'\"'`, must not be empty string.\n- `skipInitialSpace` Set to `True` to ignore empty blank whitespace at the start of the CSV file, `bool` type, optional, defaults to `False` since is not technically valid.\n- `indentation` Pretty-Printed or Minified JSON output, `int` type, optional, `0` is Minified, `4` is Pretty-Printed, you can use any integer to adjust the indentation.\n\n**Returns:**\nData from the CSV as JSON Minified Single-line string computer-friendly, `str` type.\n\n \n\n\n# csv2ndjson()\n\n\n**Description:**\nTakes a path of a CSV file string, process CSV and returns NDJSON.\n\n**Arguments:**\n- `csv_file_path` path of the CSV file, `str` type, required, must not be empty string.\n- `ndjson_file_path` path of the NDJSON file, `str` type, required, must not be empty string.\n- `has_header` Set to `True` for CSV with Header, `bool` type, optional, defaults to `True`.\n- `separator` Separator character of the CSV data, `str` type, optional, defaults to `','`, must not be empty string.\n- `quote` Quote character of the CSV data, `str` type, optional, defaults to `'\"'`, must not be empty string.\n- `skipInitialSpace` Set to `True` to ignore empty blank whitespace at the start of the CSV file, `bool` type, optional, defaults to `False` since is not technically valid.\n\n**Returns:** None.\nData from the CSV as NDJSON https://github.com/ndjson/ndjson-spec, `str` type.\n\n \n\n\n# csv2htmltable()\n\n\n**Description:**\nTakes a path of a CSV file string, process CSV and returns the data rendered on HTML Table.\n\n**Arguments:**\n- `csv_file_path` path of the CSV file, `str` type, required, must not be empty string.\n- `has_header` Set to `True` for CSV with Header, `bool` type, optional, defaults to `True`.\n- `separator` Separator character of the CSV data, `str` type, optional, defaults to `','`, must not be empty string.\n- `quote` Quote character of the CSV data, `str` type, optional, defaults to `'\"'`, must not be empty string.\n- `skipInitialSpace` Set to `True` to ignore empty blank whitespace at the start of the CSV file, `bool` type, optional, defaults to `False` since is not technically valid.\n\n**Returns:**\nData from the CSV as HTML Table, `str` type, raw HTML (no style at all).\n\n \n\n\n# csv2htmlfile()\n\n\n**Description:**\nTakes a path of a CSV file string, process CSV and returns the data rendered on HTML Table.\n\n**Arguments:**\n- `csv_file_path` path of the CSV file, `str` type, required, must not be empty string.\n- `csv_file_path` path of the HTML file, `str` type, required, must not be empty string.\n- `has_header` Set to `True` for CSV with Header, `bool` type, optional, defaults to `True`.\n- `separator` Separator character of the CSV data, `str` type, optional, defaults to `','`, must not be empty string.\n- `quote` Quote character of the CSV data, `str` type, optional, defaults to `'\"'`, must not be empty string.\n- `skipInitialSpace` Set to `True` to ignore empty blank whitespace at the start of the CSV file, `bool` type, optional, defaults to `False` since is not technically valid.\n\n**Returns:**\nData from the CSV as HTML Table, `str` type, [human-friendly, ready for display (basic style so is usable).](http://htmlpreview.github.io/?https://raw.githubusercontent.com/juancarlospaco/faster-than-csv/master/example/sample.html)\n\n \n\n\n# csv2tsv()\n\n\n**Description:**\nTakes a path of a CSV file string, process CSV and returns a TSV.\n\n**Arguments:**\n- `csv_file_path` path of the CSV file, `str` type, required, must not be empty string.\n- `has_header` Set to `True` for CSV with Header, `bool` type, optional, defaults to `True`.\n- `separator` Separator character of the CSV data, `str` type, optional, defaults to `','`, must not be empty string.\n- `quote` Quote character of the CSV data, `str` type, optional, defaults to `'\"'`, must not be empty string.\n- `skipInitialSpace` Set to `True` to ignore empty blank whitespace at the start of the CSV file, `bool` type, optional, defaults to `False` since is not technically valid.\n\n**Returns:**\nData from the CSV as TSV, `str` type.\n\n \n\n\n# csv2custom()\n\n\n**Description:**\nTakes a path of a CSV file string, process CSV and returns the data rendered as Custom formatted values.\n\n**Arguments:**\n- `csv_file_path` path of the CSV file, `str` type, required, must not be empty string.\n- `has_header` Set to `True` for CSV with Header, `bool` type, optional, defaults to `True`.\n- `separator` Separator character of the CSV data, `str` type, optional, defaults to `','`, must not be empty string.\n- `quote` Quote character of the CSV data, `str` type, optional, defaults to `'\"'`, must not be empty string.\n- `skipInitialSpace` Set to `True` to ignore empty blank whitespace at the start of the CSV file, `bool` type, optional, defaults to `False` since is not technically valid.\n\nExamples:\n\n- `csv2custom(separator=\"\ud83d\udca9\")` :arrow_right: Poo Separated Values.\n\n**Returns:**\nData from the CSV as Custom formatted values, `str` type.\n\n \n\n\n# diff_csvs()\n\n\n**Description:**\nTakes 2 paths of 2 CSV files, process CSV and returns the Diff of the 2 CSV.\n\n**Arguments:**\n- `csv_file_path0` path of the CSV file, `str` type, required, must not be empty string.\n- `csv_file_path1` path of the CSV file, `str` type, required, must not be empty string.\n\n**Returns:** Diff.\n\n \n\n\n[**For more Examples check the Examples and Tests.**](https://github.com/juancarlospaco/faster-than-csv/blob/master/examples/example.py)\n\nInstead of having a pair of functions with a lot of arguments that you should provide to make it work,\nwe have tiny functions with very few arguments that do one thing and do it as fast as possible.\n\n\n# Install\n\n- `pip install faster_than_csv`\n\n\n# Docker\n\n- Make a quick test drive on Docker!.\n\n```bash\n$ ./build-docker.sh\n$ ./run-docker.sh\n$ ./run-benchmark.sh # Inside Docker.\n```\n\n\n# Dependencies\n\n- **None**\n\n\n# Platforms\n\n- \u2705 Linux\n- \u2705 Windows\n- \u2705 Mac\n- \u2705 Android\n- \u2705 Raspberry Pi\n- \u2705 BSD\n\n\n# Requisites\n\n- Python 3.\n- GCC.\n- 64 Bit.\n\n\n# Windows\n\n- If installation fails on Windows, just use the Source Code:\n\n\n\n- Git Clone and Compile on Windows 10 on just 2 commands!.\n- [Alternatively you can try Docker for Windows.](https://docs.docker.com/docker-for-windows)\n- **The file extension must be `.pyd`, NOT `.dll`.**\n\n\n# FAQ\n\n- Whats the idea, inspiration, reason, etc ?.\n\n[Feel free to Fork, Clone, Download, Improve, Reimplement, Play with this Open Source. Make it 10 times faster, 10 times smaller.](http://tonsky.me/blog/disenchantment)\n\n- This requires Cython ?.\n\nNo.\n\n- This runs on PyPy ?.\n\nNo.\n\n- This runs on Python2 ?.\n\nI dunno. (Not supported)\n\n- Developer Documentation ?.\n\n[Yes.](https://github.com/juancarlospaco/faster-than-csv/raw/master/faster_than_csv_DOCS.zip)\n(Zip because GitHub marks the Repo as being JavaScript)\n\n- How can I Install it ?.\n\nhttps://github.com/juancarlospaco/faster-than-csv/releases\n\nIf you dont understand how to install it, you can just download, extract, put the files on the same folder as your `*.py` file and you are good to go.\n\n- How can be faster than NumPy ?.\n\nI dunno.\n\n- How can be faster than Pandas ?.\n\nI dunno.\n\n- Why needs 64Bit ?.\n\nMaybe it works on 32Bit, but is not supported, integer sizes are too small, and performance can be worse.\n\n- Why needs Python 3 ?.\n\nMaybe it works on Python 2, but is not supported, and performance can be worse, we suggest to migrate to Python3.\n\n- Can I wrap the functions on a `try: except:` block ?.\n\nFunctions do not have internal `try: except:` blocks,\nso you can wrap them inside `try: except:` blocks if you need very resilient code.\n\n- PIP fails to install or fails build the wheel ?.\n\nAdd at the end of the PIP install command:\n\n` --isolated --disable-pip-version-check --no-cache-dir --no-binary :all: `\n\nNot my Bug.\n\n- How to Build the project ?.\n\n`build.sh`\n\n- How to Package the project ?.\n\n`package.sh`\n\n- This requires Nimble ?.\n\nNo.\n\n- Whats the unit of measurement for speed ?.\n\nUnmmodified raw output of Python `timeit` module.\n\nPlease send Pull Request to Python to improve the output of `timeit`.",
"description_content_type": "text/markdown",
"docs_url": null,
"download_url": "https://github.com/juancarlospaco/faster-than-csv/releases",
"downloads": {
"last_day": -1,
"last_month": -1,
"last_week": -1
},
"home_page": "https://github.com/juancarlospaco/faster-than-csv#faster-than-csv",
"keywords": "python3,cpython,speed,csv",
"license": "MIT",
"maintainer": "Juan Carlos",
"maintainer_email": "juancarlospaco@gmail.com",
"name": "faster-than-csv",
"package_url": "https://pypi.org/project/faster-than-csv/",
"platform": "Linux",
"project_url": "https://pypi.org/project/faster-than-csv/",
"project_urls": {
"Bugs": "https://github.com/juancarlospaco/faster-than-csv/issues",
"CoC": "https://github.com/juancarlospaco/faster-than-csv/blob/master/CODE_OF_CONDUCT.md",
"Docs": "https://github.com/juancarlospaco/faster-than-csv#faster-than-csv",
"Download": "https://github.com/juancarlospaco/faster-than-csv/releases",
"Homepage": "https://github.com/juancarlospaco/faster-than-csv#faster-than-csv"
},
"release_url": "https://pypi.org/project/faster-than-csv/0.9/",
"requires_dist": null,
"requires_python": ">3.6",
"summary": "Faster & simpler CSV replacement for Python.",
"version": "0.9"
},
"last_serial": 5794233,
"releases": {
"0.1": [
{
"comment_text": "",
"digests": {
"md5": "e583e160df2a7ef7af0f7d4cf1f8f95b",
"sha256": "be0056fd9c8597d12338a964673276706576deaa5e1ceaffdf798bb5958b9b6b"
},
"downloads": -1,
"filename": "faster_than_csv-0.1.zip",
"has_sig": false,
"md5_digest": "e583e160df2a7ef7af0f7d4cf1f8f95b",
"packagetype": "sdist",
"python_version": "source",
"requires_python": null,
"size": 133472,
"upload_time": "2019-01-04T04:10:30",
"url": "https://files.pythonhosted.org/packages/e9/e8/30ceff9965028a3886e5981da49fd5cb131f1a91990aac5f09e38747fe24/faster_than_csv-0.1.zip"
}
],
"0.9": [
{
"comment_text": "",
"digests": {
"md5": "b8bb911525ca46e9230965722f21293d",
"sha256": "bffa8df470a81502505de387a3c560779054d3fee73cb9676a6b9f55e6945d54"
},
"downloads": -1,
"filename": "faster_than_csv-0.9.zip",
"has_sig": false,
"md5_digest": "b8bb911525ca46e9230965722f21293d",
"packagetype": "sdist",
"python_version": "source",
"requires_python": ">3.6",
"size": 181086,
"upload_time": "2019-09-06T22:33:49",
"url": "https://files.pythonhosted.org/packages/21/b2/dd9f921f08132a3d25359edc49f44f70f652311bf285292cf2eeb1ff4157/faster_than_csv-0.9.zip"
}
]
},
"urls": [
{
"comment_text": "",
"digests": {
"md5": "b8bb911525ca46e9230965722f21293d",
"sha256": "bffa8df470a81502505de387a3c560779054d3fee73cb9676a6b9f55e6945d54"
},
"downloads": -1,
"filename": "faster_than_csv-0.9.zip",
"has_sig": false,
"md5_digest": "b8bb911525ca46e9230965722f21293d",
"packagetype": "sdist",
"python_version": "source",
"requires_python": ">3.6",
"size": 181086,
"upload_time": "2019-09-06T22:33:49",
"url": "https://files.pythonhosted.org/packages/21/b2/dd9f921f08132a3d25359edc49f44f70f652311bf285292cf2eeb1ff4157/faster_than_csv-0.9.zip"
}
]
}