Selectively hash, drop, or keep fields from a flat file (e.g. CSV).
Project description
hashfields
Selectively hash, drop, or keep fields from a flat file (e.g. CSV).
Install with pip
:
pip install hashfields
Or visit the Releases page for pre-built, self-contained executables.
Example
Given this input CSV:
column1,column2,column3,column4
r1c1,r1c2,r1c3,r1c4
r2c1,r2c2,r2c3,r2c4
r3c1,r3c2,r3c3,r3c4
r4c1,r4c2,r4c3,r4c4
And this configuration:
SHA256
hash algorithm- drop
column1
,column3
- skip
column2
E.g.
echo "column1,column2,column3,column4
r1c1,r1c2,r1c3,r1c4
r2c1,r2c2,r2c3,r2c4
r3c1,r3c2,r3c3,r3c4
r4c1,r4c2,r4c3,r4c4" | hashfields --alg sha256 --drop column1 column3 --skip column2
hashfields
produces this CSV:
column2,column4
r1c2,fb66e41761a74ea0c042e1c226c04fa2ce1a1334d7063d86230d17f33f109b68
r2c2,6051c006caee661a6ccb390b8cf7a43230c5cd7b54861f7306a598b612f924b9
r3c2,7e32c53b7729f5dce7ac54232b7f2d93d6c78ed19fc8d096b0fde948f513e9dc
r4c2,f8d0624d128daf97c61ec28f4396e8f14be2ca2940d18fdf33e939cda9bd1824
See https://docs.calitp.org/hashfields for more details.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
hashfields-2023.9.1.tar.gz
(875.2 kB
view details)
Built Distribution
File details
Details for the file hashfields-2023.9.1.tar.gz
.
File metadata
- Download URL: hashfields-2023.9.1.tar.gz
- Upload date:
- Size: 875.2 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.1 CPython/3.9.18
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 434eea7fc025df6125ff68611f57f7a426dbff1e938231945829bd49928614eb |
|
MD5 | a1d5bd54972baccd2f43fb494442c420 |
|
BLAKE2b-256 | 5400e10479c8b582af78b1e847bda7d9558fde76925341ab0ae0e90e0d7b9719 |
File details
Details for the file hashfields-2023.9.1-py3-none-any.whl
.
File metadata
- Download URL: hashfields-2023.9.1-py3-none-any.whl
- Upload date:
- Size: 12.7 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.1 CPython/3.9.18
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 9dc80b6cf8fdd817b513e615a03ebb8fbb355df5fd77b8e58bab69f6ad76f226 |
|
MD5 | 75f6333b3d12a7010aee3aa914f3677d |
|
BLAKE2b-256 | cf46829e79c93f2c3651df48fd846bb16701ef9866921ec349254616b1ca7895 |