data-duper
data-duper is a tool to replicate the structure of private or protected data for testing.
What does it solve?
When testing the data handling of software, it is best to use data as similar to the real data as possible - without revealing sensitive information to the test environment. This is where data-duper comes into play. It allows you to create an authentic replicate of your private or protected data.
How to get it?
The source code is currently hosted on GitHub at: https://github.com/kjanker/data-duper.
Binary installers for the latest released version are available at the Python Package Index (PyPI).
What does it do?
data-duper works like a learning model. You train the duper on your real data and, afterwards, generate a new data set of arbitrary size. The new data set - or dupe - has the same structure as the real data, i.e., columns, dtypes, as well as string composition and distribution of numerical values. Occurrences of NA values are ignored by default but can optionally be included as well.
Methods
- numerical values (float, int, datetime) are drawn from an interpolated empirical distribution
- identifier strings of fixed length and structure are replicated with regular expressions
- features with only few values (category, bool) are redrawn according to their occurrence
Limitations
- value distributions are replicated as draw probability. Thus, for small dupe sets the realized distribution may differ slightly
- correlations between columns are not replicated (this ensures real data is better obscured)
- descriptive strings like notes, names, etc are not obscured but reshuffled
How can I use it?
You simply initialize a new Duper instance, fit it on your real data df_real, and make a data dupe df_dupe of desired size n.
from duper import Duper
duper = Duper()
duper.fit(df=df_real)
df_dupe = duper.make(size=10000)
Open issues
- include optional correlations between selected rows
- improve algorithm of regex duper
Get in touch
Don't hesitate to contact me if you like the idea and want to get in touch.
Metadata
Release files for data-duper 0.1.1
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | |
|---|---|---|---|---|
| data-duper-0.1.1.tar.gz | 9.1 kB | Without provenance | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| data_duper-0.1.1-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 20.9 kB
Release files / data-duper-0.1.1.tar.gz
| Download URL | data-duper-0.1.1.tar.gz |
|---|---|
| Size | 9.1 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
cd9dde55291a3bc0a432b62b32faaba993b664e7a0c3216bfe36339c7f9c3830
|
|
BLAKE2b-256 checksum How to use checksums |
58fed82367793e769277a64301c165bde6f4c4e233217a9f070b5b27486c1710
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/3.7.1 importlib_metadata/4.8.2 pkginfo/1.8.2 requests/2.26.0 requests-toolbelt/0.9.1 tqdm/4.62.3 CPython/3.8.1
|
Release files / data_duper-0.1.1-py3-none-any.whl
| Download URL | data_duper-0.1.1-py3-none-any.whl |
|---|---|
| Size | 11.8 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
df760e0c2d4aa1501d1aed19210d348b611727d0488fc95f2405bc0aa133d065
|
|
BLAKE2b-256 checksum How to use checksums |
e6a6c400932c519f6724431521082804dbb62dd45c64d63ad8cd4c9f2453b4ae
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/3.7.1 importlib_metadata/4.8.2 pkginfo/1.8.2 requests/2.26.0 requests-toolbelt/0.9.1 tqdm/4.62.3 CPython/3.8.1
|
Security for data-duper 0.1.1
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.