Create, validate, parse, and search org-id identifiers.
Project description
org-id
org-id is a small Python package for working with org-id.guide organization identifiers.
It supports:
- loading a bundled snapshot of the
org-id.guideregistry - looking up and searching list metadata
- parsing and validating identifier strings
- creating normalized identifiers for known registers
- falling back to hashed IDs when no structured identifier is available
Install
uv sync
Usage
from org_id import Registry, make_id, make_org_id, parse_org_id
registry = Registry.default()
entry = registry.get("GB-COH")
assert entry is not None
assert entry.code == "GB-COH"
identifier = make_org_id("16957965", register="GB-COH", registry=registry)
assert identifier == "GB-COH-16957965"
fallback = make_id("openlobbying", "Samizdata Ltd", reg_nr=None)
parsed = parse_org_id("GB-COH-16957965")
assert parsed.scheme == "GB-COH"
assert parsed.identifier == "16957965"
If a register is missing from the bundled org-id.guide list, creation still proceeds and emits a warning. Deprecated registers also continue with a warning.
Search
registry = Registry.default()
gb_company_lists = registry.search(country="GB", structure="company")
best_gb_company_list = registry.best(country="GB", structure="company")
search() sorts higher-quality entries first.
Refreshing the bundled snapshot
Fetch a fresh copy of download.json and write it to a file:
uv run org-id-refresh ./download.json
To update the bundled package snapshot in this repo:
uv run org-id-refresh ./src/org_id/data/download.json
Development
uv run pytest
Publishing
This repo includes a GitHub Actions workflow at .github/workflows/publish.yml.
It will:
- run the test suite
- build the package with
uv build - publish to PyPI when you push a tag like
v0.1.0
GitHub and PyPI setup
- Create the package on PyPI by doing one manual upload first, or reserve the project name if needed.
- In PyPI, open the
org-idproject settings. - Add a trusted publisher for this GitHub repository.
- Set the owner to your GitHub account or organization.
- Set the repository name to the repo that will host
org-id. - Set the workflow name to
publish.yml. - Set the environment name blank unless you later decide to gate publishing with a GitHub environment.
- Push this package to its own GitHub repository.
- Create a version tag that matches
pyproject.toml, for examplev0.1.0. - Push the tag with
git push origin v0.1.0.
Recommended release flow
- Update
versioninpyproject.toml. - Commit the change.
- Create and push a matching git tag, such as
v0.1.1. - Watch the
Publishworkflow in GitHub Actions. - Confirm the new release on PyPI.
Notes
- The workflow uses PyPI trusted publishing via GitHub OIDC, so no
PYPI_API_TOKENsecret is required. - If the package name is not yet available on PyPI, verify that
org-idcan be claimed before wiring up automated publishing. - The publish step only runs after tests pass.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file org_id-0.1.0.tar.gz.
File metadata
- Download URL: org_id-0.1.0.tar.gz
- Upload date:
- Size: 174.1 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
87854686f9313bf91c14aec006de8bab3180b65edec2b6b24e0a91415dc43540
|
|
| MD5 |
2416be56b2a2444ecaefbee03de0aed3
|
|
| BLAKE2b-256 |
9b574cbeab2767ade068e7f2f0c6b83e9f3444fa70c2d5cd45d91d78a56c6bfa
|
Provenance
The following attestation bundles were made for org_id-0.1.0.tar.gz:
Publisher:
publish.yml on openlobbying/org-id
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
org_id-0.1.0.tar.gz -
Subject digest:
87854686f9313bf91c14aec006de8bab3180b65edec2b6b24e0a91415dc43540 - Sigstore transparency entry: 1208865953
- Sigstore integration time:
-
Permalink:
openlobbying/org-id@3cb9e8ee1d5237058b7f7218cee124f2ef1e79b4 -
Branch / Tag:
refs/tags/v0.1.0 - Owner: https://github.com/openlobbying
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@3cb9e8ee1d5237058b7f7218cee124f2ef1e79b4 -
Trigger Event:
push
-
Statement type:
File details
Details for the file org_id-0.1.0-py3-none-any.whl.
File metadata
- Download URL: org_id-0.1.0-py3-none-any.whl
- Upload date:
- Size: 176.5 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
fa09e709dc27e81afa96b42a66744e341df2ae6f10a653d3ab98661d0fdd0145
|
|
| MD5 |
7ac9ffd568489ec7a7453de67bafaea2
|
|
| BLAKE2b-256 |
a99df8eabe4eabb69936c44efd02e475d6333d43778bae1f7732bafc70109a6e
|
Provenance
The following attestation bundles were made for org_id-0.1.0-py3-none-any.whl:
Publisher:
publish.yml on openlobbying/org-id
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
org_id-0.1.0-py3-none-any.whl -
Subject digest:
fa09e709dc27e81afa96b42a66744e341df2ae6f10a653d3ab98661d0fdd0145 - Sigstore transparency entry: 1208866011
- Sigstore integration time:
-
Permalink:
openlobbying/org-id@3cb9e8ee1d5237058b7f7218cee124f2ef1e79b4 -
Branch / Tag:
refs/tags/v0.1.0 - Owner: https://github.com/openlobbying
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@3cb9e8ee1d5237058b7f7218cee124f2ef1e79b4 -
Trigger Event:
push
-
Statement type: