Skip to main content

A Python wrapper for the Brønnøysund Register Centre (Brreg) API.

Project description

🔥 Brreg Wrapper

PyPI version License: MIT Python Version

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.

✨ Features

  • Asynchronous: Built with asyncio and httpx for modern, non-blocking I/O.
  • Simple Interface: Clean methods like get_enhet, get_underenhet, search_enheter, search_underenheter.
  • Type Hinted: Fully type-hinted for better developer experience and static analysis.
  • Minimal Dependencies: Relies only on the excellent httpx library.
  • PyPI Ready: Easy to install and integrate.

🚀 Installation

Get started in seconds:

pip install brreg-wrapper
# Or using uv:
# uv pip install 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 = "982038576" # Example: Google Norway AS

        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. Remember to replace [year] and [fullname] in the file!

⚠️ Issues?

Having trouble? Found a bug? Feel free to open an issue on the GitHub repository.

Project details


Download files

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

Source Distribution

brreg_wrapper-0.1.0.tar.gz (8.8 kB view details)

Uploaded Source

Built Distribution

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

brreg_wrapper-0.1.0-py3-none-any.whl (6.1 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: brreg_wrapper-0.1.0.tar.gz
  • Upload date:
  • Size: 8.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.12.9

File hashes

Hashes for brreg_wrapper-0.1.0.tar.gz
Algorithm Hash digest
SHA256 594f73bcf333e2f20052d52f1b4058f7cecf295a7e50c7d247d017a7facca101
MD5 b4355d57f21436c32ac8faaa2f2bdb75
BLAKE2b-256 e074d9c2ba39537c3c537d6f41fb1c48b633c6ec90d93130723f28dafd39443a

See more details on using hashes here.

Provenance

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

Publisher: publish-to-pypi.yml on sondreal/brreg-wrapper

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

File details

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

File metadata

  • Download URL: brreg_wrapper-0.1.0-py3-none-any.whl
  • Upload date:
  • Size: 6.1 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.12.9

File hashes

Hashes for brreg_wrapper-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 4384233b7da6a8a8eb5ee2003ee6d9812074c31155a541df8332bfa7757e4f50
MD5 aed15a66c480b9af4844c234d26dd930
BLAKE2b-256 d3c4330d567b2f409cb09c052d43d6c238e64c0c780d759c6f3fbcab46c5c473

See more details on using hashes here.

Provenance

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

Publisher: publish-to-pypi.yml on sondreal/brreg-wrapper

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

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page