Skip to main content

Public 360 application by Tieto has some issues with for example duplicated contacts. This package tries to fix that and adds other functionality like synchronization(enrichment) with brreg.no.

Project description

test codecov wemake-python-styleguide

P360 Contact Manager

Why

While there are built in methods to syncronize against for example brønnøysundregisteret, to enrich data or update data they are slow and point and click oriented. There are also cases where duplicates are created by external programs. This program tries to fix some of those issues.

How

P360 exposes an API for dealing with contacts. It is through this api that we find, update, and fix enterprises in p360.

Setup

easier setup will be available if the package goes to pypi. Then it would be as simple as doing pip install p360-contact-manager and use it directly like:

$ python p360_contact_manager args args action

But for now we install it from source. so clone the repo first. then:

Get poetry

get poetry - dependency management:

$ curl -sSL https://raw.githubusercontent.com/sdispater/poetry/master/get-poetry.py | python

Make poetry create virtualenv in project folder. This makes it easier for IDE's to run correct virtualenv while debuging/running linters etc.

$ poetry config settings.virtualenvs.in-project true

Get Pyenv - optional

pyenv is a nice tool that lets you 'activate' a version of python either globally, locally or for one shell instance. its really nice and i reccomend getting it and using it now but it is not needed for this program to work.

with brew:

$ brew update
$ brew install pyenv

Put this command into the of ~/.bash_profile or run pyenv init to make sure where to put it for for example zsh.

$ eval "$(pyenv init -)"

install a version of python 3.7.2+: This installs a clean python to pyenvs folders and lets us reference that as a 'base' in our virtualenvs.

$ pyenv install 3.7.4

Usage

if you did install pyenv activate pyenv for the current shell

$ pyenv shell 3.7.4

Run this to install required packages and a virtualenv

  • if you do not plan on developing on this, add the flag: --no-dev
$ poetry install

Test

$ poetry run python p360_contact_manager --authkey the_key test

Create a 'Cache'(json file) of all enterprises in p360

poetry run python p360_contact_manager --authkey the_key cache_enterprises

add -c or --cached argument to use local cached json file.

Create duplicate worklist

poetry run python p360_contact_manager --authkey the_key duplicates -c

Update with worklist

tip: use --dry to check if everything looks good before continuing

$ poetry run python p360_contact_manager --authkey the_key update --worklist json_worklist_file.json

Create Brreg data syncronize worklist

for now just add the key even though its not needed its flagged as required... will fix.

$ poetry run python p360_contact_manager --authkey the_key brreg_syncronize

Call synchronize with brreg data worklist

$ poetry run python p360_contact_manager --authkey the_key synchronize --worklist brreg_synchronize_worklist.json

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

p360-contact-manager-1.0.0.tar.gz (16.8 kB view hashes)

Uploaded Source

Built Distribution

p360_contact_manager-1.0.0-py3-none-any.whl (21.6 kB view hashes)

Uploaded Python 3

Supported by

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