/docs/index.rst

https://github.com/onyxfish/csvkit · ReStructuredText · 111 lines · 67 code · 44 blank · 0 comment · 0 complexity · 81e3a9addfe219d262e811fc3ff27bf8 MD5 · raw file

  1. ================
  2. csvkit |release|
  3. ================
  4. About
  5. =====
  6. .. include:: ../README.rst
  7. First time? See :doc:`tutorial`.
  8. .. note::
  9. To change the field separator, line terminator, etc. of the **output**, you must use :doc:`/scripts/csvformat`.
  10. .. note::
  11. csvkit, by default, `sniffs <https://docs.python.org/3.5/library/csv.html#csv.Sniffer>`_ CSV formats (it deduces whether commas, tabs or spaces delimit fields, for example), and performs type inference (it converts text to numbers, dates, booleans, etc.). These features are useful and work well in most cases, but occasional errors occur. If you don't need these features, set :code:`--snifflimit 0` (:code:`-y 0`) and :code:`--no-inference` (:code:`-I`).
  12. .. note::
  13. If you need to do more complex data analysis than csvkit can handle, use `agate <https://github.com/wireservice/agate>`_. If you need csvkit to be faster or to handle larger files, you may be reaching the limits of csvkit. Consider loading the data into SQL, or using `xsv <https://github.com/BurntSushi/xsv>`_.
  14. Why csvkit?
  15. ===========
  16. Because it makes your life easier.
  17. Convert Excel to CSV::
  18. in2csv data.xls > data.csv
  19. Convert JSON to CSV::
  20. in2csv data.json > data.csv
  21. Print column names::
  22. csvcut -n data.csv
  23. Select a subset of columns::
  24. csvcut -c column_a,column_c data.csv > new.csv
  25. Reorder columns::
  26. csvcut -c column_c,column_a data.csv > new.csv
  27. Find rows with matching cells::
  28. csvgrep -c phone_number -r "555-555-\d{4}" data.csv > new.csv
  29. Convert to JSON::
  30. csvjson data.csv > data.json
  31. Generate summary statistics::
  32. csvstat data.csv
  33. Query with SQL::
  34. csvsql --query "select name from data where age > 30" data.csv > new.csv
  35. Import into PostgreSQL::
  36. csvsql --db postgresql:///database --insert data.csv
  37. Extract data from PostgreSQL::
  38. sql2csv --db postgresql:///database --query "select * from data" > new.csv
  39. And much more...
  40. Table of contents
  41. =================
  42. .. toctree::
  43. :maxdepth: 3
  44. tutorial
  45. cli
  46. tricks
  47. contributing
  48. release
  49. license
  50. changelog
  51. Citation
  52. ========
  53. When citing csvkit in publications, you may use this BibTeX entry::
  54. @Manual{,
  55. title = {csvkit},
  56. author = {Christopher Groskopf and contributors},
  57. year = 2016,
  58. url = {https://csvkit.readthedocs.org/}
  59. }
  60. Authors
  61. =======
  62. .. include:: ../AUTHORS.rst
  63. Indices and tables
  64. ==================
  65. * :ref:`genindex`
  66. * :ref:`modindex`
  67. * :ref:`search`