Official Python client for https://cvr.dev
Project description
Python API for cvr.dev
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
Built Distribution
File details
Details for the file cvr-0.2.2.tar.gz
.
File metadata
- Download URL: cvr-0.2.2.tar.gz
- Upload date:
- Size: 7.8 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.2 CPython/3.7.17
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 628cc8e9c1e54cdbb5fd76145157d8031d48775d3019cd22fc7c976aef413bf8 |
|
MD5 | d4fc02523963905d75aec6b508098e5e |
|
BLAKE2b-256 | f049e7a34b6daa3c4b4cdf31897688354c1a1a59bda0d8ecafc8b489410efc9e |
File details
Details for the file cvr-0.2.2-py2.py3-none-any.whl
.
File metadata
- Download URL: cvr-0.2.2-py2.py3-none-any.whl
- Upload date:
- Size: 13.2 kB
- Tags: Python 2, Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.2 CPython/3.7.17
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 3e97215721f99019c8635c8c00a8b48b249e51a3b2cbc48369d3eeeb80578942 |
|
MD5 | 7a342fe8048e24ec4bcfb70b1212952f |
|
BLAKE2b-256 | 4416b34ac9afb2094541b519a79a91755189912c36b1f45b800c3bb9e165bf63 |