Skip to main content

Official Python client for https://cvr.dev

Project description

Python API for cvr.dev

Tests

The official cvr.dev Python client library.

cvr.dev is a web service that maintains a live-updated cache of the Danish CVR registry.

We aim to provide a much simpler and more modern API compared to Virk/CVR's own Elastic Search solution. Our focus is on high availability and robustness, making it as easy and reliable as possible to retrieve data about Danish companies from the CVR database.

Installation

cvr currently requires python version 3.5 or above.

Using pip

Make sure that you have pip installed, then run the following:

pip install cvr

From source

Make sure that you have pip installed, then run the following in your project folder:

pip install .

Docs

The HTTP API is available at docs.cvr.dev.

Usage

In the examples/example.py dir there's a simple example program that verifies that your API key works and fetches different data from the server.

#!/usr/bin/env python

import cvr

client = cvr.Client(api_key='your api key')
client.test_api_key()

for virksomhed in client.cvr.virksomheder(cvr_numre=[10103940]):
    print('Found virksomhed', virksomhed.cvr_nummer)

for penhed in client.cvr.produktionsenheder(p_numre=[1003388394]):
    print('Found penhed', penhed.p_nummer)

Test

This project has two types of tests: live tests and local tests. The live tests are run against our live servers and require that you set a valid API key in the environment variable CVR_DEV_TEST_API_KEY. Note: the live tests will count towards your usage.

We use the unittest module for testing. You should use the following to run the tests:

# Run simple tests
$ python -m unittest

# Also all tests
$ CVR_DEV_TEST_API_KEY="your key" python -m unittest

Alternatives

We want you to have the best experience possible; if for some reason didn't find what you were looking for at cvr.dev, reach out to us at kontakt@cvr.dev.

If you just want to check out the market, these are potential alternatives:

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

cvr-0.2.1.tar.gz (7.8 kB view details)

Uploaded Source

Built Distribution

cvr-0.2.1-py2.py3-none-any.whl (13.2 kB view details)

Uploaded Python 2Python 3

File details

Details for the file cvr-0.2.1.tar.gz.

File metadata

  • Download URL: cvr-0.2.1.tar.gz
  • Upload date:
  • Size: 7.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.8.0 pkginfo/1.8.2 readme-renderer/34.0 requests/2.25.1 requests-toolbelt/0.9.1 urllib3/1.26.9 tqdm/4.63.0 importlib-metadata/4.11.3 keyring/23.5.0 rfc3986/2.0.0 colorama/0.4.4 CPython/3.7.12

File hashes

Hashes for cvr-0.2.1.tar.gz
Algorithm Hash digest
SHA256 bb88f9b6fe46933e91931267a97d41d5f0c8159ce6ef7d9f5f57d3e2adcb056a
MD5 6b8e1a2a0a5cff6ed8efc05728982b01
BLAKE2b-256 210f481e2b4b2ada59f24dbd4930619a06c90a159774aa0e89d84132f922c05a

See more details on using hashes here.

File details

Details for the file cvr-0.2.1-py2.py3-none-any.whl.

File metadata

  • Download URL: cvr-0.2.1-py2.py3-none-any.whl
  • Upload date:
  • Size: 13.2 kB
  • Tags: Python 2, Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.8.0 pkginfo/1.8.2 readme-renderer/34.0 requests/2.25.1 requests-toolbelt/0.9.1 urllib3/1.26.9 tqdm/4.63.0 importlib-metadata/4.11.3 keyring/23.5.0 rfc3986/2.0.0 colorama/0.4.4 CPython/3.7.12

File hashes

Hashes for cvr-0.2.1-py2.py3-none-any.whl
Algorithm Hash digest
SHA256 64a825688d553071ea2a30503e7a18e795668a33fdc4a2fe0a0fd0d6609ab2c8
MD5 3dee7baa2c21db7eb67eb1a5261d3616
BLAKE2b-256 a2ebf29e2ed88bc83db2768e2006c139b9ba37b767eb402136568628e533f789

See more details on using hashes here.

Supported by

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