nomenklatura


Namenomenklatura JSON
Version 3.12.5 PyPI version JSON
download
home_pagehttps://github.com/opensanctions/nomenklatura
SummaryMake record linkages in followthemoney data.
upload_time2024-07-03 04:36:46
maintainerNone
docs_urlNone
authorFriedrich Lindenberg
requires_pythonNone
licenseMIT
keywords data mapping identity followthemoney linkage record
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage No coveralls.
            # nomenklatura

Nomenklatura de-duplicates and integrates different [Follow the Money](https://followthemoney.rtfd.org/) entities. It serves to clean up messy data and to find links between different datasets.

![screenshot](./docs/screenshot.png)

## Usage

You can install `nomenklatura` via PyPI:

```bash
$ pip install nomenklatura
```

### Command-line usage

Much of the functionality of `nomenklatura` can be used as a command-line tool. In the following example, we'll assume that you have a file containing [Follow the Money](https://followthemoney.rtfd.org/) entities in your local directory, named `entities.ijson`. If you just want try it out, you can use the file `tests/fixtures/donations.ijson` in this repository for testing (it contains German campaign finance data).

With the file in place, you will cross-reference the entities to generate de-duplication candidates, then run the interactive de-duplication UI in your console, and eventually apply the judgements to generate a new file with merged entities:

```bash
# generate merge candidates using an in-memory index:
$ nomenklatura xref -r resolver.json entities.ijson
# note there is now a new file, `resolver.json` that contains de-duplication info.
$ nomenklatura dedupe -r resolver.json entites.ijson
# will pop up a user interface.
$ nomenklatura apply entities.ijson -o merged.ijson -r resolver.json
# de-duplicated data goes into `merged.ijson`:
$ cat entities.ijson | wc -l 
474
$ cat merged.ijson | wc -l 
468 
```

### Programmatic usage

The command-line use of `nomenklatura` is targeted at small datasets which need to be de-duplicated. For more involved scenarios, the package also offers a Python API which can be used to control the semantics of de-duplication.

* `nomenklatura.Dataset` - implements a basic dataset for describing a set of entities.
* `nomenklatura.Store` - a general purpose access mechanism for entities. By default, a store is used to access entity data stored in files as an in-memory cache, but the store can be subclassed to work with entities from a database system.
* `nomenklatura.Index` - a full-text in-memory search index for FtM entities. In the application, this is used to block de-duplication candidates, but the index can also be used to drive an API etc.
* `nomenklatura.index.TantivyIndex` - a wrapper around Tantivy for indexing and matching FtM entities.
* `nomenklatura.Resolver` - the core of the de-duplication process, the resolver is essentially a graph with edges made out of entity judgements. The resolver can be used to store judgements or get the canonical ID for a given entity.

All of the API classes have extensive type annotations, which should make their integration in any modern Python API simpler.

## Design

This package offers an implementation of an in-memory data deduplication framework centered around the FtM data model. The idea is the following workflow:

* Accept FtM-shaped entities from a given loader (e.g. a JSON file, or a database)
* Build an in-memory inverted index of the entities for dedupe blocking
* Generate merge candidates using the blocking index and FtM compare
* Provide a file-based storage format for merge challenges and decisions
* Provide a text-based user interface to let users make merge decisions

Later on, the following might be added:

* A web application to let users make merge decisions on the web

### Resolver graph

The key implementation detail of nomenklatura is the `Resolver`, a graph structure that
manages user decisions regarding entity identity. Edges are `Judgements` of whether
two entity IDs are the same, not the same, or undecided. The resolver implements an
algorithm for computing connected components, which can the be used to find the best
available ID for a cluster of entities. It can also be used to evaluate transitive
judgements, e.g. if A <> B, and B = C, then we don't need to ask if A = C.

## Reading

* https://dedupe.readthedocs.org/en/latest/
* https://github.com/OpenRefine/OpenRefine/wiki/Reconcilable-Data-Sources
* https://github.com/OpenRefine/OpenRefine/wiki/Clustering-In-Depth
* https://github.com/OpenRefine/OpenRefine/wiki/Reconciliation-Service-API


## Contact, contributions etc.

This codebase is licensed under the terms of an MIT license (see LICENSE).

We're keen for any contributions, bug fixes and feature suggestions, please use the GitHub issue tracker for this repository. 

Nomenklatura is currently developed thanks to a Prototypefund grant for [OpenSanctions](https://opensanctions.org). Previous iterations of the package were developed with support from [Knight-Mozilla OpenNews](http://opennews.org) and the [Open Knowledge Foundation Labs](http://okfnlabs.org).

            

Raw data

            {
    "_id": null,
    "home_page": "https://github.com/opensanctions/nomenklatura",
    "name": "nomenklatura",
    "maintainer": null,
    "docs_url": null,
    "requires_python": null,
    "maintainer_email": null,
    "keywords": "data mapping identity followthemoney linkage record",
    "author": "Friedrich Lindenberg",
    "author_email": "friedrich@pudo.org",
    "download_url": "https://files.pythonhosted.org/packages/48/fa/424f9222df13c771a9a589d0b2769a6c5d8cbf6db5e28382f1c9eb233177/nomenklatura-3.12.5.tar.gz",
    "platform": null,
    "description": "# nomenklatura\n\nNomenklatura de-duplicates and integrates different [Follow the Money](https://followthemoney.rtfd.org/) entities. It serves to clean up messy data and to find links between different datasets.\n\n![screenshot](./docs/screenshot.png)\n\n## Usage\n\nYou can install `nomenklatura` via PyPI:\n\n```bash\n$ pip install nomenklatura\n```\n\n### Command-line usage\n\nMuch of the functionality of `nomenklatura` can be used as a command-line tool. In the following example, we'll assume that you have a file containing [Follow the Money](https://followthemoney.rtfd.org/) entities in your local directory, named `entities.ijson`. If you just want try it out, you can use the file `tests/fixtures/donations.ijson` in this repository for testing (it contains German campaign finance data).\n\nWith the file in place, you will cross-reference the entities to generate de-duplication candidates, then run the interactive de-duplication UI in your console, and eventually apply the judgements to generate a new file with merged entities:\n\n```bash\n# generate merge candidates using an in-memory index:\n$ nomenklatura xref -r resolver.json entities.ijson\n# note there is now a new file, `resolver.json` that contains de-duplication info.\n$ nomenklatura dedupe -r resolver.json entites.ijson\n# will pop up a user interface.\n$ nomenklatura apply entities.ijson -o merged.ijson -r resolver.json\n# de-duplicated data goes into `merged.ijson`:\n$ cat entities.ijson | wc -l \n474\n$ cat merged.ijson | wc -l \n468 \n```\n\n### Programmatic usage\n\nThe command-line use of `nomenklatura` is targeted at small datasets which need to be de-duplicated. For more involved scenarios, the package also offers a Python API which can be used to control the semantics of de-duplication.\n\n* `nomenklatura.Dataset` - implements a basic dataset for describing a set of entities.\n* `nomenklatura.Store` - a general purpose access mechanism for entities. By default, a store is used to access entity data stored in files as an in-memory cache, but the store can be subclassed to work with entities from a database system.\n* `nomenklatura.Index` - a full-text in-memory search index for FtM entities. In the application, this is used to block de-duplication candidates, but the index can also be used to drive an API etc.\n* `nomenklatura.index.TantivyIndex` - a wrapper around Tantivy for indexing and matching FtM entities.\n* `nomenklatura.Resolver` - the core of the de-duplication process, the resolver is essentially a graph with edges made out of entity judgements. The resolver can be used to store judgements or get the canonical ID for a given entity.\n\nAll of the API classes have extensive type annotations, which should make their integration in any modern Python API simpler.\n\n## Design\n\nThis package offers an implementation of an in-memory data deduplication framework centered around the FtM data model. The idea is the following workflow:\n\n* Accept FtM-shaped entities from a given loader (e.g. a JSON file, or a database)\n* Build an in-memory inverted index of the entities for dedupe blocking\n* Generate merge candidates using the blocking index and FtM compare\n* Provide a file-based storage format for merge challenges and decisions\n* Provide a text-based user interface to let users make merge decisions\n\nLater on, the following might be added:\n\n* A web application to let users make merge decisions on the web\n\n### Resolver graph\n\nThe key implementation detail of nomenklatura is the `Resolver`, a graph structure that\nmanages user decisions regarding entity identity. Edges are `Judgements` of whether\ntwo entity IDs are the same, not the same, or undecided. The resolver implements an\nalgorithm for computing connected components, which can the be used to find the best\navailable ID for a cluster of entities. It can also be used to evaluate transitive\njudgements, e.g. if A <> B, and B = C, then we don't need to ask if A = C.\n\n## Reading\n\n* https://dedupe.readthedocs.org/en/latest/\n* https://github.com/OpenRefine/OpenRefine/wiki/Reconcilable-Data-Sources\n* https://github.com/OpenRefine/OpenRefine/wiki/Clustering-In-Depth\n* https://github.com/OpenRefine/OpenRefine/wiki/Reconciliation-Service-API\n\n\n## Contact, contributions etc.\n\nThis codebase is licensed under the terms of an MIT license (see LICENSE).\n\nWe're keen for any contributions, bug fixes and feature suggestions, please use the GitHub issue tracker for this repository. \n\nNomenklatura is currently developed thanks to a Prototypefund grant for [OpenSanctions](https://opensanctions.org). Previous iterations of the package were developed with support from [Knight-Mozilla OpenNews](http://opennews.org) and the [Open Knowledge Foundation Labs](http://okfnlabs.org).\n",
    "bugtrack_url": null,
    "license": "MIT",
    "summary": "Make record linkages in followthemoney data.",
    "version": "3.12.5",
    "project_urls": {
        "Homepage": "https://github.com/opensanctions/nomenklatura"
    },
    "split_keywords": [
        "data",
        "mapping",
        "identity",
        "followthemoney",
        "linkage",
        "record"
    ],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "b15c2be38d82d87845c00fcdce5b4db7f4f6cc07a746a26f5e7d51e9c0eded64",
                "md5": "84f91ee03736eb0e418b0ab51b17621a",
                "sha256": "25b100dc258007235c31f5837e001eda9288c69eecf405c9c17309a003a1cadd"
            },
            "downloads": -1,
            "filename": "nomenklatura-3.12.5-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "84f91ee03736eb0e418b0ab51b17621a",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": null,
            "size": 150285,
            "upload_time": "2024-07-03T04:36:44",
            "upload_time_iso_8601": "2024-07-03T04:36:44.088063Z",
            "url": "https://files.pythonhosted.org/packages/b1/5c/2be38d82d87845c00fcdce5b4db7f4f6cc07a746a26f5e7d51e9c0eded64/nomenklatura-3.12.5-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "48fa424f9222df13c771a9a589d0b2769a6c5d8cbf6db5e28382f1c9eb233177",
                "md5": "e0d85734254e1d55bba812c355e3fd86",
                "sha256": "95394275b88d9dfc35ea36750440707a65f9d9bb07cbbde2ef648b28bf617e9e"
            },
            "downloads": -1,
            "filename": "nomenklatura-3.12.5.tar.gz",
            "has_sig": false,
            "md5_digest": "e0d85734254e1d55bba812c355e3fd86",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": null,
            "size": 83363,
            "upload_time": "2024-07-03T04:36:46",
            "upload_time_iso_8601": "2024-07-03T04:36:46.700074Z",
            "url": "https://files.pythonhosted.org/packages/48/fa/424f9222df13c771a9a589d0b2769a6c5d8cbf6db5e28382f1c9eb233177/nomenklatura-3.12.5.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2024-07-03 04:36:46",
    "github": true,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "github_user": "opensanctions",
    "github_project": "nomenklatura",
    "travis_ci": false,
    "coveralls": false,
    "github_actions": true,
    "lcname": "nomenklatura"
}
        
Elapsed time: 0.27594s