Skip to main content

idmap

A local identity-correlation store: it maps identifiers from arbitrary namespaces (services) to a single canonical person. Start from any identifier and link more later — no service is special, and adding a new one is never a schema change.

It knows nothing about LDAP, GitHub, or any specific service. It's a set/get utility over an identity graph, backed by a single SQLite file. No network calls.

Install

From PyPI (needs Python 3.10+):

pip install idmap

Or, since it's a single file using only the standard library, drop it on your $PATH directly:

cp idmap.py ~/.local/bin/idmap    # anywhere on $PATH

The database is created on first use at $IDMAP_DB, or ${XDG_DATA_HOME:-~/.local/share}/idmap/idmap.db. Override per-invocation with --db PATH.

Development

The project uses only Python's standard library. Run the full local check with:

make ci

This compiles the Python files, runs the unit tests, and builds the distribution artifacts, so a change that breaks packaging is caught early. Individual checks are available with make compile, make test, and make build; running make lists all targets.

The build step needs the build package (pip install build) and produces dist/*.whl and dist/*.tar.gz.

Releases are published to PyPI automatically by GitHub Actions when a GitHub release is published (see .github/workflows/publish.yml), using PyPI Trusted Publishing.

Concepts

  • An identifier is namespace:handle, e.g. github:alice, ldap:asmith, quay:alice-q. The namespace is lowercased; the handle is kept verbatim.
  • A namespace may have an associated URL, such as github.com or foo.my.corp.com.br. The URL is stored exactly as supplied; idmap never contacts it or otherwise interprets it.
  • A person (entity) is a cluster of identifiers that all refer to the same human. You never create a person explicitly — it appears the first time you name an identifier, and clusters merge automatically when you link two that already exist.
  • A person may hold multiple handles in one namespace (alt accounts, renamed users), so get --ns can return more than one line.

Usage

# Assert that these identifiers name the same person (creates or merges).
idmap set github:alice ldap:asmith

# Attach more later, starting from any known identifier.
idmap set ldap:asmith quay:alice-q gitlab:alice-gl

# Resolve: all identifiers for the person, or just one namespace's handle(s).
idmap get ldap:asmith                 # github:alice, gitlab:alice-gl, ...
idmap get ldap:asmith --ns github     # alice
idmap get quay:alice-q --ns gitlab    # alice-gl
idmap get ldap:asmith --name          # Alice Smith

# Inspect.
idmap ls                              # every person and their identifiers
idmap ls --ns github                  # every github:* handle on record
idmap namespace set github github.com  # associate a URL with a namespace
idmap namespace get github             # print the stored URL
idmap namespace ls                     # list namespaces and URLs

# Labels and corrections.
idmap name github:alice "Alice Smith"
idmap unlink quay:alice-q             # split it off into its own person
idmap rm gitlab:alice-gl             # forget an identifier

get prints nothing and exits non-zero when the identifier (or requested namespace, or a name that was never set) isn't known — convenient for shell callers.

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

idmap-0.1.0.tar.gz (9.4 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

idmap-0.1.0-py3-none-any.whl (10.4 kB view details)

Uploaded Python 3

File details

Details for the file idmap-0.1.0.tar.gz.

File metadata

  • Download URL: idmap-0.1.0.tar.gz
  • Upload date:
  • Size: 9.4 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/7.0.0 CPython/3.13.14

File hashes

Hashes for idmap-0.1.0.tar.gz
Algorithm Hash digest
SHA256 dd04a78407ab75ed097c231f142e25fb0a2c6da30a16dec19f6eb2c32c7c31f6
MD5 728ff58882fb35fa93a84f029f3413a9
BLAKE2b-256 b7d4bc3ee8929f17a26325d9fe644d08e560084c2b6270fd8ae98ee65d68d3d8

See more details on using hashes here.

Provenance

The following attestation bundles were made for idmap-0.1.0.tar.gz:

Publisher: publish.yml on lcarva/idmap

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file idmap-0.1.0-py3-none-any.whl.

File metadata

  • Download URL: idmap-0.1.0-py3-none-any.whl
  • Upload date:
  • Size: 10.4 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/7.0.0 CPython/3.13.14

File hashes

Hashes for idmap-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 aff7c6055f298e80d17d140e853f261a8bacace0ceb5bbf488fc82ec22457255
MD5 6fe9655adf8c901bb57488f34c03425a
BLAKE2b-256 81531325a611a74b76160b2594445bbad8ac0362aaa5a8587eaa8fa5856f0d78

See more details on using hashes here.

Provenance

The following attestation bundles were made for idmap-0.1.0-py3-none-any.whl:

Publisher: publish.yml on lcarva/idmap

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Release history Release notifications | RSS feed

This release

0.1.0 This release

2 files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page