aboutcode-org / aboutcode-org/scancode-toolkit

stream JSON lines output

Aperta
#3,619 2 commenti 0 reazioni 0 assegnatari Vedi su GitHub
new feature
Lingua principale
Python
Stelle
2.6k
Fork
791
Merge medio
1g 12h
PR unite (30g)
5

Descrizione

## Short Description

The current JSON lines feature doesn't write information to a file (or stdout) until scancode has completely finished. It might be useful to start writing results earlier. This should be possible (except for the aggregated information in `license_detections`) as all files are scanned independently (I suppose).

## Possible Labels

- new feature

## Select Category

- [X] Enhancement
- [ ] Add License/Copyright
- [ ] Scan Feature
- [ ] Packaging
- [ ] Documentation
- [ ] Expand Support
- [ ] Other

## **Describe the Update**

I want a JSON lines feature that starts writing results to output earlier. As every file is scanned independently this should be possible. The `license_detections` aggregated information could be written last as an "end of stream" token.

## **How This Feature will help you/your organization**

I want to be able to track progress. Also, I might want to pipe output to another program that processes scancode information without me having to wait until scancode has completely finished. This feature might also help reducing memory usage of scancode, because as soon as the data is written it can be discarded (apart from information for `license_detections`).

## **Possible Solution/Implementation Details**

Line 1: start of stream/`headers`
Line 2-n: scan results for each file
Line n+1: end of stream/`license_detections`

## **Example/Links if Any**

## **Can you help with this Feature**

Guida per i contributori

Apri la guida per i contributori

Valutazione

Questa issue non è ancora stata valutata.

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.