From 63e6f2556b975ceadfc9f4a3ffb75b33cd79c03c Mon Sep 17 00:00:00 2001 From: Henning Kage Date: Tue, 13 Jul 2021 09:06:25 +0200 Subject: [PATCH 1/5] Fixed the README notes --- README.rst | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/README.rst b/README.rst index 215bfeb..e8d6d71 100644 --- a/README.rst +++ b/README.rst @@ -43,8 +43,8 @@ Features | ``uuid_col`` | 00010203-0405-...... | ``uuid4`` | f7c1bd87-4d.... | +----------------+----------------------+-------------------------+----------------------------------+ -Note: `faker.unique.[provider]` only supported on python3.5+ (Faker library min supported python version) -Note: `uuid4` - only for (native `uuid4`) columns +* Note: ``faker.unique.[provider]`` only supported on python3.5+ (Faker library min supported python version) +* Note: ``uuid4`` - only for (native `uuid4`_) columns See the `documentation`_ for a more detailed description of the provided anonymization methods. @@ -161,6 +161,7 @@ After that you can pass a schema file to the container, using Docker volumes, an -v +.. _uuid4: https://www.postgresql.org/docs/current/datatype-uuid.html .. _documentation: https://python-postgresql-anonymizer.readthedocs.io/en/latest/ .. _schema documentation: https://python-postgresql-anonymizer.readthedocs.io/en/latest/schema.html .. _YAML sample schema: https://github.com/rheinwerk-verlag/postgresql-anonymizer/blob/master/sample_schema.yml From fa78131aac647a2aca6c892b59cb590b25f4150b Mon Sep 17 00:00:00 2001 From: Henning Kage Date: Tue, 13 Jul 2021 09:07:21 +0200 Subject: [PATCH 2/5] Updated the README --- README.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.rst b/README.rst index e8d6d71..db690fc 100644 --- a/README.rst +++ b/README.rst @@ -43,7 +43,7 @@ Features | ``uuid_col`` | 00010203-0405-...... | ``uuid4`` | f7c1bd87-4d.... | +----------------+----------------------+-------------------------+----------------------------------+ -* Note: ``faker.unique.[provider]`` only supported on python3.5+ (Faker library min supported python version) +* Note: ``faker.unique.[provider]`` only supported on Python 3.5+ (Faker library min. supported python version) * Note: ``uuid4`` - only for (native `uuid4`_) columns See the `documentation`_ for a more detailed description of the provided anonymization methods. From 13fd10baf44b8f3373cd52a47b6f8fce7d226431 Mon Sep 17 00:00:00 2001 From: Henning Kage Date: Tue, 13 Jul 2021 09:21:52 +0200 Subject: [PATCH 3/5] Updated the schema documentation --- docs/schema.rst | 28 +++++++++++++++++++++++++++- 1 file changed, 27 insertions(+), 1 deletion(-) diff --git a/docs/schema.rst b/docs/schema.rst index c223f3a..ee841db 100644 --- a/docs/schema.rst +++ b/docs/schema.rst @@ -260,7 +260,10 @@ This provider will replace each character with a static sign. ``md5`` ~~~~~~~ -**Arguments:** none +**Arguments:** + +* ``as_number`` (default ``False``): Return the MD5 hash as an integer. +* ``as_number_length`` (default 8): The length of the integer representation. This provider will hash the given field value with the MD5 algorithm. @@ -272,6 +275,7 @@ This provider will hash the given field value with the MD5 algorithm. - password: provider: name: md5 + as_number: True ``set`` @@ -301,5 +305,27 @@ The value can also be a dictionary for JSONB columns:: name: set value: '{"foo": "bar", "baz": 1}' + +``uuid4`` +~~~~~~~~~ + +**Arguments:** none + +This provider will replace values with a unique UUID4. + +.. note:: + The provider will only generate `native UUIDs`_. If you want to use UUIDs for character based columns, use + ``fake.uuid4`` instead. + +**Example usage**:: + + tables: + - auth_user: + fields: + - first_name: + provider: + name: uuid4 + .. _Faker: https://github.com/joke2k/faker .. _Faker documentation: http://faker.rtfd.org/ +.. _native UUIDs: https://www.postgresql.org/docs/current/datatype-uuid.html From e4242228538fa8d30c9abdb6c0cb7f9b1516ba01 Mon Sep 17 00:00:00 2001 From: Henning Kage Date: Tue, 13 Jul 2021 10:06:42 +0200 Subject: [PATCH 4/5] Added missing install_require entries for the setup.py --- setup.py | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/setup.py b/setup.py index b66266e..e3fed64 100755 --- a/setup.py +++ b/setup.py @@ -42,10 +42,11 @@ def run(self): install_requires = [ 'faker', - 'six', - 'progress', + 'parmap', + 'pgcopy', 'psycopg2', - 'pyyaml' + 'pyyaml', + 'tqdm' ] tests_require = [ @@ -71,7 +72,7 @@ def run(self): url='https://github.com/rheinwerk-verlag/postgresql-anonymizer', license='MIT license', classifiers=[ - 'Development Status :: 2 - Pre-Alpha', + 'Development Status :: 3 - Alpha', 'Intended Audience :: Developers', 'License :: OSI Approved :: MIT License', 'Operating System :: POSIX', From 0b811fb0a31d41783d507713528015bcc053b5e7 Mon Sep 17 00:00:00 2001 From: Henning Kage Date: Tue, 13 Jul 2021 11:04:23 +0200 Subject: [PATCH 5/5] Updated version to 0.6.1 --- CHANGELOG.md | 4 ++++ pganonymizer/version.py | 2 +- pyproject.toml | 2 +- 3 files changed, 6 insertions(+), 2 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 1dbe8ec..a69ee75 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,6 +2,10 @@ ## Development +## 0.6.1 (2021-07-13) + +* Added missing dependencies for the `setup.py` + ## 0.6.0 (2021-07-13) * [#28](https://github.com/rheinwerk-verlag/postgresql-anonymizer/pull/25): Add json support ([nurikk](https://github.com/nurikk)) diff --git a/pganonymizer/version.py b/pganonymizer/version.py index 1ab444e..20a8456 100644 --- a/pganonymizer/version.py +++ b/pganonymizer/version.py @@ -1,3 +1,3 @@ # -*- coding: utf-8 -*- -__version__ = '0.6.0' +__version__ = '0.6.1' diff --git a/pyproject.toml b/pyproject.toml index ce1844f..f564850 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,6 +1,6 @@ [tool.poetry] name = "postgresql-anonymizer" -version = "0.6.0" +version = "0.6.1" description = "Commandline tool to anonymize PostgreSQL databases" authors = [ "Henning Kage "