handelsregister 0.1.0__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2023 Fusionbase GmbH
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
@@ -0,0 +1,77 @@
1
+ # MANIFEST.in
2
+ # Exclude everything that appears in your .gitignore.
3
+
4
+ # -----------------------------------------------------------------------------
5
+ # Python bytecode
6
+ recursive-exclude __pycache__ *
7
+ global-exclude *.py[cod]
8
+ global-exclude *$py.class
9
+
10
+ # -----------------------------------------------------------------------------
11
+ # Distribution / packaging
12
+ recursive-exclude dist *
13
+ recursive-exclude build *
14
+ recursive-exclude *.egg-info *
15
+ global-exclude *.egg
16
+ exclude MANIFEST
17
+
18
+ # -----------------------------------------------------------------------------
19
+ # Unit test / coverage reports
20
+ exclude .coverage
21
+ global-exclude .coverage.*
22
+ recursive-exclude .pytest_cache *
23
+ recursive-exclude htmlcov *
24
+ exclude coverage.xml
25
+ global-exclude *.cover
26
+
27
+ # -----------------------------------------------------------------------------
28
+ # Virtual environments
29
+ recursive-exclude venv *
30
+ recursive-exclude env *
31
+ recursive-exclude ENV *
32
+ recursive-exclude .env *
33
+ recursive-exclude .venv *
34
+ exclude .env
35
+ global-exclude .env.*
36
+
37
+ # -----------------------------------------------------------------------------
38
+ # IDE specific files
39
+ recursive-exclude .idea *
40
+ recursive-exclude .vscode *
41
+ global-exclude *.swp
42
+ global-exclude *.swo
43
+ global-exclude .DS_Store
44
+
45
+ # -----------------------------------------------------------------------------
46
+ # Jupyter Notebook
47
+ recursive-exclude .ipynb_checkpoints *
48
+
49
+ # -----------------------------------------------------------------------------
50
+ # Log files
51
+ global-exclude *.log
52
+ recursive-exclude logs *
53
+
54
+ # -----------------------------------------------------------------------------
55
+ # Specific to this project
56
+ exclude api_response_sample.json
57
+
58
+ # -----------------------------------------------------------------------------
59
+ # Documentation
60
+ recursive-exclude docs/_build *
61
+ recursive-exclude docs/site *
62
+
63
+ # -----------------------------------------------------------------------------
64
+ # Local development configuration
65
+ exclude local_settings.py
66
+ exclude settings_local.py
67
+
68
+ # -----------------------------------------------------------------------------
69
+ # Cached files
70
+ recursive-exclude .cache *
71
+ recursive-exclude .github *
72
+ recursive-exclude .git *
73
+ recursive-exclude dist *
74
+
75
+ # -----------------------------------------------------------------------------
76
+ # Other credentials / secrets
77
+ exclude .git-credentials
@@ -0,0 +1,231 @@
1
+ Metadata-Version: 2.4
2
+ Name: handelsregister
3
+ Version: 0.1.0
4
+ Summary: Python SDK für den Zugriff auf die Handelsregister AI API
5
+ Home-page: https://handelsregister.ai/
6
+ Author: Handelsregister.ai
7
+ Author-email: Handelsregister Team <info@handelsregister.ai>
8
+ License: MIT License
9
+
10
+ Copyright (c) 2023 Fusionbase GmbH
11
+
12
+ Permission is hereby granted, free of charge, to any person obtaining a copy
13
+ of this software and associated documentation files (the "Software"), to deal
14
+ in the Software without restriction, including without limitation the rights
15
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
16
+ copies of the Software, and to permit persons to whom the Software is
17
+ furnished to do so, subject to the following conditions:
18
+
19
+ The above copyright notice and this permission notice shall be included in all
20
+ copies or substantial portions of the Software.
21
+
22
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
23
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
24
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
25
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
26
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
27
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
28
+ SOFTWARE.
29
+
30
+ Project-URL: Homepage, https://github.com/Handelsregister-AI/handelsregister
31
+ Project-URL: Bug Reports, https://github.com/Handelsregister-AI/handelsregister/issues
32
+ Keywords: handelsregister,api,german company data,business data
33
+ Classifier: Development Status :: 3 - Alpha
34
+ Classifier: Intended Audience :: Developers
35
+ Classifier: License :: OSI Approved :: MIT License
36
+ Classifier: Programming Language :: Python :: 3
37
+ Classifier: Programming Language :: Python :: 3.8
38
+ Classifier: Programming Language :: Python :: 3.9
39
+ Classifier: Programming Language :: Python :: 3.10
40
+ Requires-Python: >=3.7
41
+ Description-Content-Type: text/markdown
42
+ License-File: LICENSE
43
+ Requires-Dist: httpx>=0.23.0
44
+ Requires-Dist: tqdm>=4.0.0
45
+ Dynamic: author
46
+ Dynamic: home-page
47
+ Dynamic: license-file
48
+ Dynamic: requires-python
49
+
50
+ # 🔍 Handelsregister Python SDK
51
+
52
+ [![PyPI version](https://img.shields.io/pypi/v/handelsregister.svg)](https://pypi.org/project/handelsregister/)
53
+ [![Python Versions](https://img.shields.io/pypi/pyversions/handelsregister.svg)](https://pypi.org/project/handelsregister/)
54
+ [![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://opensource.org/licenses/MIT)
55
+
56
+ A modern Python client for accessing the [Handelsregister.ai](https://handelsregister.ai) API. This SDK provides convenient access to German company registry data with comprehensive information about companies, their management, financial data, and more.
57
+
58
+ ## ✨ Features
59
+
60
+ - 🔎 **Easy Search**: Find companies using name, location and more
61
+ - 📊 **Financial Data**: Access balance sheets, financial KPIs and P&L statements
62
+ - 👥 **Management Information**: Details on current and past management positions
63
+ - 📃 **Company Details**: Comprehensive legal entity information
64
+ - 📚 **Batch Processing**: Enrich large datasets with company data
65
+ - 🔄 **Resilient Design**: Built-in retries, error handling, and snapshot capabilities
66
+
67
+ ## 📦 Installation
68
+
69
+ ```bash
70
+ pip install handelsregister
71
+ ```
72
+
73
+ ## 🔑 Authentication
74
+
75
+ You'll need an API key from [Handelsregister.ai](https://handelsregister.ai). You can pass it explicitly or set it as an environment variable:
76
+
77
+ ```bash
78
+ export HANDELSREGISTER_API_KEY=your_api_key_here
79
+ ```
80
+
81
+ ## 🚀 Quick Start
82
+
83
+ ### Basic Usage
84
+
85
+ ```python
86
+ from handelsregister import Handelsregister
87
+
88
+ # Create client (API key from environment variable or pass explicitly)
89
+ client = Handelsregister(api_key="your_api_key_here")
90
+
91
+ # Fetch company information
92
+ company_data = client.fetch_organization(q="Konux GmbH München")
93
+
94
+ # Access company data
95
+ print(f"Company: {company_data['name']}")
96
+ print(f"Registration: {company_data['registration']['register_number']}")
97
+ print(f"Status: {company_data['status']}")
98
+ ```
99
+
100
+ ### Object-Oriented Interface
101
+
102
+ For a more convenient, object-oriented access to company data:
103
+
104
+ ```python
105
+ from handelsregister import Company
106
+
107
+ # Create company object with desired features
108
+ company = Company(
109
+ "BMW AG München",
110
+ features=[
111
+ "related_persons", # Get management information
112
+ "financial_kpi", # Get financial KPIs
113
+ "balance_sheet_accounts", # Get balance sheet data
114
+ ]
115
+ )
116
+
117
+ # Access basic information
118
+ print(f"Name: {company.name}")
119
+ print(f"Registration: {company.registration_number}")
120
+ print(f"Status: {'Active' if company.is_active else 'Inactive'}")
121
+ print(f"Address: {company.formatted_address}")
122
+
123
+ # Get management information
124
+ for person in company.current_related_persons:
125
+ print(f"Manager: {person['name']} - {person['role']['en']['long']}")
126
+
127
+ # Get financial data for the most recent year
128
+ years = company.financial_years
129
+ if years:
130
+ recent_year = years[0]
131
+ revenue = company.get_financial_kpi_for_year(recent_year, "revenue")
132
+ employees = company.get_financial_kpi_for_year(recent_year, "employees")
133
+ print(f"Revenue ({recent_year}): {revenue}")
134
+ print(f"Employees ({recent_year}): {employees}")
135
+ ```
136
+
137
+ ## 📊 Data Enrichment
138
+
139
+ The SDK allows you to enrich datasets with company information:
140
+
141
+ ```python
142
+ from handelsregister import Handelsregister
143
+ import json
144
+
145
+ # Sample data in a JSON file
146
+ data = [
147
+ {"company_name": "BMW AG", "city": "München"},
148
+ {"company_name": "Konux GmbH", "city": "München"},
149
+ {"company_name": "OroraTech GmbH", "city": "Walldorf"}
150
+ ]
151
+
152
+ # Save to a file
153
+ with open("companies.json", "w") as f:
154
+ json.dump(data, f)
155
+
156
+ # Create client
157
+ client = Handelsregister()
158
+
159
+ # Enrich the data
160
+ client.enrich(
161
+ file_path="companies.json",
162
+ input_type="json",
163
+ query_properties={
164
+ "name": "company_name", # Map field 'company_name' to query parameter 'name'
165
+ "location": "city" # Map field 'city' to query parameter 'location'
166
+ },
167
+ snapshot_dir="snapshots", # Store intermediate results
168
+ params={
169
+ "features": ["related_persons", "financial_kpi"],
170
+ "ai_search": "off"
171
+ }
172
+ )
173
+ ```
174
+
175
+ ## 📋 Available Features
176
+
177
+ The API supports several feature flags that you can include in your requests:
178
+
179
+ | Feature Flag | Description |
180
+ |--------------|-------------|
181
+ | `related_persons` | Management and executive information |
182
+ | `financial_kpi` | Financial key performance indicators |
183
+ | `balance_sheet_accounts` | Balance sheet data |
184
+ | `profit_and_loss_account` | Profit and loss statement data |
185
+ | `publications` | Official publications |
186
+
187
+ ## 🔍 Company Properties
188
+
189
+ The `Company` class provides convenient access to all company information:
190
+
191
+ ```python
192
+ # Basic information
193
+ company.name
194
+ company.entity_id
195
+ company.status
196
+ company.is_active
197
+ company.purpose
198
+
199
+ # Registration info
200
+ company.registration_number
201
+ company.registration_court
202
+ company.registration_type
203
+ company.registration_date
204
+
205
+ # Contact and address
206
+ company.address
207
+ company.formatted_address
208
+ company.coordinates
209
+ company.website
210
+ company.phone_number
211
+
212
+ # Financial data
213
+ company.financial_kpi
214
+ company.financial_years
215
+ company.balance_sheet_accounts
216
+ company.profit_and_loss_account
217
+
218
+ # Management
219
+ company.current_related_persons
220
+ company.past_related_persons
221
+ company.get_related_persons_by_role("MANAGING_DIRECTOR")
222
+
223
+ # Method helpers
224
+ company.get_financial_kpi_for_year(2022)
225
+ company.get_balance_sheet_for_year(2022)
226
+ company.get_profit_and_loss_for_year(2022)
227
+ ```
228
+
229
+ ## 📜 License
230
+
231
+ This SDK is licensed under the MIT License - see the [LICENSE](LICENSE) file for details.
@@ -0,0 +1,182 @@
1
+ # 🔍 Handelsregister Python SDK
2
+
3
+ [![PyPI version](https://img.shields.io/pypi/v/handelsregister.svg)](https://pypi.org/project/handelsregister/)
4
+ [![Python Versions](https://img.shields.io/pypi/pyversions/handelsregister.svg)](https://pypi.org/project/handelsregister/)
5
+ [![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://opensource.org/licenses/MIT)
6
+
7
+ A modern Python client for accessing the [Handelsregister.ai](https://handelsregister.ai) API. This SDK provides convenient access to German company registry data with comprehensive information about companies, their management, financial data, and more.
8
+
9
+ ## ✨ Features
10
+
11
+ - 🔎 **Easy Search**: Find companies using name, location and more
12
+ - 📊 **Financial Data**: Access balance sheets, financial KPIs and P&L statements
13
+ - 👥 **Management Information**: Details on current and past management positions
14
+ - 📃 **Company Details**: Comprehensive legal entity information
15
+ - 📚 **Batch Processing**: Enrich large datasets with company data
16
+ - 🔄 **Resilient Design**: Built-in retries, error handling, and snapshot capabilities
17
+
18
+ ## 📦 Installation
19
+
20
+ ```bash
21
+ pip install handelsregister
22
+ ```
23
+
24
+ ## 🔑 Authentication
25
+
26
+ You'll need an API key from [Handelsregister.ai](https://handelsregister.ai). You can pass it explicitly or set it as an environment variable:
27
+
28
+ ```bash
29
+ export HANDELSREGISTER_API_KEY=your_api_key_here
30
+ ```
31
+
32
+ ## 🚀 Quick Start
33
+
34
+ ### Basic Usage
35
+
36
+ ```python
37
+ from handelsregister import Handelsregister
38
+
39
+ # Create client (API key from environment variable or pass explicitly)
40
+ client = Handelsregister(api_key="your_api_key_here")
41
+
42
+ # Fetch company information
43
+ company_data = client.fetch_organization(q="Konux GmbH München")
44
+
45
+ # Access company data
46
+ print(f"Company: {company_data['name']}")
47
+ print(f"Registration: {company_data['registration']['register_number']}")
48
+ print(f"Status: {company_data['status']}")
49
+ ```
50
+
51
+ ### Object-Oriented Interface
52
+
53
+ For a more convenient, object-oriented access to company data:
54
+
55
+ ```python
56
+ from handelsregister import Company
57
+
58
+ # Create company object with desired features
59
+ company = Company(
60
+ "BMW AG München",
61
+ features=[
62
+ "related_persons", # Get management information
63
+ "financial_kpi", # Get financial KPIs
64
+ "balance_sheet_accounts", # Get balance sheet data
65
+ ]
66
+ )
67
+
68
+ # Access basic information
69
+ print(f"Name: {company.name}")
70
+ print(f"Registration: {company.registration_number}")
71
+ print(f"Status: {'Active' if company.is_active else 'Inactive'}")
72
+ print(f"Address: {company.formatted_address}")
73
+
74
+ # Get management information
75
+ for person in company.current_related_persons:
76
+ print(f"Manager: {person['name']} - {person['role']['en']['long']}")
77
+
78
+ # Get financial data for the most recent year
79
+ years = company.financial_years
80
+ if years:
81
+ recent_year = years[0]
82
+ revenue = company.get_financial_kpi_for_year(recent_year, "revenue")
83
+ employees = company.get_financial_kpi_for_year(recent_year, "employees")
84
+ print(f"Revenue ({recent_year}): {revenue}")
85
+ print(f"Employees ({recent_year}): {employees}")
86
+ ```
87
+
88
+ ## 📊 Data Enrichment
89
+
90
+ The SDK allows you to enrich datasets with company information:
91
+
92
+ ```python
93
+ from handelsregister import Handelsregister
94
+ import json
95
+
96
+ # Sample data in a JSON file
97
+ data = [
98
+ {"company_name": "BMW AG", "city": "München"},
99
+ {"company_name": "Konux GmbH", "city": "München"},
100
+ {"company_name": "OroraTech GmbH", "city": "Walldorf"}
101
+ ]
102
+
103
+ # Save to a file
104
+ with open("companies.json", "w") as f:
105
+ json.dump(data, f)
106
+
107
+ # Create client
108
+ client = Handelsregister()
109
+
110
+ # Enrich the data
111
+ client.enrich(
112
+ file_path="companies.json",
113
+ input_type="json",
114
+ query_properties={
115
+ "name": "company_name", # Map field 'company_name' to query parameter 'name'
116
+ "location": "city" # Map field 'city' to query parameter 'location'
117
+ },
118
+ snapshot_dir="snapshots", # Store intermediate results
119
+ params={
120
+ "features": ["related_persons", "financial_kpi"],
121
+ "ai_search": "off"
122
+ }
123
+ )
124
+ ```
125
+
126
+ ## 📋 Available Features
127
+
128
+ The API supports several feature flags that you can include in your requests:
129
+
130
+ | Feature Flag | Description |
131
+ |--------------|-------------|
132
+ | `related_persons` | Management and executive information |
133
+ | `financial_kpi` | Financial key performance indicators |
134
+ | `balance_sheet_accounts` | Balance sheet data |
135
+ | `profit_and_loss_account` | Profit and loss statement data |
136
+ | `publications` | Official publications |
137
+
138
+ ## 🔍 Company Properties
139
+
140
+ The `Company` class provides convenient access to all company information:
141
+
142
+ ```python
143
+ # Basic information
144
+ company.name
145
+ company.entity_id
146
+ company.status
147
+ company.is_active
148
+ company.purpose
149
+
150
+ # Registration info
151
+ company.registration_number
152
+ company.registration_court
153
+ company.registration_type
154
+ company.registration_date
155
+
156
+ # Contact and address
157
+ company.address
158
+ company.formatted_address
159
+ company.coordinates
160
+ company.website
161
+ company.phone_number
162
+
163
+ # Financial data
164
+ company.financial_kpi
165
+ company.financial_years
166
+ company.balance_sheet_accounts
167
+ company.profit_and_loss_account
168
+
169
+ # Management
170
+ company.current_related_persons
171
+ company.past_related_persons
172
+ company.get_related_persons_by_role("MANAGING_DIRECTOR")
173
+
174
+ # Method helpers
175
+ company.get_financial_kpi_for_year(2022)
176
+ company.get_balance_sheet_for_year(2022)
177
+ company.get_profit_and_loss_for_year(2022)
178
+ ```
179
+
180
+ ## 📜 License
181
+
182
+ This SDK is licensed under the MIT License - see the [LICENSE](LICENSE) file for details.
@@ -0,0 +1,13 @@
1
+ from .client import Handelsregister
2
+ from .exceptions import HandelsregisterError, InvalidResponseError, AuthenticationError
3
+ from .company import Company
4
+ from .version import __version__
5
+
6
+ __all__ = [
7
+ "Handelsregister",
8
+ "Company",
9
+ "HandelsregisterError",
10
+ "InvalidResponseError",
11
+ "AuthenticationError",
12
+ "__version__",
13
+ ]