@@ -11,14 +11,12 @@ It uses a YAML file to define which tables and fields should be anonymized and p
11
11
12
12
.. contents ::
13
13
14
- .. section-numbering ::
15
-
16
14
Features
17
15
--------
18
16
19
17
* Intentionally compatible with Python 2.7 (for old, productive platforms)
20
- * Anonymize PostgreSQL tables on data level entry with various methods (s. table below)
21
- * Exclude data for anonymization depending on regular expressions
18
+ * Anonymize PostgreSQL tables on data level entry with various providers (some examples in the table below)
19
+ * Exclude data for anonymization depending on regular expressions or SQL `` WHERE `` clauses
22
20
* Truncate entire tables for unwanted data
23
21
24
22
+----------------+----------------------+-------------------------+----------------------------------+
@@ -43,22 +41,24 @@ Features
43
41
| ``uuid_col `` | 00010203-0405-...... | ``uuid4 `` | f7c1bd87-4d.... |
44
42
+----------------+----------------------+-------------------------+----------------------------------+
45
43
46
- * Note: ``faker.unique.[provider] `` only supported on Python 3.5 + (Faker library min. supported python version)
44
+ * Note: ``faker.unique.[provider] `` only supported on Python 3.6 + (Faker library min. supported python version)
47
45
* Note: ``uuid4 `` - only for (native `uuid4 `_) columns
48
46
49
47
See the `documentation `_ for a more detailed description of the provided anonymization methods.
50
48
51
49
Installation
52
50
------------
53
51
54
- The default installation method is to use ``pip ``::
52
+ The default installation method is to use ``pip ``:
53
+
54
+ .. code-block :: sh
55
55
56
56
$ pip install pganonymize
57
57
58
58
Usage
59
59
-----
60
60
61
- ::
61
+ .. code-block :: sh
62
62
63
63
usage: pganonymize [-h] [-v] [-l] [--schema SCHEMA] [--dbname DBNAME]
64
64
[--user USER] [--password PASSWORD] [--host HOST]
@@ -87,7 +87,9 @@ all anonymization rules for that database. Take a look at the `schema documentat
87
87
`YAML sample schema`_.
88
88
89
89
90
- Example call::
90
+ Example calls:
91
+
92
+ .. code-block:: sh
91
93
92
94
$ pganonymize --schema=myschema.yml \
93
95
--dbname=test_database \
@@ -109,11 +111,15 @@ Database dump
109
111
110
112
With the ``--dump-file`` argument it is possible to create a dump file after anonymizing the database. Please note,
111
113
that the ``pg_dump`` command from the ``postgresql-client-common`` library is necessary to create the dump file for the
112
- database, e.g. under Linux::
114
+ database, e.g. under Linux:
115
+
116
+ .. code-block:: sh
113
117
114
- sudo apt-get install postgresql-client-common
118
+ $ sudo apt-get install postgresql-client-common
115
119
116
- Example call::
120
+ Example call:
121
+
122
+ .. code-block:: sh
117
123
118
124
$ pganonymize --schema=myschema.yml \
119
125
--dbname=test_database \
@@ -123,31 +129,18 @@ Example call::
123
129
--dump-file=/tmp/dump.gz \
124
130
-v
125
131
126
- Quickstart
127
- ----------
128
-
129
- Clone repo::
130
-
131
- $ git clone [email protected] :rheinwerk-verlag/postgresql-anonymizer.git
132
- $ cd postgresql-anonymizer
133
-
134
- For making changes and developing pganonymizer, you need to install ``poetry ``::
135
-
136
- $ sudo pip install poetry
137
-
138
- Now you can install all requirements and activate the virtualenv::
139
-
140
- $ poetry install
141
- $ poetry shell
142
-
143
132
Docker
144
- ------
133
+ ~~~~~~
134
+
135
+ If you want to run the anonymizer within a Docker container you first have to build the image:
145
136
146
- If you want to run the anonymizer within a Docker container you first have to build the image::
137
+ .. code-block:: sh
147
138
148
139
$ docker build -t pganonymizer .
149
140
150
- After that you can pass a schema file to the container, using Docker volumes, and call the anonymizer::
141
+ After that you can pass a schema file to the container, using Docker volumes, and call the anonymizer:
142
+
143
+ .. code-block:: sh
151
144
152
145
$ docker run \
153
146
-v <path to your schema>:/schema.yml \
0 commit comments