Skip to main content

litex.regon - a frontend for Polish REGON database

Simple, pythonic wrapper for REGON database (web frontend is reachable at https://wyszukiwarkaregon.stat.gov.pl/appBIR/index.aspx). To access its SOAP API, one needs an USER_KEY issued by REGON administrators available at Regon_Bir@stat.gov.pl.

Usage example below:

>>> from litex.regon import REGONAPI

REGONAPI accepts one argument: service URL (provided by REGON Administrators).

>>> api = REGONAPI(SERVICE_URL)

First, one needs to log in (using provided user key)

>>> api.login(USER_KEY)

After login, one can start querying the database. The search method accepts the following parameters:

  • regon - single REGON number (either 9 or 14 digits long)
  • krs - single 10 digit KRS number
  • nip - single NIP (10 digits string)
  • regons - a collection of REGONs (all of them have to be either 14 or 9 digits long)
  • krss - a collection of KRSs
  • nips - a collection of NIPs

Only one parameter is used in the query. If multiple ones are passed, first from the above list is taken into account.

Additionally, a detailed parameter can be passed: detailed=True causes search method to fetch default detailed report.

>>> entities = api.search(nip='9999999999')

entities is a list of LXML objectify objects wrapping the search results (up to 100). If search was called with detailed=True, the full report is available as the detailed attribute.

If one knows the REGON of a business entity and an detailed report name, a full report can be fetched directly:

>>> detailed_report = api.full_report('99999999', 'PublDaneRaportFizycznaOsoba')

Summary report with a list of REGONs for the given criteria can be fetched by:

>>> summary_report = api.summary_report(
        '2020-01-01', 
        'BIR11NowePodmiotyPrawneOrazDzialalnosciOsFizycznych'
    )

Report names can be found in the documentation provided by REGON admins.

Changes

1.0.10

  • namespace fix (only relevant for Litex Service's internal code).

1.0.8

  • full_report and summary_report now raise REGONAPIError on empty result with detailed error information (thanks to @wolkiewiczk for suggestion)

1.0.7

  • compatibility with requests >= 2.28 (thanks to @wolkiewiczk for spotting this)

1.0.6

  • more meaningful error messages in search method (thanks @m-ganko)
  • summary reports (also kudos to @m-ganko)

1.0.5

  • reworked REGON cleanup logic (in search function, when fetching detailed report)
  • search method now uses DaneSzukajPodmioty (API version 1.1) call instead of DaneSzukaj (thanks to @kicaj for pull request)

1.0.4

  • migration from nose to py.test
  • tox configuration for Python 2 and 3 testing
  • improved handling of detailed reports (thanks to @miloszsobiczewski for logging an issue)

1.0.3

  • Python 3.6 compatibility (thanks to Mariusz Witek)

1.0.2

  • CAPTCHA removal -- no longer needed in current API

1.0.1

  • detailed report fetching logic reworked

1.0.0

  • initial release

Release files for litex.regon 1.0.10

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for litex.regon 1.0.10
File Size Uploaded
litex_regon-1.0.10.tar.gz 8.8 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for litex.regon 1.0.10
File Interpreter ABI Platform
litex_regon-1.0.10-py3-none-any.whl Python 3 none any Details

Total release size: 15.6 kB

Release files / litex_regon-1.0.10.tar.gz

Download URL litex_regon-1.0.10.tar.gz
Size 8.8 kB
Tags Source
SHA-256 checksum
How to use checksums
6efbb3df1da16ec661c89d2c858646f05fc5d2cb349e14a1ac65d9ba2d48a4d9
BLAKE2b-256 checksum
How to use checksums
d376b4e97d40a24a2ddc01549b2a4e1958f2cae9bb974c6080973a398488e2db
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.14.6

Release files / litex_regon-1.0.10-py3-none-any.whl

Download URL litex_regon-1.0.10-py3-none-any.whl
Size 6.8 kB
Tags Python 3
SHA-256 checksum
How to use checksums
3449fa649bdac66bf0b71b39b2ecc9eeac9f21f37086485d29e541f13c79b832
BLAKE2b-256 checksum
How to use checksums
4fc2dd122990a2b7bdf2351bd577c53cc6685d14930fe4a5b626ba3fe601242b
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.14.6

Release history Release notifications | RSS feed

This release

1.0.10 This release

2 release files

1.0.9

2 release files

1.0.8

2 release files

1.0.7

1 release file

1.0.6

2 release files

1.0.5

2 release files

1.0.4

2 release files

1.0.3

2 release files

1.0.2

2 release files

1.0.1

2 release files

1.0.0

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page