https://github.com/alexprengere/pastepy
A pure Python paste implementation
https://github.com/alexprengere/pastepy
Last synced: about 1 month ago
JSON representation
A pure Python paste implementation
- Host: GitHub
- URL: https://github.com/alexprengere/pastepy
- Owner: alexprengere
- License: apache-2.0
- Created: 2014-06-17T13:34:21.000Z (over 11 years ago)
- Default Branch: master
- Last Pushed: 2016-09-24T07:23:31.000Z (about 9 years ago)
- Last Synced: 2025-01-14T10:18:40.092Z (9 months ago)
- Language: Python
- Size: 7.81 KB
- Stars: 1
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
pastepy
=======
This is kind of a pure Python `paste` implementation.Installation
------------
`docopt` is needed, so:
```bash
$ sudo pip install docopt
```Examples
--------
Let's take two simple CSV files:
```bash
$ cat a.csv
a,b,1
a,c,2
$ cat b.csv
a,b,6
d,c,7
```
Try to paste them together given the first two fields as keys (hence the `0,1`):
```bash
$ python paste.py a.csv ',' 0,1 b.csv ',' 0,1
a,b;1;6
```
The `--complete` option fills data not present in all files with empty strings:
```bash
$ python paste.py a.csv ',' 0,1 b.csv ',' 0,1 --complete
a,b;1;6
d,c;;7
a,c;2;
```More
----
You can paste more than 2 files together!
Indeed you can add other triplets of ` `:
```bash
$ python paste.py -h
Usage:
pastepy ( )... [options]
pastepy (-h | --help)
pastepy --versionArguments
The file to be pasted
The line delimiter for that file
The indices of the fields for the key, separated by ','Options:
-h --help Show this screen.
--version Show version.
-d , --delimiter Change delimiter for output [default: ,].
-c, --complete If paste is not possible, add empty strings.```