OpenKVK package

Submodules

OpenKVK.Client module

class OpenKVK.Client.ApiClient(response_format=None, onlyActiveCompanies=True)[source]

Bases: OpenKVK.Client.QueryBuilder

The ApiClient is the complete python wrapper for the OpenKVK API.

Parameters:
  • response_format (string) – Sets the format of the responses
  • onlyActiveCompanies (bool) – Set’s up the client to only query active companies
get_bankruptcies(fields='*', limit=99, **kwargs)[source]

Returns list of bankrupt companies by specified parameters method should at least contain one of the following parameters:

  • kvk
  • plaats
  • rechtbank
Parameters:
  • kvk (int) – KVK number
  • plaats (string) – City name (case insensitive)
  • rechtbank (string) – Name of the court that issued the bankruptcy (case insensitive)
  • limit (int) – Maximum number of records
  • fields (list) – List of company information fields to return
Return type:

list

get_by_city(city, limit=99, fields='*', **kwargs)[source]

Return a list of company information sbicode limited to limit records

Parameters:
  • name (string) – Name of the company
  • limit (int) – Maximum number of records
Return type:

list

get_by_kvk(kvk, fields='*')[source]

Return company information in selected format if the the given kvk is found

Parameters:
  • kvk (int) – KVK-nummer
  • columns (list) – List of columns
Returns:

Company information

get_by_name(name, limit=99, fields='*')[source]

Return a list of company information dicts for the given name limited to limit records

Parameters:
  • name (string) – Name of the company
  • limit (int) – Maximum number of records
  • fields (list) – List of fields to return
Return type:

list

get_by_sbi(sbi, limit=99, fields='*', **kwargs)[source]

Return a list of company information sbicode limited to limit records

Parameters:
  • name (string) – Name of the company
  • limit (int) – Maximum number of records
Return type:

list

class OpenKVK.Client.BaseClient(response_format=None, onlyActiveCompanies=True)[source]

Bases: object

The Base client is the absolute basic client to the OpenKVK API It sets the basic configuration of the Client

Parameters:
  • response_format (string) – Sets the format of the responses
  • onlyActiveCompanies (bool) – Set’s up the client to only query active companies
BASE_URL = 'http://api.openkvk.nl/'
DEFAULT_LIMIT = 99
DEFAULT_RESPONSE_FORMAT = 'py'
request(query)[source]

Returns the raw response of the OpenKVK API. You could use this method as a minimalistic wrapper for the API, it should save you 3-4 lines of code

setActiveOnly(boolean)[source]

Sets a query filter based on the company’s status If True the results will only contain active companies. Set to False to disable this filter

setResponseFormat(format)[source]

Set the OpenKVK.Client.Client response format.Client

Possible values are :
  • json : Returns json formatted string
  • py : Returns python dict
  • csv : Returns csv formatted string
Parameters:format (string) – format to set the Client response to
class OpenKVK.Client.QueryBuilder(response_format=None, onlyActiveCompanies=True)[source]

Bases: OpenKVK.Client.BaseClient

Class to handle all of the query building, formatting and communication with the BaseClient With this class you could perform a custom query, with the additional convenience of a result parser

do_query(basequery, limit, **kwargs)[source]

Return query results of query

Parameters:
  • query (string) – SQL-92 valid query
  • limit (int) – Maximum number of results
Returns:

Result set in set response format

Return type:

query(query)[source]

Returns company information based on a custom query. for direct interaction with the openkvk api, but with the convenience of the parsers used in this module

Parameters:query (string) – A SQL-92 query string

OpenKVK.cli module

OpenKVK.cli.main()[source]

Module contents

Table Of Contents

Previous topic

Welcome to OpenKVK’s documentation!

Next topic

OpenKVK.test package

This Page