Skip to content

Commit

Permalink
Merge pull request #40 from rheinwerk-verlag/issue/39
Browse files Browse the repository at this point in the history
#39: Renamed project to "pganonymize"
  • Loading branch information
hkage authored Dec 14, 2021
2 parents bfd4c89 + a1c8c5e commit ac512e4
Show file tree
Hide file tree
Showing 27 changed files with 106 additions and 88 deletions.
2 changes: 1 addition & 1 deletion .isort.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,6 @@ line_length=120
multi_line_output=0
sections=FUTURE,STDLIB,THIRDPARTY,FIRSTPARTY,PGA,LOCALFOLDER
default_section=THIRDPARTY
known_pga=pganonymizer
known_pga=pganonymize
no_lines_before=LOCALFOLDER

29 changes: 15 additions & 14 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,15 +2,16 @@

## Development

* [#39](https://github.com/rheinwerk-verlag/pganonymize/issues/39): Renamed project to "pganonymize"
* [#38](https://github.com/rheinwerk-verlag/pganonymize/pull/38): Allow environment variables in schema definition ([nurikk](https://github.com/nurikk))

## 0.7.0 (2021-11-30)

* [#34](https://github.com/rheinwerk-verlag/postgresql-anonymizer/issues/34): Subprocess "run" being used on Python2.7
* [#35](https://github.com/rheinwerk-verlag/postgresql-anonymizer/issues/35): parmap no longer supports Python 2.7
* [#34](https://github.com/rheinwerk-verlag/pganonymize/issues/34): Subprocess "run" being used on Python2.7
* [#35](https://github.com/rheinwerk-verlag/pganonymize/issues/35): parmap no longer supports Python 2.7
* Dropped Python 3.5 support
* Pinned libraries Python 2.7
* [#32](https://github.com/rheinwerk-verlag/postgresql-anonymizer/pull/32): Fixed pg_dump arguments ([korsar182](https://github.com/korsar182))
* [#32](https://github.com/rheinwerk-verlag/pganonymize/pull/32): Fixed pg_dump arguments ([korsar182](https://github.com/korsar182))
* Simplified provider registration (no metaclass usage anymore)

## 0.6.1 (2021-07-13)
Expand All @@ -19,35 +20,35 @@

## 0.6.0 (2021-07-13)

* [#28](https://github.com/rheinwerk-verlag/postgresql-anonymizer/pull/25): Add json support ([nurikk](https://github.com/nurikk))
* [#27](https://github.com/rheinwerk-verlag/postgresql-anonymizer/pull/25): Better anonymisation ([nurikk](https://github.com/nurikk))
* [#25](https://github.com/rheinwerk-verlag/postgresql-anonymizer/pull/25): Remove column specification for `cursor.copy_from` call ([nurikk](https://github.com/nurikk))
* [#28](https://github.com/rheinwerk-verlag/pganonymize/pull/25): Add json support ([nurikk](https://github.com/nurikk))
* [#27](https://github.com/rheinwerk-verlag/pganonymize/pull/25): Better anonymisation ([nurikk](https://github.com/nurikk))
* [#25](https://github.com/rheinwerk-verlag/pganonymize/pull/25): Remove column specification for `cursor.copy_from` call ([nurikk](https://github.com/nurikk))

## 0.5.0 (2021-06-30)

* [#22](https://github.com/rheinwerk-verlag/postgresql-anonymizer/pull/22): Fix table and column name quotes in `cursor.copy_from` call ([nurikk](https://github.com/nurikk))
* [#23](https://github.com/rheinwerk-verlag/postgresql-anonymizer/pull/23): Allow uniq faker ([nurikk](https://github.com/nurikk))
* [#22](https://github.com/rheinwerk-verlag/pganonymize/pull/22): Fix table and column name quotes in `cursor.copy_from` call ([nurikk](https://github.com/nurikk))
* [#23](https://github.com/rheinwerk-verlag/pganonymize/pull/23): Allow uniq faker ([nurikk](https://github.com/nurikk))

## 0.4.1 (2021-05-27)

* [#19](https://github.com/rheinwerk-verlag/postgresql-anonymizer/pull/19): Make chunk size in the table definition dynamic ([halilkaya](https://github.com/halilkaya))
* [#19](https://github.com/rheinwerk-verlag/pganonymize/pull/19): Make chunk size in the table definition dynamic ([halilkaya](https://github.com/halilkaya))

## 0.4.0 (2021-05-05)

* [#18](https://github.com/rheinwerk-verlag/postgresql-anonymizer/pull/18): Specify (SQL WHERE) search_condition, to filter the table for rows to be anonymized ([bobslee](https://github.com/bobslee))
* [#17](https://github.com/rheinwerk-verlag/postgresql-anonymizer/pull/17): Fix anonymizing error if there is a JSONB column in a table ([koptelovav](https://github.com/koptelovav))
* [#18](https://github.com/rheinwerk-verlag/pganonymize/pull/18): Specify (SQL WHERE) search_condition, to filter the table for rows to be anonymized ([bobslee](https://github.com/bobslee))
* [#17](https://github.com/rheinwerk-verlag/pganonymize/pull/17): Fix anonymizing error if there is a JSONB column in a table ([koptelovav](https://github.com/koptelovav))

## 0.3.3 (2021-04-16)

* [#16](https://github.com/rheinwerk-verlag/postgresql-anonymizer/issues/16): Preserve column and table cases during the copy process
* [#16](https://github.com/rheinwerk-verlag/pganonymize/issues/16): Preserve column and table cases during the copy process

## 0.3.2 (2021-01-25)

* [#15](https://github.com/rheinwerk-verlag/postgresql-anonymizer/pull/15): Fix for exclude bug ([abhinavvaidya90](https://github.com/abhinavvaidya90))
* [#15](https://github.com/rheinwerk-verlag/pganonymize/pull/15): Fix for exclude bug ([abhinavvaidya90](https://github.com/abhinavvaidya90))

## 0.3.1 (2020-12-04)

* [#13](https://github.com/rheinwerk-verlag/postgresql-anonymizer/pull/13): Fixed a syntax error if no truncated tables are defined ([ray-man](https://github.com/ray-man))
* [#13](https://github.com/rheinwerk-verlag/pganonymize/pull/13): Fixed a syntax error if no truncated tables are defined ([ray-man](https://github.com/ray-man))

## 0.3.0 (2020-02-11)

Expand Down
2 changes: 1 addition & 1 deletion MANIFEST.in
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,4 @@ include LICENSE.rst
include README.rst
include CHANGELOG.md

recursive-include pganonymizer *.html *.js *.css *.png *.gif*.jpg *.jpeg *.svg *.po
recursive-include pganonymize *.html *.js *.css *.png *.gif*.jpg *.jpeg *.svg *.po
4 changes: 2 additions & 2 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
BROWSER ?= xdg-open
PYTHON_PACKAGE = pganonymizer
PYTHON_PACKAGE = pganonymize
TESTS_PACKAGE = tests

.PHONY: clean clean-test clean-pyc clean-build docs help
Expand Down Expand Up @@ -61,4 +61,4 @@ test:
@poetry run pytest --cov=poetry --cov-config .coveragerc tests/ -sq

test-all: ## run tests on every Python version with tox
@tox
@tox
17 changes: 9 additions & 8 deletions README.rst
Original file line number Diff line number Diff line change
@@ -1,9 +1,10 @@
PostgreSQL Anonymizer
=====================
pganonymize
===========

A commandline tool to anonymize PostgreSQL databases for DSGVO/GDPR purposes.

It uses a YAML file to define which tables and fields should be anonymized and provides various methods of anonymization. The tool requires a direct PostgreSQL connection to perform the anonymization.
It uses a YAML file to define which tables and fields should be anonymized and provides various methods of
anonymization. The tool requires a direct PostgreSQL connection to perform the anonymization.

.. class:: no-web no-pdf

Expand Down Expand Up @@ -136,15 +137,15 @@ If you want to run the anonymizer within a Docker container you first have to bu
.. code-block:: sh
$ docker build -t pganonymizer .
$ docker build -t pganonymize .
After that you can pass a schema file to the container, using Docker volumes, and call the anonymizer:
.. code-block:: sh
$ docker run \
-v <path to your schema>:/schema.yml \
-it pganonymizer \
-it pganonymize \
/usr/local/bin/pganonymize \
--schema=/schema.yml \
--dbname=<database> \
Expand All @@ -157,13 +158,13 @@ After that you can pass a schema file to the container, using Docker volumes, an
.. _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
.. _YAML sample schema: https://github.com/rheinwerk-verlag/pganonymize/blob/master/sample_schema.yml
.. |python| image:: https://img.shields.io/pypi/pyversions/pganonymize
:alt: PyPI - Python Version
.. |license| image:: https://img.shields.io/badge/license-MIT-green.svg
:target: https://github.com/rheinwerk-verlag/postgresql-anonymizer/blob/master/LICENSE.rst
:target: https://github.com/rheinwerk-verlag/pganonymize/blob/master/LICENSE.rst
.. |pypi| image:: https://badge.fury.io/py/pganonymize.svg
:target: https://badge.fury.io/py/pganonymize
Expand All @@ -173,7 +174,7 @@ After that you can pass a schema file to the container, using Docker volumes, an
:alt: Download count
.. |build| image:: https://github.com/rheinwerk-verlag/postgresql-anonymizer/workflows/Test/badge.svg
:target: https://github.com/rheinwerk-verlag/postgresql-anonymizer/actions
:target: https://github.com/rheinwerk-verlag/pganonymize/actions
.. |health| image:: https://snyk.io/advisor/python/pganonymize/badge.svg
:target: https://snyk.io/advisor/python/pganonymize
Expand Down
8 changes: 4 additions & 4 deletions docs/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -85,17 +85,17 @@ qthelp:
@echo
@echo "Build finished; now you can run "qcollectiongenerator" with the" \
".qhcp project file in $(BUILDDIR)/qthelp, like this:"
@echo "# qcollectiongenerator $(BUILDDIR)/qthelp/pganonymizer.qhcp"
@echo "# qcollectiongenerator $(BUILDDIR)/qthelp/pganonymize.qhcp"
@echo "To view the help file:"
@echo "# assistant -collectionFile $(BUILDDIR)/qthelp/pganonymizer.qhc"
@echo "# assistant -collectionFile $(BUILDDIR)/qthelp/pganonymize.qhc"

devhelp:
$(SPHINXBUILD) -b devhelp $(ALLSPHINXOPTS) $(BUILDDIR)/devhelp
@echo
@echo "Build finished."
@echo "To view the help file:"
@echo "# mkdir -p $$HOME/.local/share/devhelp/pganonymizer"
@echo "# ln -s $(BUILDDIR)/devhelp $$HOME/.local/share/devhelp/pganonymizer"
@echo "# mkdir -p $$HOME/.local/share/devhelp/pganonymize"
@echo "# ln -s $(BUILDDIR)/devhelp $$HOME/.local/share/devhelp/pganonymize"
@echo "# devhelp"

epub:
Expand Down
2 changes: 1 addition & 1 deletion docs/api.rst
Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,4 @@ API
.. toctree::
:maxdepth: 4

pganonymizer
pganonymize
22 changes: 11 additions & 11 deletions docs/conf.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
#!/usr/bin/env python
# -*- coding: utf-8 -*-
#
# pganonymizer documentation build configuration file
# pganonymize documentation build configuration file
#
# This file is execfile()d with the current directory set to its
# containing dir.
Expand Down Expand Up @@ -33,7 +33,7 @@
# exec version.py instead of importing it. Importing may trigger unwanted
# side-effects (if autodoc is used, the pypackage may be imported anyway).
meta = {}
exec(open(os.path.join(project_root, 'pganonymizer', 'version.py')).read(), {}, meta)
exec(open(os.path.join(project_root, 'pganonymize', 'version.py')).read(), {}, meta)

# -- General configuration ---------------------------------------------

Expand Down Expand Up @@ -61,7 +61,7 @@
master_doc = 'index'

# General information about the project.
project = u'PostgreSQL Anonymizer'
project = u'pganonymize'
copyright = u'2019, Rheinwerk Verlag GmbH, Henning Kage'

# The version info for the project you're documenting, acts as replacement
Expand Down Expand Up @@ -194,7 +194,7 @@
#html_file_suffix = None

# Output file base name for HTML help builder.
htmlhelp_basename = 'pganonymizerdoc'
htmlhelp_basename = 'pganonymizedoc'


# -- Options for LaTeX output ------------------------------------------
Expand All @@ -214,8 +214,8 @@
# (source start file, target name, title, author, documentclass
# [howto/manual]).
latex_documents = [
('index', 'pganonymizer.tex',
u'PostgreSQL Anonymizer Documentation',
('index', 'pganonymize.tex',
u'pganonymize Documentation',
u'Henning Kage', 'manual'),
]

Expand Down Expand Up @@ -245,8 +245,8 @@
# One entry per manual page. List of tuples
# (source start file, name, description, authors, manual section).
man_pages = [
('index', 'pganonymizer',
u'PostgreSQL Anonymizer Documentation',
('index', 'pganonymize',
u'pganonymize Anonymizer Documentation',
[u'Henning Kage'], 1)
]

Expand All @@ -260,10 +260,10 @@
# (source start file, target name, title, author,
# dir menu entry, description, category)
texinfo_documents = [
('index', 'pganonymizer',
u'PostgreSQL Anonymizer Documentation',
('index', 'pganonymize',
u'pganonymize Documentation',
u'Henning Kage',
'pganonymizer',
'pganonymize',
'A cookiecutter template for Rheinwerk Python packages',
'Miscellaneous'),
]
Expand Down
1 change: 1 addition & 0 deletions docs/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ Contents:
deploy
license
changelog
links


Indices and tables
Expand Down
14 changes: 14 additions & 0 deletions docs/links.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
Links
=====

The following links refer to projects that have a similar purpose of anonymizing a PostgreSQL database. Thanks to the
authors of these projects. Some of them inspired the author of this project, e.g. `pgantomizer`_ for using a human
readable declaration file in YAML.

* `PostgreSQL Anonymizer`_: Anonymization & Data Masking for PostgreSQL
* `pg-anonymizer`_: Dump anonymized PostgreSQL database with a NodeJS CLI
* `pgantomizer`_: Anonymize data in your PostgreSQL dabatase with ease

.. _PostgreSQL Anonymizer: https://gitlab.com/dalibo/postgresql_anonymizer
.. _pg-anonymizer: https://github.com/rap2hpoutre/pg-anonymizer
.. _pgantomizer: https://github.com/asgeirrr/pgantomizer
28 changes: 14 additions & 14 deletions docs/pganonymizer.rst → docs/pganonymize.rst
Original file line number Diff line number Diff line change
@@ -1,53 +1,53 @@
pganonymizer package
pganonymize package
====================

Submodules
----------

pganonymizer.cli module
pganonymize.cli module
-----------------------

.. automodule:: pganonymizer.cli
.. automodule:: pganonymize.cli
:members:
:undoc-members:
:show-inheritance:

pganonymizer.constants module
pganonymize.constants module
-----------------------------

.. automodule:: pganonymizer.constants
.. automodule:: pganonymize.constants
:members:
:undoc-members:
:show-inheritance:

pganonymizer.exceptions module
pganonymize.exceptions module
------------------------------

.. automodule:: pganonymizer.exceptions
.. automodule:: pganonymize.exceptions
:members:
:undoc-members:
:show-inheritance:

pganonymizer.providers module
pganonymize.providers module
-----------------------------

.. automodule:: pganonymizer.providers
.. automodule:: pganonymize.providers
:members:
:undoc-members:
:show-inheritance:

pganonymizer.utils module
pganonymize.utils module
-------------------------

.. automodule:: pganonymizer.utils
.. automodule:: pganonymize.utils
:members:
:undoc-members:
:show-inheritance:

pganonymizer.version module
pganonymize.version module
---------------------------

.. automodule:: pganonymizer.version
.. automodule:: pganonymize.version
:members:
:undoc-members:
:show-inheritance:
Expand All @@ -56,7 +56,7 @@ pganonymizer.version module
Module contents
---------------

.. automodule:: pganonymizer
.. automodule:: pganonymize
:members:
:undoc-members:
:show-inheritance:
1 change: 1 addition & 0 deletions docs/schema.rst
Original file line number Diff line number Diff line change
Expand Up @@ -122,6 +122,7 @@ YAML schema file supports placeholders with environment variables, ex:

So you can construct dynamic filter conditions like:
.. code-block:: sh
$ export COMPANY_ID=123
$ export ACTION_TO_BE_TAKEN=clear
Expand Down
File renamed without changes.
2 changes: 1 addition & 1 deletion pganonymizer/__main__.py → pganonymize/__main__.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@


def main():
from pganonymizer.cli import get_arg_parser, main
from pganonymize.cli import get_arg_parser, main

try:
args = get_arg_parser().parse_args()
Expand Down
6 changes: 3 additions & 3 deletions pganonymizer/cli.py → pganonymize/cli.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,9 @@
import logging
import time

from pganonymizer.constants import DATABASE_ARGS, DEFAULT_SCHEMA_FILE
from pganonymizer.providers import provider_registry
from pganonymizer.utils import anonymize_tables, create_database_dump, get_connection, load_config, truncate_tables
from pganonymize.constants import DATABASE_ARGS, DEFAULT_SCHEMA_FILE
from pganonymize.providers import provider_registry
from pganonymize.utils import anonymize_tables, create_database_dump, get_connection, load_config, truncate_tables


def get_pg_args(args):
Expand Down
File renamed without changes.
File renamed without changes.
4 changes: 2 additions & 2 deletions pganonymizer/providers.py → pganonymize/providers.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@

from faker import Faker

from pganonymizer.exceptions import InvalidProvider, InvalidProviderArgument, ProviderAlreadyRegistered
from pganonymize.exceptions import InvalidProvider, InvalidProviderArgument, ProviderAlreadyRegistered

fake_data = Faker()

Expand All @@ -22,7 +22,7 @@ def register(self, provider_class, provider_id):
"""
Register a provider class.
:param pganonymizer.providers.Provider provider_class: Provider class that should be registered
:param pganonymize.providers.Provider provider_class: Provider class that should be registered
:param str provider_id: A string id to register the provider for
:raises ProviderAlreadyRegistered: If another provider with the given id has been registered
"""
Expand Down
Loading

0 comments on commit ac512e4

Please sign in to comment.