Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/main' into code_of_conduct
Browse files Browse the repository at this point in the history
  • Loading branch information
JimMadge committed Oct 13, 2023
2 parents 9a36ab8 + 1993007 commit d95f3d8
Showing 1 changed file with 24 additions and 2 deletions.
26 changes: 24 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ $ https https://raw.githubusercontent.com/uk-tre/packages/main/alan_turing_insti
```

With a local copy of the repository using `cat` and `jq`.
For example, to get a list of PyPI packages currently allowed any organisation:
For example, to get a list of PyPI packages currently allowed by any organisation:

```console
$ cat **/pypi.json | jq -s 'add | map(select(.revoke_date == null)) | [.[].package_name] | unique | .[]'
Expand All @@ -80,7 +80,7 @@ $ cat **/pypi.json | jq -s 'add | map(select(.revoke_date == null)) | [.[].packa
### Python

With a local copy of the repository using the Python standard library.
For example, to get a list of PyPI packages currently allowed any organisation:
For example, to get a list of PyPI packages currently allowed by any organisation:

```Python
import json
Expand All @@ -101,6 +101,28 @@ allowed = list(set(allowed))
print(allowed)
```

### R

With a local copy of the repository using the `jsonify` package.
For example, to get a list of PyPI packages currently allowed by any organisation:

```R
library(jsonify)
allowed <-
unique(
unlist(
lapply(
list.files(pattern = "*pypi.json", recursive = TRUE),
function(file) {
packagelist <- from_json(file)
packagelist[is.na(packagelist[["revoke_date"]]), "package_name"]
}
)
)
)
allowed
```

## Contributing

### Code of conduct
Expand Down

0 comments on commit d95f3d8

Please sign in to comment.