Skip to content

Commit b751d35

Browse files
committed
Document FCopy
1 parent b23daba commit b751d35

File tree

2 files changed

+27
-2
lines changed

2 files changed

+27
-2
lines changed

README.md

Lines changed: 21 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,9 +4,28 @@
44

55
These are tools that can be used for different data analysis tasks.
66

7-
# GIT
7+
# Networking
88

9-
## Pushing
9+
## Transferring data through SSH
10+
11+
A small wrapper to rsync is show below:
12+
13+
````python
14+
from dmu import FCopy
15+
16+
fcp = FCopy(source='userA@serverA', target='userB@serverB')
17+
fcp.copy(source='/home/userA/path/file1', target='/home/userB/path/file1')
18+
````
19+
20+
This will copy a file given the paths, from one server to another.
21+
22+
- The connection must be possible without passwords, i.e. with key pairs
23+
- By default source and target in initializer are empty strings and the
24+
files are assumed to be local
25+
26+
One instance of `FCopy` is meant to be used to transfer multiple files.
27+
28+
## Publishing packages
1029

1130
From the root directory of a version controlled project (i.e. a directory with the `.git` subdirectory)
1231
using a `pyproject.toml` file, run:

src/dmu/fsystem/fcopy.py

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,12 +18,18 @@ class FCopy:
1818
1919
Usage:
2020
21+
````
22+
from dmu import FCopy
23+
2124
fcp = FCopy(source='userA@serverA', target='userB@serverB')
2225
fcp.copy(source='/home/userA/path/file1', target='/home/userB/path/file1')
26+
````
2327
2428
Will copy a file given the paths, from one server to another.
2529
2630
The connection must be possible without passwords, i.e. with key pairs
31+
By default source and target in initializer are empty strings and the
32+
files are assumed to be local
2733
'''
2834
# ----------------------
2935
def __init__(self, source : str = '', target : str = ''):

0 commit comments

Comments
 (0)