https://github.com/slub/addid
adds (url-safe) base64 encoded ids (without padding) to given finc Solr schema conform line-delimited JSON
https://github.com/slub/addid
base64 cli command-line-tool finc-solr-schema json line-delimited-json
Last synced: about 1 month ago
JSON representation
adds (url-safe) base64 encoded ids (without padding) to given finc Solr schema conform line-delimited JSON
- Host: GitHub
- URL: https://github.com/slub/addid
- Owner: slub
- License: apache-2.0
- Created: 2017-11-15T12:29:56.000Z (over 8 years ago)
- Default Branch: master
- Last Pushed: 2018-02-09T14:46:49.000Z (over 8 years ago)
- Last Synced: 2025-03-20T05:28:52.598Z (over 1 year ago)
- Topics: base64, cli, command-line-tool, finc-solr-schema, json, line-delimited-json
- Language: Python
- Size: 8.79 KB
- Stars: 2
- Watchers: 6
- Forks: 2
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# addid
adds (url-safe) base64 encoded ids (without padding) to given finc Solr schema conform line-delimited JSON
adds "id" field to given finc Solr schema conform line delimited JSON, whereby the ID will be constructed with following pattern:
[PREFIX]-[SOURCE ID]-[RECORD ID]
* PREFIX will be taken from the parameter "-prefix"
* SOURCE ID will be taken from field "source_id" of the JSON record
* RECOURD ID will be taken from field "record_id" of the JSON record
## requirements
* [argparse](https://docs.python.org/3/library/argparse.html#module-argparse)
### install requirements
1. (optionally) install [pip](https://pip.pypa.io/) for Python 3.x:
sudo apt-get install python3-pip
2. install requirements with pip:
sudo -H pip3 install -r requirements.txt
## usage
addid.py -prefix [PREFIX] < [INPUT FINC SOLR SCHEMA CONFORM LINE-DELIMITED JSON] > [OUTPUT ENHANCED FINC SOLR SCHEMA CONFORM LINE-DELIMITED JSON]
(default prefix is "dswarm")