Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/rnelson/oxfordcsv
Oxfordize your CSV files
https://github.com/rnelson/oxfordcsv
Last synced: about 2 months ago
JSON representation
Oxfordize your CSV files
- Host: GitHub
- URL: https://github.com/rnelson/oxfordcsv
- Owner: rnelson
- License: mit
- Created: 2014-12-02T15:34:48.000Z (about 10 years ago)
- Default Branch: main
- Last Pushed: 2024-07-26T23:55:59.000Z (6 months ago)
- Last Synced: 2024-07-27T00:41:15.243Z (6 months ago)
- Language: Python
- Homepage: http://rnelson.github.io/oxfordcsv
- Size: 425 KB
- Stars: 1
- Watchers: 3
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# oxfordcsv
## About
Why use plain old CSV when you can use [Oxford CSV][tweet]?
Compatible with both Python 3. Tested on 3.9.19.
## Usage
To use _oxfordcsv_, simple pipe CSV data into it: `python3 oxfordcsv.py < infile.csv`
```
$ cat sample.csv
id,name,address,city,state
1,Alice,213 Elk St.,New York,NY
2,Bob,84924 1st Ave.,Boulder,CO
3,Cheryl,99376 Apple Pkwy. Apt. #1632,Los Angeles,CA
4,Dean,153 8th St. So.,Houston,TX
$ python3 oxfordcsv.py < sample.csv > oxford.csv
$ cat oxford.csv
id,name,address,city,and state
1,Alice,213 Elk St.,New York,and NY
2,Bob,84924 1st Ave.,Boulder,and CO
3,Cheryl,99376 Apple Pkwy. Apt. #1632,Los Angeles,and CA
4,Dean,153 8th St. So.,Houston,and TX
$
```For those on PowerShell, you can run it like this:
```
PS D:\Projects\oxfordcsv> Get-Content .\sample.csv | python.exe .\oxfordcsv.py | Out-File oxford.csv
```Do you want stricter adherence to the rules of the English language? The `-E`
argument will cause extra spaces to be added:```
$ python3 oxfordcsv.py -E < sample.csv
id, name, address, city, and state
1, Alice, 213 Elk St., New York, and NY
2, Bob, 84924 1st Ave., Boulder, and CO
3, Cheryl, 99376 Apple Pkwy. Apt. #1632, Los Angeles, and CA
4, Dean, 153 8th St. So., Houston, and TX
```## License
[MIT](https://github.com/rnelson/oxfordcsv/blob/master/LICENSE)
[tweet]: https://twitter.com/zapjackson/status/530941076492648448
[six]: https://six.readthedocs.io/