Skip to content

Commit 606c561

Browse files
docs: Demonstrate CLI API over running module as script (#195)
* As installation creates the executables 'bin/scikit-hep-testdata' and 'bin/skhep-testdata', demonstrate these in the README rather than running the module as a script with '-m'. - c.f. https://docs.python.org/3/using/cmdline.html#cmdoption-m * Show how to use 'uvx', 'pipx', and 'pixi exec' to be able to access and use the CLI API without having to explicitly install into an environment. * style: Remove syntax highlighting hints that don't match block language.
1 parent df3dbc8 commit 606c561

File tree

1 file changed

+28
-8
lines changed

1 file changed

+28
-8
lines changed

README.md

Lines changed: 28 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -20,13 +20,13 @@ get larger files from common open-access data repositories.
2020
## Installing and usage
2121
To install:
2222

23-
```bash
23+
```
2424
python -m pip install scikit-hep-testdata
2525
```
2626

2727
Once installed, absolute file paths can be resolved using the helper methods:
2828

29-
``` python
29+
```python
3030
from skhep_testdata import data_path
3131

3232
filename = data_path("some_file.root")
@@ -60,18 +60,38 @@ files.
6060
### Command-line invocation
6161
You can also interact with this package from the command-line:
6262

63-
```bash
63+
```
6464
# Print a path (download if needed)
65-
python -m skhep_testdata cms_hep_2012_tutorial/data.root
65+
skhep-testdata cms_hep_2012_tutorial/data.root
6666
6767
# Show all "local" files
68-
python -m skhep_testdata --list
68+
skhep-testdata --list
6969
7070
# Download all files to an existing directory
71-
python -m skhep_testdata --all --dir local
71+
skhep-testdata --all --dir local
7272
```
7373

74-
You can also use `pipx run scikit-hep-testdata` to access the above CLI without installing.
74+
Note: The `scikit-hep-testdata` and `skhep-testdata` command-line tools are the equivalent of `python -m skhep_testdata`.
75+
76+
You can also use any of the following to access the above CLI without installing.
77+
78+
* uv:
79+
80+
```
81+
uvx scikit-hep-testdata
82+
```
83+
84+
* pipx:
85+
86+
```
87+
pipx run scikit-hep-testdata
88+
```
89+
90+
* Pixi:
91+
92+
```
93+
pixi exec scikit-hep-testdata
94+
```
7595

7696

7797
## Adding new files
@@ -146,6 +166,6 @@ This project follows the [all-contributors](https://github.com/all-contributors/
146166
This package uses `pytest` to run the unit tests. Install with `pip install scikit-hep-testdata[test]` or `pip install -e .[test]` (dev) to get the testing requirements.
147167
then run:
148168

149-
```bash
169+
```
150170
pytest
151171
```

0 commit comments

Comments
 (0)