Name | nomenklatura JSON |
Version |
3.16.2
JSON |
| download |
home_page | None |
Summary | Make record linkages in followthemoney data. |
upload_time | 2025-03-11 16:13:22 |
maintainer | None |
docs_url | None |
author | None |
requires_python | >=3.11 |
license | Copyright (c) 2013-2022, Friedrich Lindenberg
Copyright (c) 2023-2025, OpenSanctions Datenbanken GmbH
Permission is hereby granted, free of charge, to any person obtaining a
copy of this software and associated documentation files (the
"Software"), to deal in the Software without restriction, including
without limitation the rights to use, copy, modify, merge, publish,
distribute, sublicense, and/or sell copies of the Software, and to
permit persons to whom the Software is furnished to do so, subject to
the following conditions:
The above copyright notice and this permission notice shall be included
in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. |
keywords |
|
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.

## 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 sqlite database, `nomenklatura.db` that contains de-duplication info.
$ nomenklatura dedupe entities.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
$ cat merged.ijson | wc -l
468
```
The resolver graph database location can be customised by setting the environment variable `NOMENKLATURA_DB_URL`
### 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": null,
"name": "nomenklatura",
"maintainer": null,
"docs_url": null,
"requires_python": ">=3.11",
"maintainer_email": null,
"keywords": null,
"author": null,
"author_email": "OpenSanctions <info@opensanctions.org>",
"download_url": null,
"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\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 sqlite database, `nomenklatura.db` that contains de-duplication info.\n$ nomenklatura dedupe entities.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\n$ cat merged.ijson | wc -l \n468 \n```\n\nThe resolver graph database location can be customised by setting the environment variable `NOMENKLATURA_DB_URL`\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": "Copyright (c) 2013-2022, Friedrich Lindenberg\n Copyright (c) 2023-2025, OpenSanctions Datenbanken GmbH\n \n Permission is hereby granted, free of charge, to any person obtaining a\n copy of this software and associated documentation files (the\n \"Software\"), to deal in the Software without restriction, including\n without limitation the rights to use, copy, modify, merge, publish,\n distribute, sublicense, and/or sell copies of the Software, and to\n permit persons to whom the Software is furnished to do so, subject to\n the following conditions:\n \n The above copyright notice and this permission notice shall be included\n in all copies or substantial portions of the Software.\n \n THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS\n OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF\n MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.\n IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY\n CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,\n TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE\n SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.",
"summary": "Make record linkages in followthemoney data.",
"version": "3.16.2",
"project_urls": {
"Documentation": "https://github.com/opensanctions/nomenklatura/",
"Issues": "https://github.com/opensanctions/nomenklatura/issues",
"Repository": "https://github.com/opensanctions/nomenklatura.git"
},
"split_keywords": [],
"urls": [
{
"comment_text": null,
"digests": {
"blake2b_256": "1b1c464e13eaf28e837528a4b039dab7b851fcb0d7f94b1dce85d3144ca3aa71",
"md5": "94d56fd2e827dd1d800cff9438b36766",
"sha256": "ed402563b4039e578db9778b91a3ea4761a41e0e7c6d6128fe11a64a86591de2"
},
"downloads": -1,
"filename": "nomenklatura-3.16.2-py3-none-any.whl",
"has_sig": false,
"md5_digest": "94d56fd2e827dd1d800cff9438b36766",
"packagetype": "bdist_wheel",
"python_version": "py3",
"requires_python": ">=3.11",
"size": 123257,
"upload_time": "2025-03-11T16:13:22",
"upload_time_iso_8601": "2025-03-11T16:13:22.933498Z",
"url": "https://files.pythonhosted.org/packages/1b/1c/464e13eaf28e837528a4b039dab7b851fcb0d7f94b1dce85d3144ca3aa71/nomenklatura-3.16.2-py3-none-any.whl",
"yanked": false,
"yanked_reason": null
}
],
"upload_time": "2025-03-11 16:13:22",
"github": true,
"gitlab": false,
"bitbucket": false,
"codeberg": false,
"github_user": "opensanctions",
"github_project": "nomenklatura",
"travis_ci": false,
"coveralls": false,
"github_actions": true,
"lcname": "nomenklatura"
}