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:

{
    'companyId': 'U1206_HRB14011',
    'courtCode': 'U1206',
    'courtName': 'Chemnitz',
    'globalId': 'sn_293298',
    'isCurrent': 'True',
    'name': 'Internet hier GmbH Presentation Provider',
    'nativeReferenceNumber': 'Chemnitz HRB 14011',
    'referenceNumberFirstSeen': '2020-06-12',
    'stdRefNo': 'U1206_HRB14011',
    'validFrom': '2020-06-12',
    'validTill': '',
}

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.