nomenklatura


Namenomenklatura JSON
Version 2.7.7 PyPI version JSON
download
home_pagehttps://github.com/opensanctions/nomenklatura
SummaryMake record linkages in followthemoney data.
upload_time2022-12-19 20:45:22
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 entities.ijson
# note there is now a new file, `entities.rslv.ijson` that contains de-duplication info.
$ nomenklatura dedupe entiites.ijson
# will pop up a user interface.
$ nomenklatura apply entities.ijson -o merged.ijson
# de-duplicated data goes into `merged.ijson`:
$ cat entities.ijson | wc -l 
474 entities.ijson
$ cat entities.ijson | wc -l 
468 merged.ijson
```

### 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.Loader` - a general purpose access mechanism for entities. By default, a `nomenklatura.FileLoader` is used to access entity data stored in files, but the loader 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/a7/e7/0f5b1e915135640a92d804cc527e0351f673fe7875794fac226b325d523a/nomenklatura-2.7.7.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 entities.ijson\n# note there is now a new file, `entities.rslv.ijson` that contains de-duplication info.\n$ nomenklatura dedupe entiites.ijson\n# will pop up a user interface.\n$ nomenklatura apply entities.ijson -o merged.ijson\n# de-duplicated data goes into `merged.ijson`:\n$ cat entities.ijson | wc -l \n474 entities.ijson\n$ cat entities.ijson | wc -l \n468 merged.ijson\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.Loader` - a general purpose access mechanism for entities. By default, a `nomenklatura.FileLoader` is used to access entity data stored in files, but the loader 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\n\n",
    "bugtrack_url": null,
    "license": "MIT",
    "summary": "Make record linkages in followthemoney data.",
    "version": "2.7.7",
    "split_keywords": [
        "data",
        "mapping",
        "identity",
        "followthemoney",
        "linkage",
        "record"
    ],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "md5": "9d3ac9aeb4d6488b0704df9cf23e4336",
                "sha256": "1f5cb0034a0e10f54e6c8fcb4da4a85f49a4c1a9042c29f8a0fffe5391beea45"
            },
            "downloads": -1,
            "filename": "nomenklatura-2.7.7-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "9d3ac9aeb4d6488b0704df9cf23e4336",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": null,
            "size": 74366,
            "upload_time": "2022-12-19T20:45:21",
            "upload_time_iso_8601": "2022-12-19T20:45:21.496957Z",
            "url": "https://files.pythonhosted.org/packages/07/a1/7b5adfd4d23b0fc3a90b3afc70d47c18cffb9abce224993335dde9a2f3ff/nomenklatura-2.7.7-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "md5": "76724039651fae2c5274798cb6e86474",
                "sha256": "69ed5a54eb16fea51009829b381b185caf656058b65f96140c9062e4cbd113f7"
            },
            "downloads": -1,
            "filename": "nomenklatura-2.7.7.tar.gz",
            "has_sig": false,
            "md5_digest": "76724039651fae2c5274798cb6e86474",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": null,
            "size": 51323,
            "upload_time": "2022-12-19T20:45:22",
            "upload_time_iso_8601": "2022-12-19T20:45:22.892740Z",
            "url": "https://files.pythonhosted.org/packages/a7/e7/0f5b1e915135640a92d804cc527e0351f673fe7875794fac226b325d523a/nomenklatura-2.7.7.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2022-12-19 20:45:22",
    "github": true,
    "gitlab": false,
    "bitbucket": false,
    "github_user": "opensanctions",
    "github_project": "nomenklatura",
    "travis_ci": false,
    "coveralls": false,
    "github_actions": true,
    "lcname": "nomenklatura"
}
        
Elapsed time: 0.10356s