stdnum.de.handelsregisternummer

Handelsregisternummer (German company register number).

The number consists of the court where the company has registered, the type of register and the registration number.

The type of the register is either HRA or HRB where the letter “B” stands for HR section B, where limited liability companies and corporations are entered (GmbH’s and AG’s). There is also a section HRA for business partnerships (OHG’s, KG’s etc.). In other words: businesses in section HRB are limited liability companies, while businesses in HRA have personally liable partners.

More information:

>>> validate('Aachen HRA 11223')
'Aachen HRA 11223'
>>> validate('Frankfurt/Oder GnR 11223', company_form='e.G.')
'Frankfurt/Oder GnR 11223'
>>> validate('Aachen HRC 44123')
Traceback (most recent call last):
  ...
InvalidFormat: ...
>>> validate('Aachen HRA 44123', company_form='GmbH')
Traceback (most recent call last):
  ...
InvalidComponent: ...
stdnum.de.handelsregisternummer.check_offeneregister(number, timeout=30)

Retrieve registration information from the OffeneRegister.de web site.

This basically returns the JSON response from the web service as a dict. It will contain something like the following:

{
    'retrieved_at': '2018-06-24T12:34:53Z',
    'native_company_number': 'The number requested',
    'company_number': 'Compact company number',
    'registrar': 'Registar',
    'federal_state': 'State name',
    'registered_office': 'Office',
    'register_art': 'Register type',
    'register_nummer': 'Number'
    'name': 'The name of the organisation',
    'current_status': 'currently registered',
}

Will return None if the number is invalid or unknown.

stdnum.de.handelsregisternummer.compact(number)

Convert the number to the minimal representation. This strips the number of any valid separators and removes surrounding whitespace.

stdnum.de.handelsregisternummer.is_valid(number)

Check if the number is a valid company registry number.

stdnum.de.handelsregisternummer.validate(number, company_form=None)

Check if the number is a valid company registry number. If a company_form (eg. GmbH or PartG) is given, the number is validated to have the correct registry type.