globaldatafinance 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.
- globaldatafinance-0.1.0/LICENSE +201 -0
- globaldatafinance-0.1.0/PKG-INFO +275 -0
- globaldatafinance-0.1.0/README.md +245 -0
- globaldatafinance-0.1.0/pyproject.toml +70 -0
- globaldatafinance-0.1.0/src/globaldatafinance/__init__.py +6 -0
- globaldatafinance-0.1.0/src/globaldatafinance/application/__init__.py +7 -0
- globaldatafinance-0.1.0/src/globaldatafinance/application/b3_docs/__init__.py +3 -0
- globaldatafinance-0.1.0/src/globaldatafinance/application/b3_docs/extraction_result_formatter.py +116 -0
- globaldatafinance-0.1.0/src/globaldatafinance/application/b3_docs/historical_quotes.py +388 -0
- globaldatafinance-0.1.0/src/globaldatafinance/application/b3_docs/result_formatters/__init__.py +3 -0
- globaldatafinance-0.1.0/src/globaldatafinance/application/b3_docs/result_formatters/historical_quotes_formatter.py +73 -0
- globaldatafinance-0.1.0/src/globaldatafinance/application/cvm_docs/__init__.py +3 -0
- globaldatafinance-0.1.0/src/globaldatafinance/application/cvm_docs/download_result_formatter.py +187 -0
- globaldatafinance-0.1.0/src/globaldatafinance/application/cvm_docs/fundamental_stocks_data.py +283 -0
- globaldatafinance-0.1.0/src/globaldatafinance/brazil/__init__.py +52 -0
- globaldatafinance-0.1.0/src/globaldatafinance/brazil/app_geral.py +100 -0
- globaldatafinance-0.1.0/src/globaldatafinance/brazil/b3_data/__init__.py +19 -0
- globaldatafinance-0.1.0/src/globaldatafinance/brazil/b3_data/historical_quotes/README.md +113 -0
- globaldatafinance-0.1.0/src/globaldatafinance/brazil/b3_data/historical_quotes/__init__.py +19 -0
- globaldatafinance-0.1.0/src/globaldatafinance/brazil/b3_data/historical_quotes/application/__init__.py +23 -0
- globaldatafinance-0.1.0/src/globaldatafinance/brazil/b3_data/historical_quotes/application/use_cases/__init__.py +21 -0
- globaldatafinance-0.1.0/src/globaldatafinance/brazil/b3_data/historical_quotes/application/use_cases/docs_to_extraction_use_case.py +96 -0
- globaldatafinance-0.1.0/src/globaldatafinance/brazil/b3_data/historical_quotes/application/use_cases/extract_historical_quotes_use_case.py +102 -0
- globaldatafinance-0.1.0/src/globaldatafinance/brazil/b3_data/historical_quotes/application/use_cases/get_available_assets.py +14 -0
- globaldatafinance-0.1.0/src/globaldatafinance/brazil/b3_data/historical_quotes/application/use_cases/get_available_years_use_case.py +19 -0
- globaldatafinance-0.1.0/src/globaldatafinance/brazil/b3_data/historical_quotes/application/use_cases/range_years_use_case.py +31 -0
- globaldatafinance-0.1.0/src/globaldatafinance/brazil/b3_data/historical_quotes/application/use_cases/set_assets_use_case.py +24 -0
- globaldatafinance-0.1.0/src/globaldatafinance/brazil/b3_data/historical_quotes/application/use_cases/set_docs_to_download_use_case.py +36 -0
- globaldatafinance-0.1.0/src/globaldatafinance/brazil/b3_data/historical_quotes/application/use_cases/validate_destination_path_use_case.py +39 -0
- globaldatafinance-0.1.0/src/globaldatafinance/brazil/b3_data/historical_quotes/application/use_cases/validate_extraction_config_use_case.py +24 -0
- globaldatafinance-0.1.0/src/globaldatafinance/brazil/b3_data/historical_quotes/domain/__init__.py +16 -0
- globaldatafinance-0.1.0/src/globaldatafinance/brazil/b3_data/historical_quotes/domain/entities/__init__.py +5 -0
- globaldatafinance-0.1.0/src/globaldatafinance/brazil/b3_data/historical_quotes/domain/entities/docs_to_extractor.py +11 -0
- globaldatafinance-0.1.0/src/globaldatafinance/brazil/b3_data/historical_quotes/domain/services/__init__.py +9 -0
- globaldatafinance-0.1.0/src/globaldatafinance/brazil/b3_data/historical_quotes/domain/services/available_assets_service.py +114 -0
- globaldatafinance-0.1.0/src/globaldatafinance/brazil/b3_data/historical_quotes/domain/services/extraction_config_service.py +61 -0
- globaldatafinance-0.1.0/src/globaldatafinance/brazil/b3_data/historical_quotes/domain/services/year_validation_service.py +75 -0
- globaldatafinance-0.1.0/src/globaldatafinance/brazil/b3_data/historical_quotes/domain/value_objects/__init__.py +7 -0
- globaldatafinance-0.1.0/src/globaldatafinance/brazil/b3_data/historical_quotes/domain/value_objects/processing_mode.py +60 -0
- globaldatafinance-0.1.0/src/globaldatafinance/brazil/b3_data/historical_quotes/domain/value_objects/year_range.py +77 -0
- globaldatafinance-0.1.0/src/globaldatafinance/brazil/b3_data/historical_quotes/exceptions/__init__.py +17 -0
- globaldatafinance-0.1.0/src/globaldatafinance/brazil/b3_data/historical_quotes/exceptions/exceptions.py +39 -0
- globaldatafinance-0.1.0/src/globaldatafinance/brazil/b3_data/historical_quotes/infra/__init__.py +15 -0
- globaldatafinance-0.1.0/src/globaldatafinance/brazil/b3_data/historical_quotes/infra/cotahist_parser.py +292 -0
- globaldatafinance-0.1.0/src/globaldatafinance/brazil/b3_data/historical_quotes/infra/extraction_service.py +651 -0
- globaldatafinance-0.1.0/src/globaldatafinance/brazil/b3_data/historical_quotes/infra/extraction_service_factory.py +50 -0
- globaldatafinance-0.1.0/src/globaldatafinance/brazil/b3_data/historical_quotes/infra/file_system_service.py +118 -0
- globaldatafinance-0.1.0/src/globaldatafinance/brazil/b3_data/historical_quotes/infra/parquet_writer.py +445 -0
- globaldatafinance-0.1.0/src/globaldatafinance/brazil/b3_data/historical_quotes/infra/zip_reader.py +28 -0
- globaldatafinance-0.1.0/src/globaldatafinance/brazil/cvm/__init__.py +17 -0
- globaldatafinance-0.1.0/src/globaldatafinance/brazil/cvm/fundamental_stocks_data/README.md +173 -0
- globaldatafinance-0.1.0/src/globaldatafinance/brazil/cvm/fundamental_stocks_data/__init__.py +56 -0
- globaldatafinance-0.1.0/src/globaldatafinance/brazil/cvm/fundamental_stocks_data/application/__init__.py +20 -0
- globaldatafinance-0.1.0/src/globaldatafinance/brazil/cvm/fundamental_stocks_data/application/interfaces/__init__.py +4 -0
- globaldatafinance-0.1.0/src/globaldatafinance/brazil/cvm/fundamental_stocks_data/application/interfaces/download_repository.py +25 -0
- globaldatafinance-0.1.0/src/globaldatafinance/brazil/cvm/fundamental_stocks_data/application/interfaces/file_extractor_repository.py +20 -0
- globaldatafinance-0.1.0/src/globaldatafinance/brazil/cvm/fundamental_stocks_data/application/use_cases/__init__.py +15 -0
- globaldatafinance-0.1.0/src/globaldatafinance/brazil/cvm/fundamental_stocks_data/application/use_cases/download_documents_use_case.py +145 -0
- globaldatafinance-0.1.0/src/globaldatafinance/brazil/cvm/fundamental_stocks_data/application/use_cases/generate_range_years_use_cases.py +33 -0
- globaldatafinance-0.1.0/src/globaldatafinance/brazil/cvm/fundamental_stocks_data/application/use_cases/generate_urls_use_case.py +52 -0
- globaldatafinance-0.1.0/src/globaldatafinance/brazil/cvm/fundamental_stocks_data/application/use_cases/get_available_docs_use_case.py +31 -0
- globaldatafinance-0.1.0/src/globaldatafinance/brazil/cvm/fundamental_stocks_data/application/use_cases/get_available_years_use_case.py +36 -0
- globaldatafinance-0.1.0/src/globaldatafinance/brazil/cvm/fundamental_stocks_data/application/use_cases/verify_paths_use_cases.py +146 -0
- globaldatafinance-0.1.0/src/globaldatafinance/brazil/cvm/fundamental_stocks_data/domain/__init__.py +12 -0
- globaldatafinance-0.1.0/src/globaldatafinance/brazil/cvm/fundamental_stocks_data/domain/available_docs.py +93 -0
- globaldatafinance-0.1.0/src/globaldatafinance/brazil/cvm/fundamental_stocks_data/domain/available_years.py +67 -0
- globaldatafinance-0.1.0/src/globaldatafinance/brazil/cvm/fundamental_stocks_data/domain/dict_zips_download.py +40 -0
- globaldatafinance-0.1.0/src/globaldatafinance/brazil/cvm/fundamental_stocks_data/domain/download_result.py +40 -0
- globaldatafinance-0.1.0/src/globaldatafinance/brazil/cvm/fundamental_stocks_data/exceptions/__init__.py +19 -0
- globaldatafinance-0.1.0/src/globaldatafinance/brazil/cvm/fundamental_stocks_data/exceptions/exceptions_domain.py +46 -0
- globaldatafinance-0.1.0/src/globaldatafinance/brazil/cvm/fundamental_stocks_data/infra/__init__.py +6 -0
- globaldatafinance-0.1.0/src/globaldatafinance/brazil/cvm/fundamental_stocks_data/infra/adapters/__init__.py +7 -0
- globaldatafinance-0.1.0/src/globaldatafinance/brazil/cvm/fundamental_stocks_data/infra/adapters/extractors_docs_adapter/__init__.py +3 -0
- globaldatafinance-0.1.0/src/globaldatafinance/brazil/cvm/fundamental_stocks_data/infra/adapters/extractors_docs_adapter/parquet_extractor.py +230 -0
- globaldatafinance-0.1.0/src/globaldatafinance/brazil/cvm/fundamental_stocks_data/infra/adapters/requests_adapter/__init__.py +5 -0
- globaldatafinance-0.1.0/src/globaldatafinance/brazil/cvm/fundamental_stocks_data/infra/adapters/requests_adapter/async_download_adapter.py +485 -0
- globaldatafinance-0.1.0/src/globaldatafinance/core/__init__.py +32 -0
- globaldatafinance-0.1.0/src/globaldatafinance/core/config.py +82 -0
- globaldatafinance-0.1.0/src/globaldatafinance/core/logging_config.py +411 -0
- globaldatafinance-0.1.0/src/globaldatafinance/core/utils/__init__.py +11 -0
- globaldatafinance-0.1.0/src/globaldatafinance/core/utils/progress.py +46 -0
- globaldatafinance-0.1.0/src/globaldatafinance/core/utils/resource_monitor.py +388 -0
- globaldatafinance-0.1.0/src/globaldatafinance/core/utils/retry_strategy.py +60 -0
- globaldatafinance-0.1.0/src/globaldatafinance/macro_exceptions/__init__.py +25 -0
- globaldatafinance-0.1.0/src/globaldatafinance/macro_exceptions/macro_exceptions.py +63 -0
- globaldatafinance-0.1.0/src/globaldatafinance/macro_infra/__init__.py +5 -0
- globaldatafinance-0.1.0/src/globaldatafinance/macro_infra/extractor_file.py +321 -0
- globaldatafinance-0.1.0/src/globaldatafinance/macro_infra/read_files.py +58 -0
- globaldatafinance-0.1.0/src/globaldatafinance/macro_infra/requests_adapter.py +137 -0
|
@@ -0,0 +1,201 @@
|
|
|
1
|
+
Apache License
|
|
2
|
+
Version 2.0, January 2004
|
|
3
|
+
http://www.apache.org/licenses/
|
|
4
|
+
|
|
5
|
+
TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
|
|
6
|
+
|
|
7
|
+
1. Definitions.
|
|
8
|
+
|
|
9
|
+
"License" shall mean the terms and conditions for use, reproduction,
|
|
10
|
+
and distribution as defined by Sections 1 through 9 of this document.
|
|
11
|
+
|
|
12
|
+
"Licensor" shall mean the copyright owner or entity authorized by
|
|
13
|
+
the copyright owner that is granting the License.
|
|
14
|
+
|
|
15
|
+
"Legal Entity" shall mean the union of the acting entity and all
|
|
16
|
+
other entities that control, are controlled by, or are under common
|
|
17
|
+
control with that entity. For the purposes of this definition,
|
|
18
|
+
"control" means (i) the power, direct or indirect, to cause the
|
|
19
|
+
direction or management of such entity, whether by contract or
|
|
20
|
+
otherwise, or (ii) ownership of fifty percent (50%) or more of the
|
|
21
|
+
outstanding shares, or (iii) beneficial ownership of such entity.
|
|
22
|
+
|
|
23
|
+
"You" (or "Your") shall mean an individual or Legal Entity
|
|
24
|
+
exercising permissions granted by this License.
|
|
25
|
+
|
|
26
|
+
"Source" form shall mean the preferred form for making modifications,
|
|
27
|
+
including but not limited to software source code, documentation
|
|
28
|
+
source, and configuration files.
|
|
29
|
+
|
|
30
|
+
"Object" form shall mean any form resulting from mechanical
|
|
31
|
+
transformation or translation of a Source form, including but
|
|
32
|
+
not limited to compiled object code, generated documentation,
|
|
33
|
+
and conversions to other media types.
|
|
34
|
+
|
|
35
|
+
"Work" shall mean the work of authorship, whether in Source or
|
|
36
|
+
Object form, made available under the License, as indicated by a
|
|
37
|
+
copyright notice that is included in or attached to the work
|
|
38
|
+
(an example is provided in the Appendix below).
|
|
39
|
+
|
|
40
|
+
"Derivative Works" shall mean any work, whether in Source or Object
|
|
41
|
+
form, that is based on (or derived from) the Work and for which the
|
|
42
|
+
editorial revisions, annotations, elaborations, or other modifications
|
|
43
|
+
represent, as a whole, an original work of authorship. For the purposes
|
|
44
|
+
of this License, Derivative Works shall not include works that remain
|
|
45
|
+
separable from, or merely link (or bind by name) to the interfaces of,
|
|
46
|
+
the Work and Derivative Works thereof.
|
|
47
|
+
|
|
48
|
+
"Contribution" shall mean any work of authorship, including
|
|
49
|
+
the original version of the Work and any modifications or additions
|
|
50
|
+
to that Work or Derivative Works thereof, that is intentionally
|
|
51
|
+
submitted to Licensor for inclusion in the Work by the copyright owner
|
|
52
|
+
or by an individual or Legal Entity authorized to submit on behalf of
|
|
53
|
+
the copyright owner. For the purposes of this definition, "submitted"
|
|
54
|
+
means any form of electronic, verbal, or written communication sent
|
|
55
|
+
to the Licensor or its representatives, including but not limited to
|
|
56
|
+
communication on electronic mailing lists, source code control systems,
|
|
57
|
+
and issue tracking systems that are managed by, or on behalf of, the
|
|
58
|
+
Licensor for the purpose of discussing and improving the Work, but
|
|
59
|
+
excluding communication that is conspicuously marked or otherwise
|
|
60
|
+
designated in writing by the copyright owner as "Not a Contribution."
|
|
61
|
+
|
|
62
|
+
"Contributor" shall mean Licensor and any individual or Legal Entity
|
|
63
|
+
on behalf of whom a Contribution has been received by Licensor and
|
|
64
|
+
subsequently incorporated within the Work.
|
|
65
|
+
|
|
66
|
+
2. Grant of Copyright License. Subject to the terms and conditions of
|
|
67
|
+
this License, each Contributor hereby grants to You a perpetual,
|
|
68
|
+
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
|
|
69
|
+
copyright license to reproduce, prepare Derivative Works of,
|
|
70
|
+
publicly display, publicly perform, sublicense, and distribute the
|
|
71
|
+
Work and such Derivative Works in Source or Object form.
|
|
72
|
+
|
|
73
|
+
3. Grant of Patent License. Subject to the terms and conditions of
|
|
74
|
+
this License, each Contributor hereby grants to You a perpetual,
|
|
75
|
+
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
|
|
76
|
+
(except as stated in this section) patent license to make, have made,
|
|
77
|
+
use, offer to sell, sell, import, and otherwise transfer the Work,
|
|
78
|
+
where such license applies only to those patent claims licensable
|
|
79
|
+
by such Contributor that are necessarily infringed by their
|
|
80
|
+
Contribution(s) alone or by combination of their Contribution(s)
|
|
81
|
+
with the Work to which such Contribution(s) was submitted. If You
|
|
82
|
+
institute patent litigation against any entity (including a
|
|
83
|
+
cross-claim or counterclaim in a lawsuit) alleging that the Work
|
|
84
|
+
or a Contribution incorporated within the Work constitutes direct
|
|
85
|
+
or contributory patent infringement, then any patent licenses
|
|
86
|
+
granted to You under this License for that Work shall terminate
|
|
87
|
+
as of the date such litigation is filed.
|
|
88
|
+
|
|
89
|
+
4. Redistribution. You may reproduce and distribute copies of the
|
|
90
|
+
Work or Derivative Works thereof in any medium, with or without
|
|
91
|
+
modifications, and in Source or Object form, provided that You
|
|
92
|
+
meet the following conditions:
|
|
93
|
+
|
|
94
|
+
(a) You must give any other recipients of the Work or
|
|
95
|
+
Derivative Works a copy of this License; and
|
|
96
|
+
|
|
97
|
+
(b) You must cause any modified files to carry prominent notices
|
|
98
|
+
stating that You changed the files; and
|
|
99
|
+
|
|
100
|
+
(c) You must retain, in the Source form of any Derivative Works
|
|
101
|
+
that You distribute, all copyright, patent, trademark, and
|
|
102
|
+
attribution notices from the Source form of the Work,
|
|
103
|
+
excluding those notices that do not pertain to any part of
|
|
104
|
+
the Derivative Works; and
|
|
105
|
+
|
|
106
|
+
(d) If the Work includes a "NOTICE" text file as part of its
|
|
107
|
+
distribution, then any Derivative Works that You distribute must
|
|
108
|
+
include a readable copy of the attribution notices contained
|
|
109
|
+
within such NOTICE file, excluding those notices that do not
|
|
110
|
+
pertain to any part of the Derivative Works, in at least one
|
|
111
|
+
of the following places: within a NOTICE text file distributed
|
|
112
|
+
as part of the Derivative Works; within the Source form or
|
|
113
|
+
documentation, if provided along with the Derivative Works; or,
|
|
114
|
+
within a display generated by the Derivative Works, if and
|
|
115
|
+
wherever such third-party notices normally appear. The contents
|
|
116
|
+
of the NOTICE file are for informational purposes only and
|
|
117
|
+
do not modify the License. You may add Your own attribution
|
|
118
|
+
notices within Derivative Works that You distribute, alongside
|
|
119
|
+
or as an addendum to the NOTICE text from the Work, provided
|
|
120
|
+
that such additional attribution notices cannot be construed
|
|
121
|
+
as modifying the License.
|
|
122
|
+
|
|
123
|
+
You may add Your own copyright statement to Your modifications and
|
|
124
|
+
may provide additional or different license terms and conditions
|
|
125
|
+
for use, reproduction, or distribution of Your modifications, or
|
|
126
|
+
for any such Derivative Works as a whole, provided Your use,
|
|
127
|
+
reproduction, and distribution of the Work otherwise complies with
|
|
128
|
+
the conditions stated in this License.
|
|
129
|
+
|
|
130
|
+
5. Submission of Contributions. Unless You explicitly state otherwise,
|
|
131
|
+
any Contribution intentionally submitted for inclusion in the Work
|
|
132
|
+
by You to the Licensor shall be under the terms and conditions of
|
|
133
|
+
this License, without any additional terms or conditions.
|
|
134
|
+
Notwithstanding the above, nothing herein shall supersede or modify
|
|
135
|
+
the terms of any separate license agreement you may have executed
|
|
136
|
+
with Licensor regarding such Contributions.
|
|
137
|
+
|
|
138
|
+
6. Trademarks. This License does not grant permission to use the trade
|
|
139
|
+
names, trademarks, service marks, or product names of the Licensor,
|
|
140
|
+
except as required for reasonable and customary use in describing the
|
|
141
|
+
origin of the Work and reproducing the content of the NOTICE file.
|
|
142
|
+
|
|
143
|
+
7. Disclaimer of Warranty. Unless required by applicable law or
|
|
144
|
+
agreed to in writing, Licensor provides the Work (and each
|
|
145
|
+
Contributor provides its Contributions) on an "AS IS" BASIS,
|
|
146
|
+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
|
|
147
|
+
implied, including, without limitation, any warranties or conditions
|
|
148
|
+
of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
|
|
149
|
+
PARTICULAR PURPOSE. You are solely responsible for determining the
|
|
150
|
+
appropriateness of using or redistributing the Work and assume any
|
|
151
|
+
risks associated with Your exercise of permissions under this License.
|
|
152
|
+
|
|
153
|
+
8. Limitation of Liability. In no event and under no legal theory,
|
|
154
|
+
whether in tort (including negligence), contract, or otherwise,
|
|
155
|
+
unless required by applicable law (such as deliberate and grossly
|
|
156
|
+
negligent acts) or agreed to in writing, shall any Contributor be
|
|
157
|
+
liable to You for damages, including any direct, indirect, special,
|
|
158
|
+
incidental, or consequential damages of any character arising as a
|
|
159
|
+
result of this License or out of the use or inability to use the
|
|
160
|
+
Work (including but not limited to damages for loss of goodwill,
|
|
161
|
+
work stoppage, computer failure or malfunction, or any and all
|
|
162
|
+
other commercial damages or losses), even if such Contributor
|
|
163
|
+
has been advised of the possibility of such damages.
|
|
164
|
+
|
|
165
|
+
9. Accepting Warranty or Additional Support. While redistributing
|
|
166
|
+
the Work or Derivative Works thereof, You may choose to offer,
|
|
167
|
+
and charge a fee for, acceptance of support, warranty, indemnity,
|
|
168
|
+
or other liability obligations and/or rights consistent with this
|
|
169
|
+
License. However, in accepting such obligations, You may act only
|
|
170
|
+
on Your own behalf and on Your sole responsibility, not on behalf
|
|
171
|
+
of any other Contributor, and only if You agree to indemnify,
|
|
172
|
+
defend, and hold each Contributor harmless for any liability
|
|
173
|
+
incurred by, or claims asserted against, such Contributor by reason
|
|
174
|
+
of your accepting any such warranty or additional liability.
|
|
175
|
+
|
|
176
|
+
END OF TERMS AND CONDITIONS
|
|
177
|
+
|
|
178
|
+
APPENDIX: How to apply the Apache License to your work.
|
|
179
|
+
|
|
180
|
+
To apply the Apache License to your work, attach the following
|
|
181
|
+
boilerplate notice, with the fields enclosed by brackets "[]"
|
|
182
|
+
replaced with your own identifying information. (Don't include
|
|
183
|
+
the brackets!) The text should be enclosed in the appropriate
|
|
184
|
+
comment syntax for the file format. We also recommend that a
|
|
185
|
+
file or class name and description of purpose be included on the
|
|
186
|
+
same "printed page" as the copyright notice for easier
|
|
187
|
+
identification within third-party archives.
|
|
188
|
+
|
|
189
|
+
Copyright 2025 Jordan Estralioto
|
|
190
|
+
|
|
191
|
+
Licensed under the Apache License, Version 2.0 (the "License");
|
|
192
|
+
you may not use this file except in compliance with the License.
|
|
193
|
+
You may obtain a copy of the License at
|
|
194
|
+
|
|
195
|
+
http://www.apache.org/licenses/LICENSE-2.0
|
|
196
|
+
|
|
197
|
+
Unless required by applicable law or agreed to in writing, software
|
|
198
|
+
distributed under the License is distributed on an "AS IS" BASIS,
|
|
199
|
+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
200
|
+
See the License for the specific language governing permissions and
|
|
201
|
+
limitations under the License.
|
|
@@ -0,0 +1,275 @@
|
|
|
1
|
+
Metadata-Version: 2.4
|
|
2
|
+
Name: globaldatafinance
|
|
3
|
+
Version: 0.1.0
|
|
4
|
+
Summary: Library for extracting, normalizing and processing global financial and economic data — including market data from exchanges worldwide, regulatory filings, company fundamentals and historical quotes; optimized for high-performance storage and analysis (e.g., Parquet).
|
|
5
|
+
License-Expression: Apache-2.0
|
|
6
|
+
License-File: LICENSE
|
|
7
|
+
Keywords: finance,financial-data,economic-data,market-data,global-markets,exchanges,fundamentals,historical-quotes,macroeconomics,parquet,b3,cvm
|
|
8
|
+
Author: Jordan Estralioto
|
|
9
|
+
Author-email: estraliotojordan@gmail.com
|
|
10
|
+
Requires-Python: >=3.12,<4.0
|
|
11
|
+
Classifier: Development Status :: 4 - Beta
|
|
12
|
+
Classifier: Intended Audience :: Developers
|
|
13
|
+
Classifier: Programming Language :: Python :: 3.12
|
|
14
|
+
Classifier: Programming Language :: Python :: 3.13
|
|
15
|
+
Classifier: Programming Language :: Python :: 3.14
|
|
16
|
+
Classifier: Operating System :: OS Independent
|
|
17
|
+
Classifier: Topic :: Software Development :: Libraries
|
|
18
|
+
Requires-Dist: httpx[http2] (>=0.28.1,<0.29.0)
|
|
19
|
+
Requires-Dist: pandas (>=2.3.3,<3.0.0)
|
|
20
|
+
Requires-Dist: polars (>=1.0.0,<2.0.0)
|
|
21
|
+
Requires-Dist: psutil (>=5.9.0,<7.0.0)
|
|
22
|
+
Requires-Dist: pyarrow (>=22.0.0,<23.0.0)
|
|
23
|
+
Requires-Dist: pydantic-settings (>=2.11.0,<3.0.0)
|
|
24
|
+
Project-URL: Bug Tracker, https://github.com/jor0105/Global-Data-Finance/issues
|
|
25
|
+
Project-URL: Documentation, https://github.com/jor0105/Global-Data-Finance
|
|
26
|
+
Project-URL: Homepage, https://github.com/jor0105/Global-Data-Finance
|
|
27
|
+
Project-URL: Repository, https://github.com/jor0105/Global-Data-Finance
|
|
28
|
+
Description-Content-Type: text/markdown
|
|
29
|
+
|
|
30
|
+
# 📊 Global-Data-Finance
|
|
31
|
+
|
|
32
|
+
<div align="center">
|
|
33
|
+
|
|
34
|
+
**Biblioteca Python profissional para extração e processamento de dados financeiros globais com arquitetura limpa e alto desempenho.**
|
|
35
|
+
|
|
36
|
+
[](https://www.python.org/downloads/)
|
|
37
|
+
[](https://pypi.org/project/globaldatafinance/)
|
|
38
|
+
[](https://github.com/jor0105/Global-Data-Finance/blob/develop/LICENSE)
|
|
39
|
+
[](https://github.com/psf/black)
|
|
40
|
+
[](http://mypy-lang.org/)
|
|
41
|
+
|
|
42
|
+
[Documentação Oficial](https://jor0105.github.io/Global-Data-Finance/) • [Instalação](#-instalação) • [Quick Start](#-quick-start) • [API Reference](#-api-reference) • [Contribuir](#-contribuindo)
|
|
43
|
+
|
|
44
|
+
</div>
|
|
45
|
+
|
|
46
|
+
---
|
|
47
|
+
|
|
48
|
+
## 🎯 Sobre
|
|
49
|
+
|
|
50
|
+
**Global-Data-Finance** é uma solução robusta e de alto desempenho para engenharia de dados financeiros. Projetada para desenvolvedores, cientistas de dados e analistas quantitativos, a biblioteca abstrai a complexidade de extrair e normalizar dados de fontes regulatórias (CVM) e de mercado (B3).
|
|
51
|
+
|
|
52
|
+
Construída sobre os princípios de **Clean Architecture** e **SOLID**, a biblioteca garante não apenas performance excepcional, mas também um código manutenível, testável e extensível.
|
|
53
|
+
|
|
54
|
+
### 🌟 Por que escolher Global-Data-Finance?
|
|
55
|
+
|
|
56
|
+
- **🚀 Performance Extrema**: Utiliza `asyncio` e processamento paralelo para downloads até **10x mais rápidos** que métodos tradicionais.
|
|
57
|
+
- **🛡️ Robustez**: Sistema inteligente de retries, monitoramento de recursos e tratamento de erros granular.
|
|
58
|
+
- **💾 Otimização de Dados**: Extração nativa para **Parquet**, garantindo eficiência de armazenamento e leitura rápida para Pandas/Polars.
|
|
59
|
+
- **🧩 Arquitetura Modular**: Design desacoplado que permite fácil substituição de componentes (adapters) e extensão de funcionalidades.
|
|
60
|
+
- **✨ Developer Experience**: Type hints completos, logging detalhado e API intuitiva.
|
|
61
|
+
|
|
62
|
+
---
|
|
63
|
+
|
|
64
|
+
## ✨ Funcionalidades
|
|
65
|
+
|
|
66
|
+
### 📈 Fontes de Dados Suportadas
|
|
67
|
+
|
|
68
|
+
| Fonte | Tipo de Dado | Detalhes | Status |
|
|
69
|
+
| :------ | :---------------------- | :---------------------------------------- | :---------- |
|
|
70
|
+
| **CVM** | Documentos Regulatórios | DFP, ITR, FRE, FCA, CGVN, VLMO, IPE | ✅ Produção |
|
|
71
|
+
| **B3** | Cotações Históricas | Ações, ETFs, BDRs, Opções, Termo, Futuros | ✅ Produção |
|
|
72
|
+
|
|
73
|
+
### ⚙️ Destaques Técnicos
|
|
74
|
+
|
|
75
|
+
- **Download Manager Assimétrico**:
|
|
76
|
+
- Gerenciamento automático de concorrência.
|
|
77
|
+
- Backoff exponencial para falhas de rede.
|
|
78
|
+
- Validação de integridade de arquivos (ZIP/MD5).
|
|
79
|
+
- **Processamento de Cotações (B3)**:
|
|
80
|
+
- Parser otimizado para arquivos posicionais legados.
|
|
81
|
+
- Modos de execução: `fast` (in-memory) e `slow` (low-memory).
|
|
82
|
+
- Filtragem avançada por tipo de ativo (Ações, Opções, etc.).
|
|
83
|
+
|
|
84
|
+
---
|
|
85
|
+
|
|
86
|
+
## 🚀 Instalação
|
|
87
|
+
|
|
88
|
+
Requer **Python 3.12+**.
|
|
89
|
+
|
|
90
|
+
### Via Pip (Recomendado)
|
|
91
|
+
|
|
92
|
+
```bash
|
|
93
|
+
pip install globaldatafinance
|
|
94
|
+
```
|
|
95
|
+
|
|
96
|
+
### Via Poetry
|
|
97
|
+
|
|
98
|
+
```bash
|
|
99
|
+
poetry add globaldatafinance
|
|
100
|
+
```
|
|
101
|
+
|
|
102
|
+
---
|
|
103
|
+
|
|
104
|
+
## 💡 Quick Start
|
|
105
|
+
|
|
106
|
+
### 1. Dados Fundamentais (CVM)
|
|
107
|
+
|
|
108
|
+
Baixe demonstrações financeiras (DFP, ITR) e formulários de referência de forma massiva e resiliente.
|
|
109
|
+
|
|
110
|
+
```python
|
|
111
|
+
from globaldatafinance import FundamentalStocksDataCVM
|
|
112
|
+
import logging
|
|
113
|
+
|
|
114
|
+
# (Opcional) Configurar logging para ver o progresso detalhado
|
|
115
|
+
logging.basicConfig(level=logging.INFO)
|
|
116
|
+
|
|
117
|
+
# Inicializar cliente
|
|
118
|
+
cvm = FundamentalStocksDataCVM()
|
|
119
|
+
|
|
120
|
+
# Baixar e extrair automaticamente para Parquet
|
|
121
|
+
cvm.download(
|
|
122
|
+
destination_path="./dados_cvm",
|
|
123
|
+
list_docs=["DFP", "ITR"], # Tipos de documentos
|
|
124
|
+
initial_year=2023, # Ano inicial
|
|
125
|
+
last_year=2024, # Ano final
|
|
126
|
+
automatic_extractor=True # Converte ZIP -> Parquet
|
|
127
|
+
)
|
|
128
|
+
```
|
|
129
|
+
|
|
130
|
+
### 2. Cotações Históricas (B3)
|
|
131
|
+
|
|
132
|
+
Processe a série histórica da B3, transformando arquivos de texto complexos em DataFrames prontos para análise.
|
|
133
|
+
|
|
134
|
+
```python
|
|
135
|
+
from globaldatafinance import HistoricalQuotesB3
|
|
136
|
+
|
|
137
|
+
# Inicializar cliente
|
|
138
|
+
b3 = HistoricalQuotesB3()
|
|
139
|
+
|
|
140
|
+
# Extrair cotações de Ações e ETFs
|
|
141
|
+
result = b3.extract(
|
|
142
|
+
path_of_docs="./dados_brutos_b3", # Onde estão os ZIPs da B3 (COTAHIST_A2023.ZIP)
|
|
143
|
+
destination_path="./dados_processados",
|
|
144
|
+
assets_list=["ações", "etf"],
|
|
145
|
+
initial_year=2023,
|
|
146
|
+
processing_mode="fast" # Modo otimizado
|
|
147
|
+
)
|
|
148
|
+
|
|
149
|
+
print(f"Processamento concluído! Registros extraídos: {result['total_records']:,}")
|
|
150
|
+
print(f"Arquivo salvo em: {result['output_file']}")
|
|
151
|
+
```
|
|
152
|
+
|
|
153
|
+
### 3. Analisando os Dados
|
|
154
|
+
|
|
155
|
+
Os dados são salvos em formato **Parquet**, ideal para análise com Pandas ou Polars.
|
|
156
|
+
|
|
157
|
+
```python
|
|
158
|
+
import pandas as pd
|
|
159
|
+
|
|
160
|
+
# Ler o arquivo gerado
|
|
161
|
+
df = pd.read_parquet("./dados_processados/cotahist_extracted.parquet")
|
|
162
|
+
|
|
163
|
+
# Analisar
|
|
164
|
+
print(df.head())
|
|
165
|
+
print(df.groupby("cod_negociacao")["preco_fechamento"].mean())
|
|
166
|
+
```
|
|
167
|
+
|
|
168
|
+
---
|
|
169
|
+
|
|
170
|
+
## 🏗️ Arquitetura
|
|
171
|
+
|
|
172
|
+
A arquitetura do projeto é um diferencial chave, separando claramente responsabilidades para garantir longevidade e qualidade do software.
|
|
173
|
+
|
|
174
|
+
```mermaid
|
|
175
|
+
graph TD
|
|
176
|
+
User[Usuário / Script] --> Presentation
|
|
177
|
+
|
|
178
|
+
subgraph "Global-Data-Finance"
|
|
179
|
+
Presentation[Presentation Layer<br>FundamentalStocksDataCVM / HistoricalQuotesB3]
|
|
180
|
+
|
|
181
|
+
Presentation --> Application
|
|
182
|
+
|
|
183
|
+
subgraph "Core Logic"
|
|
184
|
+
Application[Application Layer<br>Use Cases & Interfaces]
|
|
185
|
+
Domain[Domain Layer<br>Entities & Business Rules]
|
|
186
|
+
Application --> Domain
|
|
187
|
+
end
|
|
188
|
+
|
|
189
|
+
Application --> Infrastructure
|
|
190
|
+
|
|
191
|
+
subgraph "Infrastructure"
|
|
192
|
+
Infrastructure[Infrastructure Layer<br>Adapters, Parsers, IO]
|
|
193
|
+
end
|
|
194
|
+
end
|
|
195
|
+
|
|
196
|
+
Infrastructure --> External[Web / File System]
|
|
197
|
+
```
|
|
198
|
+
|
|
199
|
+
### Estrutura de Diretórios
|
|
200
|
+
|
|
201
|
+
```text
|
|
202
|
+
src/
|
|
203
|
+
└── globaldatafinance/
|
|
204
|
+
├── brazil/
|
|
205
|
+
│ ├── cvm/
|
|
206
|
+
│ │ └── fundamental_stocks_data/ # Módulo CVM
|
|
207
|
+
│ └── b3/
|
|
208
|
+
│ └── historical_quotes/ # Módulo B3
|
|
209
|
+
├── core/ # Logging, Config, Utils
|
|
210
|
+
└── macro_infra/ # Adapters Genéricos (HTTP, FileIO)
|
|
211
|
+
```
|
|
212
|
+
|
|
213
|
+
---
|
|
214
|
+
|
|
215
|
+
## 📊 API Reference
|
|
216
|
+
|
|
217
|
+
### `FundamentalStocksDataCVM`
|
|
218
|
+
|
|
219
|
+
Gerenciador de downloads de documentos da CVM.
|
|
220
|
+
|
|
221
|
+
| Método | Assinatura | Descrição |
|
|
222
|
+
| :------------------------ | :----------------------------------------------------------------------------------------------------------------------------------------- | :------------------------------------------------------------ |
|
|
223
|
+
| **`download`** | `(destination_path: str, list_docs: list[str]=None, initial_year: int=None, last_year: int=None, automatic_extractor: bool=False) -> None` | Realiza o download e opcionalmente a extração dos documentos. |
|
|
224
|
+
| **`get_available_docs`** | `() -> dict` | Retorna lista de documentos disponíveis e suas descrições. |
|
|
225
|
+
| **`get_available_years`** | `() -> dict` | Retorna o intervalo de anos disponíveis para download. |
|
|
226
|
+
|
|
227
|
+
### `HistoricalQuotesB3`
|
|
228
|
+
|
|
229
|
+
Extrator de cotações históricas da B3.
|
|
230
|
+
|
|
231
|
+
| Método | Assinatura | Descrição |
|
|
232
|
+
| :------------------------- | :----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | :----------------------------------------------------------------- |
|
|
233
|
+
| **`extract`** | `(path_of_docs: str, assets_list: list[str], initial_year: int=None, last_year: int=None, destination_path: str=None, output_filename: str="cotahist_extracted", processing_mode: str="fast") -> dict` | Processa arquivos ZIP da B3 e gera um arquivo Parquet consolidado. |
|
|
234
|
+
| **`get_available_assets`** | `() -> list[str]` | Retorna tipos de ativos suportados (ex: 'ações', 'opções'). |
|
|
235
|
+
| **`get_available_years`** | `() -> dict` | Retorna o intervalo de anos disponíveis para os dados históricos. |
|
|
236
|
+
|
|
237
|
+
---
|
|
238
|
+
|
|
239
|
+
## 🤝 Contribuindo
|
|
240
|
+
|
|
241
|
+
Contribuições são muito bem-vindas! Se você deseja adicionar novas fontes de dados, melhorar a performance ou corrigir bugs:
|
|
242
|
+
|
|
243
|
+
1. **Fork** o projeto.
|
|
244
|
+
2. Crie uma branch para sua feature (`git checkout -b feature/nova-feature`).
|
|
245
|
+
3. Implemente suas mudanças.
|
|
246
|
+
4. Execute os testes e linters:
|
|
247
|
+
```bash
|
|
248
|
+
poetry run pre-commit run --all-files
|
|
249
|
+
poetry run pytest
|
|
250
|
+
```
|
|
251
|
+
5. Abra um **Pull Request**.
|
|
252
|
+
|
|
253
|
+
Consulte o [Guia de Contribuição](https://jor0105.github.io/Global-Data-Finance/dev-guide/contributing/) para mais detalhes.
|
|
254
|
+
|
|
255
|
+
---
|
|
256
|
+
|
|
257
|
+
## 📄 Licença
|
|
258
|
+
|
|
259
|
+
Este projeto é distribuído sob a licença **Apache 2.0**. Consulte o arquivo [LICENSE](LICENSE) para mais informações.
|
|
260
|
+
|
|
261
|
+
---
|
|
262
|
+
|
|
263
|
+
## 📞 Suporte e Contato
|
|
264
|
+
|
|
265
|
+
- **Autor**: Jordan Estralioto
|
|
266
|
+
- **GitHub**: [@jor0105](https://github.com/jor0105)
|
|
267
|
+
- **Email**: estraliotojordan@gmail.com
|
|
268
|
+
- **Issues**: [Reportar Bug](https://github.com/jor0105/Global-Data-Finance/issues)
|
|
269
|
+
|
|
270
|
+
---
|
|
271
|
+
|
|
272
|
+
<div align="center">
|
|
273
|
+
<sub>Copyright © 2025 Jordan Estralioto • Licensed under Apache 2.0</sub>
|
|
274
|
+
</div>
|
|
275
|
+
|