Skip to main content
This is a pre-production deployment of Warehouse. Changes made here affect the production instance of PyPI (pypi.python.org).
Help us improve Python packaging - Donate today!

An API for accessing a Polish REGON database

Project Description

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.

Additionaly, 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')

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

Changes

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 History

Release History

This version
History Node

1.0.3

History Node

1.0.2

History Node

1.0.1

History Node

1.0.0

Download Files

Download Files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

File Name & Checksum SHA256 Checksum Help Version File Type Upload Date
litex.regon-1.0.3-py2.7.egg (13.4 kB) Copy SHA256 Checksum SHA256 2.7 Egg Feb 14, 2017
litex.regon-1.0.3.tar.gz (6.1 kB) Copy SHA256 Checksum SHA256 Source Feb 14, 2017

Supported By

WebFaction WebFaction Technical Writing Elastic Elastic Search Pingdom Pingdom Monitoring Dyn Dyn DNS Sentry Sentry Error Logging CloudAMQP CloudAMQP RabbitMQ Heroku Heroku PaaS Kabu Creative Kabu Creative UX & Design Fastly Fastly CDN DigiCert DigiCert EV Certificate Rackspace Rackspace Cloud Servers DreamHost DreamHost Log Hosting