A Python wrapper for the Brønnøysund Register Centre (Brreg) API.
Project description
🔥 Brreg Wrapper
Tired of wrestling with raw API calls to the Brønnøysund Register Centre (Brreg)? brreg-wrapper is here to simplify your life! This sleek, asynchronous Python library provides an intuitive interface to access crucial Norwegian business information with ease.
Get details on main entities (enheter) and sub-entities (underenheter), perform searches, and integrate Norwegian business data into your applications effortlessly.
✨ Core Features
- Asynchronous: Built with
asyncioandhttpxfor modern, non-blocking I/O. - Type Hinted: Fully type-hinted for better developer experience and static analysis.
- Pydantic Models: Uses Pydantic models for robust data validation and easy object access (where applicable).
- Context Management: Supports
async withfor automatic HTTP client cleanup. - Comprehensive API Coverage: Wraps numerous endpoints from the official Brreg API.
- Minimal Dependencies: Relies primarily on
httpxandpydantic.
🚀 Installation
Get started in seconds:
pip install brreg-wrapper
# Or using uv:
uv add brreg-wrapper
💡 Usage Example
Here's a taste of how easy it is to fetch data:
import asyncio
import json
from brreg_wrapper import BrregClient
async def main():
# The client automatically handles HTTP sessions
async with BrregClient() as client:
org_nr = "923609016" # Example: Equinor ASA
print(f"🔍 Fetching details for organization number: {org_nr}")
try:
entity_info = await client.get_enhet(org_nr)
print("\n--- Entity Details ---")
# Pretty print the JSON response
print(json.dumps(entity_info, indent=2, ensure_ascii=False))
# Want to find sub-entities?
# sub_entity_info = await client.get_underenhet("some_sub_org_nr")
# print(json.dumps(sub_entity_info, indent=2, ensure_ascii=False))
except Exception as e:
print(f"\n💥 Oops! An error occurred: {e}")
print("\n✅ Done!")
if __name__ == "__main__":
asyncio.run(main())
🤝 Contributing
Contributions are welcome! If you have ideas for improvements or find a bug, please open an issue or submit a pull request on the GitHub repository.
📜 License
This project is licensed under the MIT License - see the LICENSE file for details.
⚠️ Issues?
Having trouble? Found a bug? Feel free to open an issue on the GitHub repository.
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 brreg_wrapper-0.1.4.tar.gz.
File metadata
- Download URL: brreg_wrapper-0.1.4.tar.gz
- Upload date:
- Size: 18.4 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.12.9
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
28123a31ff8cf3b85be45a332393585fd22a4d4ca496b0bf065cebe8e56bf181
|
|
| MD5 |
87d359c4184b5bfb3286e983343da8c4
|
|
| BLAKE2b-256 |
c9d9a6e96822ae306d9af0fbbb9aa512b747f21d850d9caa4dd23e9e290ab100
|
Provenance
The following attestation bundles were made for brreg_wrapper-0.1.4.tar.gz:
Publisher:
publish-to-pypi.yml on sondreal/brreg-wrapper
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
brreg_wrapper-0.1.4.tar.gz -
Subject digest:
28123a31ff8cf3b85be45a332393585fd22a4d4ca496b0bf065cebe8e56bf181 - Sigstore transparency entry: 189109966
- Sigstore integration time:
-
Permalink:
sondreal/brreg-wrapper@a882779c348a1e0b896f3c0a9591591f867d961d -
Branch / Tag:
refs/tags/v0.1.4 - Owner: https://github.com/sondreal
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish-to-pypi.yml@a882779c348a1e0b896f3c0a9591591f867d961d -
Trigger Event:
release
-
Statement type:
File details
Details for the file brreg_wrapper-0.1.4-py3-none-any.whl.
File metadata
- Download URL: brreg_wrapper-0.1.4-py3-none-any.whl
- Upload date:
- Size: 14.1 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.12.9
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
5d25cda622e56b72c1a2e5e8f0e1741977d6a3b958ec38da968ebeaf41667121
|
|
| MD5 |
92988133fe80f73fb964fbd6fce300e8
|
|
| BLAKE2b-256 |
937ca3a6ebfc606f3be899842de2a82bc405c1c6c64d31cded57247658694814
|
Provenance
The following attestation bundles were made for brreg_wrapper-0.1.4-py3-none-any.whl:
Publisher:
publish-to-pypi.yml on sondreal/brreg-wrapper
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
brreg_wrapper-0.1.4-py3-none-any.whl -
Subject digest:
5d25cda622e56b72c1a2e5e8f0e1741977d6a3b958ec38da968ebeaf41667121 - Sigstore transparency entry: 189109967
- Sigstore integration time:
-
Permalink:
sondreal/brreg-wrapper@a882779c348a1e0b896f3c0a9591591f867d961d -
Branch / Tag:
refs/tags/v0.1.4 - Owner: https://github.com/sondreal
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish-to-pypi.yml@a882779c348a1e0b896f3c0a9591591f867d961d -
Trigger Event:
release
-
Statement type: