Skip to main content

Generalized data privacy and consent repository generator.

Project description

pipeline status coverage report

DataCustodian Data Privacy Package Generator

DataCustodian generates other repositories for generalized data privacy and consent systems. The generation follows YML specification files that define the endpoints, handlers, authentication, validation, etc. for each component of a data privacy solution.

DataCustodian is built to work with decentralized and distributed systems to provide decentralized trust for storage and consent of data.

Check out the API Documentation and a real-world implementation.

Installation

The package is available from the PyPI repository:

pip install datacustodian

Generating a Package

Look at the documentation in docs/configs for an example setup that we use for the unit tests. Customize that to your own application and then run:

datacustodian_app.py path/to/your/app_spec.yml --generate

That will auto-generate the package and start the REST API server.

Running Unit Tests

Running unit tests can prove to be a massive pain because the gitlab CI runner runs on docker. For a project like this that uses docker-compose, we have to use docker-in-docker according to their instructions. However, the documentation is sparse and there are lots of dead-ends… Here are the steps to get the docker-compose.yml file to work:

  1. Install a local gitlab-runner using brew install gitlab-runner.

  2. gitlab-runner exec docker --docker-privileged test. Notice that there is a --docker-privileged argument. Without that, the docker-in-docker won’t work.

  3. Make sure all the multiaddr reference the docker service (which hosts all the other containers using dind).

  4. tox should work, but for some reason: running the tests using tox produces connection refused errors, whereas running straight with pytest does not. Something about the tox environment screws things up.

Problems with coverage

For an yet-unknown reason, when the unit tests run in the CI server using:

  1. Only pytest, they pass with no issues.

  2. coverage run with pytest, we get problems with connection reset errors, and connection refused errors.

Insead of trying to figure this out now, we just do the following:

  1. Before pushing to the remote server, run coverage locally (which has no problems on MacOS).

  2. Generate the coverage report -m > codecov.out.

  3. Commit codecov.out and then push.

The CI server only runs pytest, but it also cat codecov.out so that the output includes the regular code coverage matrix. That way, gitlab still has correct statistics about code coverage.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

datacustodian-1.0.1.tar.gz (32.2 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

datacustodian-1.0.1-py2.py3-none-any.whl (63.2 kB view details)

Uploaded Python 2Python 3

File details

Details for the file datacustodian-1.0.1.tar.gz.

File metadata

  • Download URL: datacustodian-1.0.1.tar.gz
  • Upload date:
  • Size: 32.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.13.0 pkginfo/1.5.0.1 requests/2.21.0 setuptools/40.8.0 requests-toolbelt/0.9.1 tqdm/4.31.1 CPython/2.7.15

File hashes

Hashes for datacustodian-1.0.1.tar.gz
Algorithm Hash digest
SHA256 07bc75a907f683a69af2c71575529a87127c5f46f4df18c4bd6266d99984e64b
MD5 0a64ad711a9aed61b6c2496eff481b20
BLAKE2b-256 f070b800663c5057392403f46e87252120c3a445c2324cd96ea0c3a0680124e6

See more details on using hashes here.

File details

Details for the file datacustodian-1.0.1-py2.py3-none-any.whl.

File metadata

  • Download URL: datacustodian-1.0.1-py2.py3-none-any.whl
  • Upload date:
  • Size: 63.2 kB
  • Tags: Python 2, Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.13.0 pkginfo/1.5.0.1 requests/2.21.0 setuptools/40.8.0 requests-toolbelt/0.9.1 tqdm/4.31.1 CPython/2.7.15

File hashes

Hashes for datacustodian-1.0.1-py2.py3-none-any.whl
Algorithm Hash digest
SHA256 f8644bb7c2824ebf6aaffa0c69338f57c5ab1ef92978294d5cff96e0af0c58ae
MD5 135c6e476ecd5b9f75e69c1534446f7a
BLAKE2b-256 d8f35e0d4e08f15011daa031c44ebc6ba2cc10ea7768beefee6aa12be64bbe68

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page