You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+42-1Lines changed: 42 additions & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -17,10 +17,16 @@ Both of these dependencies can be installed via `pip` using
17
17
sudo pip install -r requirements.txt
18
18
```
19
19
20
+
Alternatively, users can install Git-RDM and its dependencies with [Conda](http://conda.pydata.org/); see the details in the next section.
21
+
20
22
Note that once PyRDM is installed, you will need to setup Figshare/Zenodo authentication tokens and copy them into the PyRDM configuration file in order to publish your data. See the [PyRDM documentation](https://pyrdm.readthedocs.io/en/latest/getting_started.html) for instructions on how to do this.
21
23
22
24
## Installing
23
25
26
+
Git-RDM can either be installed from source, or via Conda packages; see the appropriate sub-section for more details. Once Git-RDM is installed, Git should automatically detect the plugin and recognise the `rdm` command; for example, run `git rdm -h` to list the RDM-related subcommands described in the Usage section below.
27
+
28
+
### From source
29
+
24
30
After downloading or cloning this software using
25
31
26
32
```
@@ -39,7 +45,25 @@ and running
39
45
sudo python setup.py install
40
46
```
41
47
42
-
Once Git-RDM is installed, Git should automatically detect the plugin and recognise the `rdm` command; for example, run `git rdm -h` to list the RDM-related subcommands described in the Usage section below.
48
+
Alternatively, a local user installation can be achieved using
The full publication record maintained by the data repository service can be shown using `git rdm show`. It expects two arguments: the name of the hosting service (`figshare` or `zenodo`) and the publication ID. For example, for the publication whose Figshare publication ID is 3428222 (and DOI is `10.6084/m9.figshare.3428222`), the (truncated) output is:
@@ -177,6 +212,12 @@ git-rdm INFO: {
177
212
## License
178
213
This software is released under the MIT license. See the file called `LICENSE` for more information.
179
214
215
+
## Citing
216
+
217
+
If you use Git-RDM during the course of your research, please consider citing the following paper:
218
+
219
+
* C. T. Jacobs, A. Avdis (Under Review). Git-RDM: A research data management plugin for the Git version control system. *Journal of Open Source Software*.
220
+
180
221
## Contact
181
222
Please send any questions or comments about Git-RDM via email to [Christian Jacobs](http://christianjacobs.uk) at <[email protected]>.
Copy file name to clipboardExpand all lines: git-rdm
+30-6Lines changed: 30 additions & 6 deletions
Original file line number
Diff line number
Diff line change
@@ -172,15 +172,38 @@ class GitRDM:
172
172
173
173
return
174
174
175
-
defls(self, path=None, by_doi=True):
175
+
defls(self, path=None, by_doi=True, raw=False):
176
176
""" List all published files, and files to be published. If a file has multiple DOIs associated with it then they are all listed together.
177
177
178
178
:arg path: The relative/absolute path to the file to be listed.
179
179
:arg bool by_doi: List the files by DOI first (i.e. each DOI will be listed at the top level, with names of the files associated with that DOI underneath).
180
+
:arg bool raw: Print out the entire SQL database table without any formatting.
180
181
"""
181
-
182
-
self.db_connect()
183
-
182
+
183
+
self.db_connect()
184
+
185
+
# Raw database dump of all the rows
186
+
ifraw:
187
+
_LOG.info("Database dump:")
188
+
189
+
query="SELECT * FROM %s"%PUBLICATIONS_TABLE
190
+
191
+
withself.connection:
192
+
c=self.connection.cursor()
193
+
c.execute(query)
194
+
result=c.fetchall()
195
+
iflen(result) >0:
196
+
# Column names
197
+
names=list(map(lambdax: x[0], c.description))
198
+
_LOG.info(", ".join(names))
199
+
200
+
# Rows
201
+
forrinresult:
202
+
values= [str(r[name]) fornameinnames]
203
+
_LOG.info(", ".join(values))
204
+
205
+
return
206
+
184
207
# If a path is provided, then specify all the publications/DOIs associated with that path.
185
208
ifpath:
186
209
path=os.path.abspath(path) # Get the absolute path
query="SELECT * FROM %s WHERE doi IS NOT NULL ORDER BY doi"%PUBLICATIONS_TABLE
@@ -483,6 +506,7 @@ if(__name__ == "__main__"):
483
506
ls_parser=subparsers.add_parser("ls", help="List the published files, and files staged for publishing.")
484
507
ls_parser.add_argument("--path", required=False, help="The path to the file to list.", action="store", type=str, default=None)
485
508
ls_parser.add_argument("--by-doi", help="Group files by DOI.", action="store_true", default=False, dest="by_doi")
509
+
ls_parser.add_argument("--raw", help="Print out the entire SQL database table without any formatting.", action="store_true", default=False, dest="raw")
486
510
487
511
# 'git rdm publish'
488
512
publish_parser=subparsers.add_parser("publish", help="Publish the files in the publishing staging area.")
0 commit comments