nomenklatura


Namenomenklatura JSON
Version 3.10.6 PyPI version JSON
download
home_pagehttps://github.com/opensanctions/nomenklatura
SummaryMake record linkages in followthemoney data.
upload_time2024-03-19 14:54:28
maintainer
docs_urlNone
authorFriedrich Lindenberg
requires_python
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.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": "",
    "docs_url": null,
    "requires_python": "",
    "maintainer_email": "",
    "keywords": "data mapping identity followthemoney linkage record",
    "author": "Friedrich Lindenberg",
    "author_email": "friedrich@pudo.org",
    "download_url": "https://files.pythonhosted.org/packages/71/f6/684be12e64fb16bb7d7649aa59edc135a9626a9fe45857516315757737da/nomenklatura-3.10.6.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.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.10.6",
    "project_urls": {
        "Homepage": "https://github.com/opensanctions/nomenklatura"
    },
    "split_keywords": [
        "data",
        "mapping",
        "identity",
        "followthemoney",
        "linkage",
        "record"
    ],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "bebd4ed83eca4c59d501ecb099e69878c3841c181c5bef96268f91686da36451",
                "md5": "4e2bdee9f14206674f960f1f6c07b8f1",
                "sha256": "612a12735763d051e8da6fbba1c9525c539777a447eea7d8646524f3bcd50041"
            },
            "downloads": -1,
            "filename": "nomenklatura-3.10.6-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "4e2bdee9f14206674f960f1f6c07b8f1",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": null,
            "size": 131641,
            "upload_time": "2024-03-19T14:54:25",
            "upload_time_iso_8601": "2024-03-19T14:54:25.952821Z",
            "url": "https://files.pythonhosted.org/packages/be/bd/4ed83eca4c59d501ecb099e69878c3841c181c5bef96268f91686da36451/nomenklatura-3.10.6-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "71f6684be12e64fb16bb7d7649aa59edc135a9626a9fe45857516315757737da",
                "md5": "a44491ff917d7b25a0090aa61c1e86ea",
                "sha256": "09bb68ac28c20c8bcaee42bd12ad2c2e6f5f10a8816f3b3ab9b942e49b89b291"
            },
            "downloads": -1,
            "filename": "nomenklatura-3.10.6.tar.gz",
            "has_sig": false,
            "md5_digest": "a44491ff917d7b25a0090aa61c1e86ea",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": null,
            "size": 73980,
            "upload_time": "2024-03-19T14:54:28",
            "upload_time_iso_8601": "2024-03-19T14:54:28.271463Z",
            "url": "https://files.pythonhosted.org/packages/71/f6/684be12e64fb16bb7d7649aa59edc135a9626a9fe45857516315757737da/nomenklatura-3.10.6.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2024-03-19 14:54:28",
    "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.24234s