leblanc 0.6.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.
- leblanc-0.6.0/LICENSE +201 -0
- leblanc-0.6.0/PKG-INFO +140 -0
- leblanc-0.6.0/README.md +121 -0
- leblanc-0.6.0/leblanc/__init__.py +24 -0
- leblanc-0.6.0/leblanc/agribusiness.py +81 -0
- leblanc-0.6.0/leblanc/apparel.py +59 -0
- leblanc-0.6.0/leblanc/financial.py +53 -0
- leblanc-0.6.0/leblanc/food.py +61 -0
- leblanc-0.6.0/leblanc/forestry.py +63 -0
- leblanc-0.6.0/leblanc/health_beauty.py +65 -0
- leblanc-0.6.0/leblanc/tech.py +58 -0
- leblanc-0.6.0/leblanc/utils.py +40 -0
- leblanc-0.6.0/leblanc.egg-info/PKG-INFO +140 -0
- leblanc-0.6.0/leblanc.egg-info/SOURCES.txt +17 -0
- leblanc-0.6.0/leblanc.egg-info/dependency_links.txt +1 -0
- leblanc-0.6.0/leblanc.egg-info/requires.txt +3 -0
- leblanc-0.6.0/leblanc.egg-info/top_level.txt +1 -0
- leblanc-0.6.0/setup.cfg +4 -0
- leblanc-0.6.0/setup.py +41 -0
leblanc-0.6.0/LICENSE
ADDED
|
@@ -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 Liability. 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 [yyyy] [name of copyright owner]
|
|
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.
|
leblanc-0.6.0/PKG-INFO
ADDED
|
@@ -0,0 +1,140 @@
|
|
|
1
|
+
Metadata-Version: 2.1
|
|
2
|
+
Name: leblanc
|
|
3
|
+
Version: 0.6.0
|
|
4
|
+
Summary: A Python library to generate various synthetic DataFrames for different business sectors (Tech, Food, Finance, Apparel, forestry, etc.).
|
|
5
|
+
Home-page: https://github.com/wSanice/leblanc
|
|
6
|
+
Author: wSanice
|
|
7
|
+
Author-email: wansanice@proton.me
|
|
8
|
+
License: Apache 2.0
|
|
9
|
+
Platform: UNKNOWN
|
|
10
|
+
Classifier: Programming Language :: Python :: 3
|
|
11
|
+
Classifier: License :: OSI Approved :: Apache Software License
|
|
12
|
+
Classifier: Operating System :: OS Independent
|
|
13
|
+
Classifier: Intended Audience :: Science/Research
|
|
14
|
+
Classifier: Topic :: Scientific/Engineering :: Information Analysis
|
|
15
|
+
Requires-Python: >=3.6
|
|
16
|
+
Description-Content-Type: text/markdown
|
|
17
|
+
License-File: LICENSE
|
|
18
|
+
|
|
19
|
+
# leblanc: Sectorial Synthetic Data Generator
|
|
20
|
+
|
|
21
|
+
## I. Overview
|
|
22
|
+
|
|
23
|
+
**leblanc** is a modular Python library designed for the rapid generation of large-scale synthetic datasets across various business sectors. It is primarily built using **Pandas**, **NumPy**, and **Faker** to create realistic, structured DataFrames suitable for Data Science training, testing, and exploratory data analysis (EDA).
|
|
24
|
+
|
|
25
|
+
The library supports generating sector-specific data, complete with domain logic (e.g., product recurrence in Health, climate impact in Agribusiness, risk in Financials).
|
|
26
|
+
|
|
27
|
+
### Supported Sectors (Modules)
|
|
28
|
+
|
|
29
|
+
| Module | Data Generated | Key Domain Variables |
|
|
30
|
+
| :--- | :--- | :--- |
|
|
31
|
+
| `tech` | Tech Sales | Unit Price, Quantity, Category |
|
|
32
|
+
| `food` | Food & Beverages Sales | Expiration Date, Perishability |
|
|
33
|
+
| `apparel` | Apparel & Fashion Sales | Size, Color, Return Flag |
|
|
34
|
+
| `financial` | Financial Transactions | Interest Rate, Client Risk Level, Default Flag |
|
|
35
|
+
| `health_beauty` | Health & Beauty Sales/Services | Recurrence Days, Sales Channel |
|
|
36
|
+
| `agribusiness` | Agribusiness Records | Climate Condition, Area (Ha), Production Yield |
|
|
37
|
+
| `forestry` | Forestry Inventory/Harvest | Planting Age, Management Type, Total Volume ($m^3$) |
|
|
38
|
+
|
|
39
|
+
---
|
|
40
|
+
|
|
41
|
+
## II. Installation
|
|
42
|
+
|
|
43
|
+
leblanc is available on PyPI. Use `pip` to install the latest stable version:
|
|
44
|
+
|
|
45
|
+
```bash
|
|
46
|
+
pip install leblanc
|
|
47
|
+
```
|
|
48
|
+
## III. Basic Usage Example
|
|
49
|
+
|
|
50
|
+
The library exposes individual generation functions directly from the main package. The `set_seed` utility is recommended for data reproducibility.
|
|
51
|
+
|
|
52
|
+
```bash
|
|
53
|
+
import pandas as pd
|
|
54
|
+
from leblanc import generate_tech_sales, generate_agribusiness_records, set_seed
|
|
55
|
+
|
|
56
|
+
# Ensure data is reproducible across environments
|
|
57
|
+
set_seed(42)
|
|
58
|
+
|
|
59
|
+
# 1. Generate Technology Sales Data
|
|
60
|
+
df_tech_sales = generate_tech_sales(num_records=1000)
|
|
61
|
+
print(" Technology Data Sample")
|
|
62
|
+
print(df_tech_sales.head())
|
|
63
|
+
|
|
64
|
+
# 2. Generate Agribusiness Records
|
|
65
|
+
df_agro_records = generate_agribusiness_records(num_records=500)
|
|
66
|
+
print("\n Agribusiness Data Sample")
|
|
67
|
+
print(df_agro_records.head())
|
|
68
|
+
|
|
69
|
+
```
|
|
70
|
+
|
|
71
|
+
## IV. License
|
|
72
|
+
|
|
73
|
+
This project is licensed under the Apache License, Version 2.0. See the LICENSE file for details.
|
|
74
|
+
|
|
75
|
+
|
|
76
|
+
# 🇧🇷 leblanc: Gerador Setorial de Dados Sintéticos
|
|
77
|
+
|
|
78
|
+
## I. Visão Geral
|
|
79
|
+
|
|
80
|
+
**leblanc** é uma biblioteca Python modular projetada para a geração rápida de conjuntos de dados sintéticos de grande escala em diversos setores de negócios. É construída primariamente utilizando Pandas, NumPy e Faker para criar DataFrames estruturados e realistas, adequados para treinamento em Data Science, testes e análise exploratória de dados (AED).
|
|
81
|
+
|
|
82
|
+
A biblioteca suporta a geração de dados específicos do domínio, completos com lógica de negócio (ex: recorrência de produto em Saúde, impacto climático em Agronegócios, risco em Finanças).
|
|
83
|
+
|
|
84
|
+
Setores Suportados (Módulos)
|
|
85
|
+
|
|
86
|
+
# leblanc: Gerador Setorial de Dados Sintéticos
|
|
87
|
+
|
|
88
|
+
## I. Visão Geral
|
|
89
|
+
|
|
90
|
+
**leblanc** é uma biblioteca Python modular projetada para a geração rápida de grandes volumes de dados sintéticos em diversos setores de negócios. Ela é construída principalmente com **Pandas**, **NumPy** e **Faker**, permitindo criar DataFrames estruturados e realistas, adequados para treinamento em Data Science, testes e análise exploratória de dados (AED).
|
|
91
|
+
|
|
92
|
+
A biblioteca oferece geração de dados específica por setor, incluindo lógica de domínio (ex.: recorrência de produtos em Saúde, impacto climático em Agronegócios, risco em Finanças).
|
|
93
|
+
|
|
94
|
+
### Setores Suportados (Módulos)
|
|
95
|
+
|
|
96
|
+
| Módulo | Dados Gerados | Variáveis-Chave do Domínio |
|
|
97
|
+
| :--- | :--- | :--- |
|
|
98
|
+
| `tech` | Vendas de Tecnologia | Preço Unitário, Quantidade, Categoria |
|
|
99
|
+
| `food` | Vendas de Alimentos e Bebidas | Data de Validade, Perecibilidade |
|
|
100
|
+
| `apparel` | Vendas de Vestuário e Moda | Tamanho, Cor, Flag de Devolução |
|
|
101
|
+
| `financial` | Transações Financeiras | Taxa de Juros, Nível de Risco do Cliente, Flag de Inadimplência |
|
|
102
|
+
| `health_beauty` | Vendas/Serviços de Saúde e Beleza | Dias de Recorrência, Canal de Vendas |
|
|
103
|
+
| `agribusiness` | Registros de Agronegócios | Condição Climática, Área (Ha), Produtividade |
|
|
104
|
+
| `forestry` | Inventário/Colheita Florestal | Idade do Plantio, Tipo de Manejo, Volume Total (m³) |
|
|
105
|
+
|
|
106
|
+
## II. Instalação
|
|
107
|
+
|
|
108
|
+
leblanc está disponível no PyPI. Use o `pip` para instalar a versão estável mais recente:
|
|
109
|
+
|
|
110
|
+
```bash
|
|
111
|
+
pip install leblanc
|
|
112
|
+
```
|
|
113
|
+
|
|
114
|
+
## III. Exemplo de Uso Básico
|
|
115
|
+
|
|
116
|
+
A biblioteca expõe funções de geração individuais diretamente do pacote principal. A função auxiliar `set_seed` é recomendada para garantir a reprodutibilidade dos dados.
|
|
117
|
+
|
|
118
|
+
```bash
|
|
119
|
+
import pandas as pd
|
|
120
|
+
from leblanc import generate_tech_sales, generate_agribusiness_records, set_seed
|
|
121
|
+
|
|
122
|
+
# Garante que os dados sejam reprodutíveis em todos os ambientes
|
|
123
|
+
set_seed(42)
|
|
124
|
+
|
|
125
|
+
# 1. Gera Dados de Vendas de Tecnologia
|
|
126
|
+
df_vendas_tech = generate_tech_sales(num_records=1000)
|
|
127
|
+
print("\n Amostra de Dados de Tecnologia")
|
|
128
|
+
print(df_vendas_tech.head())
|
|
129
|
+
|
|
130
|
+
# 2. Gera Registros de Agronegócios
|
|
131
|
+
df_registros_agro = generate_agribusiness_records(num_records=500)
|
|
132
|
+
print("\n Amostra de Dados de Agronegócios")
|
|
133
|
+
print(df_registros_agro.head())
|
|
134
|
+
```
|
|
135
|
+
|
|
136
|
+
## IV. Licença
|
|
137
|
+
|
|
138
|
+
Este projeto está licenciado sob a Apache License, Version 2.0. Consulte a [LICENSE](https://www.apache.org/licenses/LICENSE-2.0)
|
|
139
|
+
para obter detalhes.
|
|
140
|
+
|
leblanc-0.6.0/README.md
ADDED
|
@@ -0,0 +1,121 @@
|
|
|
1
|
+
# leblanc: Sectorial Synthetic Data Generator
|
|
2
|
+
|
|
3
|
+
## I. Overview
|
|
4
|
+
|
|
5
|
+
**leblanc** is a modular Python library designed for the rapid generation of large-scale synthetic datasets across various business sectors. It is primarily built using **Pandas**, **NumPy**, and **Faker** to create realistic, structured DataFrames suitable for Data Science training, testing, and exploratory data analysis (EDA).
|
|
6
|
+
|
|
7
|
+
The library supports generating sector-specific data, complete with domain logic (e.g., product recurrence in Health, climate impact in Agribusiness, risk in Financials).
|
|
8
|
+
|
|
9
|
+
### Supported Sectors (Modules)
|
|
10
|
+
|
|
11
|
+
| Module | Data Generated | Key Domain Variables |
|
|
12
|
+
| :--- | :--- | :--- |
|
|
13
|
+
| `tech` | Tech Sales | Unit Price, Quantity, Category |
|
|
14
|
+
| `food` | Food & Beverages Sales | Expiration Date, Perishability |
|
|
15
|
+
| `apparel` | Apparel & Fashion Sales | Size, Color, Return Flag |
|
|
16
|
+
| `financial` | Financial Transactions | Interest Rate, Client Risk Level, Default Flag |
|
|
17
|
+
| `health_beauty` | Health & Beauty Sales/Services | Recurrence Days, Sales Channel |
|
|
18
|
+
| `agribusiness` | Agribusiness Records | Climate Condition, Area (Ha), Production Yield |
|
|
19
|
+
| `forestry` | Forestry Inventory/Harvest | Planting Age, Management Type, Total Volume ($m^3$) |
|
|
20
|
+
|
|
21
|
+
---
|
|
22
|
+
|
|
23
|
+
## II. Installation
|
|
24
|
+
|
|
25
|
+
leblanc is available on PyPI. Use `pip` to install the latest stable version:
|
|
26
|
+
|
|
27
|
+
```bash
|
|
28
|
+
pip install leblanc
|
|
29
|
+
```
|
|
30
|
+
## III. Basic Usage Example
|
|
31
|
+
|
|
32
|
+
The library exposes individual generation functions directly from the main package. The `set_seed` utility is recommended for data reproducibility.
|
|
33
|
+
|
|
34
|
+
```bash
|
|
35
|
+
import pandas as pd
|
|
36
|
+
from leblanc import generate_tech_sales, generate_agribusiness_records, set_seed
|
|
37
|
+
|
|
38
|
+
# Ensure data is reproducible across environments
|
|
39
|
+
set_seed(42)
|
|
40
|
+
|
|
41
|
+
# 1. Generate Technology Sales Data
|
|
42
|
+
df_tech_sales = generate_tech_sales(num_records=1000)
|
|
43
|
+
print(" Technology Data Sample")
|
|
44
|
+
print(df_tech_sales.head())
|
|
45
|
+
|
|
46
|
+
# 2. Generate Agribusiness Records
|
|
47
|
+
df_agro_records = generate_agribusiness_records(num_records=500)
|
|
48
|
+
print("\n Agribusiness Data Sample")
|
|
49
|
+
print(df_agro_records.head())
|
|
50
|
+
|
|
51
|
+
```
|
|
52
|
+
|
|
53
|
+
## IV. License
|
|
54
|
+
|
|
55
|
+
This project is licensed under the Apache License, Version 2.0. See the LICENSE file for details.
|
|
56
|
+
|
|
57
|
+
|
|
58
|
+
# 🇧🇷 leblanc: Gerador Setorial de Dados Sintéticos
|
|
59
|
+
|
|
60
|
+
## I. Visão Geral
|
|
61
|
+
|
|
62
|
+
**leblanc** é uma biblioteca Python modular projetada para a geração rápida de conjuntos de dados sintéticos de grande escala em diversos setores de negócios. É construída primariamente utilizando Pandas, NumPy e Faker para criar DataFrames estruturados e realistas, adequados para treinamento em Data Science, testes e análise exploratória de dados (AED).
|
|
63
|
+
|
|
64
|
+
A biblioteca suporta a geração de dados específicos do domínio, completos com lógica de negócio (ex: recorrência de produto em Saúde, impacto climático em Agronegócios, risco em Finanças).
|
|
65
|
+
|
|
66
|
+
Setores Suportados (Módulos)
|
|
67
|
+
|
|
68
|
+
# leblanc: Gerador Setorial de Dados Sintéticos
|
|
69
|
+
|
|
70
|
+
## I. Visão Geral
|
|
71
|
+
|
|
72
|
+
**leblanc** é uma biblioteca Python modular projetada para a geração rápida de grandes volumes de dados sintéticos em diversos setores de negócios. Ela é construída principalmente com **Pandas**, **NumPy** e **Faker**, permitindo criar DataFrames estruturados e realistas, adequados para treinamento em Data Science, testes e análise exploratória de dados (AED).
|
|
73
|
+
|
|
74
|
+
A biblioteca oferece geração de dados específica por setor, incluindo lógica de domínio (ex.: recorrência de produtos em Saúde, impacto climático em Agronegócios, risco em Finanças).
|
|
75
|
+
|
|
76
|
+
### Setores Suportados (Módulos)
|
|
77
|
+
|
|
78
|
+
| Módulo | Dados Gerados | Variáveis-Chave do Domínio |
|
|
79
|
+
| :--- | :--- | :--- |
|
|
80
|
+
| `tech` | Vendas de Tecnologia | Preço Unitário, Quantidade, Categoria |
|
|
81
|
+
| `food` | Vendas de Alimentos e Bebidas | Data de Validade, Perecibilidade |
|
|
82
|
+
| `apparel` | Vendas de Vestuário e Moda | Tamanho, Cor, Flag de Devolução |
|
|
83
|
+
| `financial` | Transações Financeiras | Taxa de Juros, Nível de Risco do Cliente, Flag de Inadimplência |
|
|
84
|
+
| `health_beauty` | Vendas/Serviços de Saúde e Beleza | Dias de Recorrência, Canal de Vendas |
|
|
85
|
+
| `agribusiness` | Registros de Agronegócios | Condição Climática, Área (Ha), Produtividade |
|
|
86
|
+
| `forestry` | Inventário/Colheita Florestal | Idade do Plantio, Tipo de Manejo, Volume Total (m³) |
|
|
87
|
+
|
|
88
|
+
## II. Instalação
|
|
89
|
+
|
|
90
|
+
leblanc está disponível no PyPI. Use o `pip` para instalar a versão estável mais recente:
|
|
91
|
+
|
|
92
|
+
```bash
|
|
93
|
+
pip install leblanc
|
|
94
|
+
```
|
|
95
|
+
|
|
96
|
+
## III. Exemplo de Uso Básico
|
|
97
|
+
|
|
98
|
+
A biblioteca expõe funções de geração individuais diretamente do pacote principal. A função auxiliar `set_seed` é recomendada para garantir a reprodutibilidade dos dados.
|
|
99
|
+
|
|
100
|
+
```bash
|
|
101
|
+
import pandas as pd
|
|
102
|
+
from leblanc import generate_tech_sales, generate_agribusiness_records, set_seed
|
|
103
|
+
|
|
104
|
+
# Garante que os dados sejam reprodutíveis em todos os ambientes
|
|
105
|
+
set_seed(42)
|
|
106
|
+
|
|
107
|
+
# 1. Gera Dados de Vendas de Tecnologia
|
|
108
|
+
df_vendas_tech = generate_tech_sales(num_records=1000)
|
|
109
|
+
print("\n Amostra de Dados de Tecnologia")
|
|
110
|
+
print(df_vendas_tech.head())
|
|
111
|
+
|
|
112
|
+
# 2. Gera Registros de Agronegócios
|
|
113
|
+
df_registros_agro = generate_agribusiness_records(num_records=500)
|
|
114
|
+
print("\n Amostra de Dados de Agronegócios")
|
|
115
|
+
print(df_registros_agro.head())
|
|
116
|
+
```
|
|
117
|
+
|
|
118
|
+
## IV. Licença
|
|
119
|
+
|
|
120
|
+
Este projeto está licenciado sob a Apache License, Version 2.0. Consulte a [LICENSE](https://www.apache.org/licenses/LICENSE-2.0)
|
|
121
|
+
para obter detalhes.
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
# Copyright 2025 w.Sanice
|
|
2
|
+
#
|
|
3
|
+
# Licensed under the Apache License, Version 2.0 (the "License");
|
|
4
|
+
# you may not use this file except in compliance with the License.
|
|
5
|
+
# You may obtain a copy of the License at
|
|
6
|
+
#
|
|
7
|
+
# http://www.apache.org/licenses/LICENSE-2.0
|
|
8
|
+
#
|
|
9
|
+
# Unless required by applicable law or agreed to in writing, software
|
|
10
|
+
# distributed under the License is distributed on an "AS IS" BASIS,
|
|
11
|
+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
12
|
+
# See the License for the specific language governing permissions and
|
|
13
|
+
# limitations under the License.
|
|
14
|
+
|
|
15
|
+
from .tech import generate_tech_sales
|
|
16
|
+
from .food import generate_food_sales
|
|
17
|
+
from .apparel import generate_apparel_sales
|
|
18
|
+
from .financial import generate_financial_transactions
|
|
19
|
+
from .health_beauty import generate_health_beauty_sales
|
|
20
|
+
from .agribusiness import generate_agribusiness_records
|
|
21
|
+
from .forestry import generate_forestry_records
|
|
22
|
+
from .utils import set_seed
|
|
23
|
+
|
|
24
|
+
__version__ = "0.3.0"
|
|
@@ -0,0 +1,81 @@
|
|
|
1
|
+
# Copyright 2025 w.Sanice
|
|
2
|
+
#
|
|
3
|
+
# Licensed under the Apache License, Version 2.0 (the "License");
|
|
4
|
+
# you may not use this file except in compliance with the License.
|
|
5
|
+
# You may obtain a copy of the License at
|
|
6
|
+
#
|
|
7
|
+
# http://www.apache.org/licenses/LICENSE-2.0
|
|
8
|
+
#
|
|
9
|
+
# Unless required by applicable law or agreed to in writing, software
|
|
10
|
+
# distributed under the License is distributed on an "AS IS" BASIS,
|
|
11
|
+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
12
|
+
# See the License for the specific language governing permissions and
|
|
13
|
+
# limitations under the License.
|
|
14
|
+
|
|
15
|
+
from .utils import np, pd, random, datetime, timedelta, set_seed, create_dataframe, get_fake_person_info, fake
|
|
16
|
+
|
|
17
|
+
CROPS_INFO = {
|
|
18
|
+
'Soybean': {'type': 'Grain', 'price_per_ton': 1800, 'yield_base': 3500},
|
|
19
|
+
'Corn': {'type': 'Grain', 'price_per_ton': 900, 'yield_base': 6000},
|
|
20
|
+
'Coffee': {'type': 'Permanent Crop', 'price_per_bag': 1200, 'yield_base': 30},
|
|
21
|
+
'Beef Cattle': {'type': 'Livestock', 'price_per_arroba': 300, 'yield_base': 15},
|
|
22
|
+
'Fertilizer NPK': {'type': 'Input', 'price_per_ton': 4500, 'yield_base': 0},
|
|
23
|
+
}
|
|
24
|
+
CLIMATE_CONDITIONS = ['Ideal', 'Normal', 'Drought', 'Excess Rain']
|
|
25
|
+
REGIONS = ['Midwest', 'South', 'Southeast', 'Northeast']
|
|
26
|
+
|
|
27
|
+
def generate_agribusiness_records(num_records=500):
|
|
28
|
+
set_seed()
|
|
29
|
+
crop_list = list(CROPS_INFO.keys())
|
|
30
|
+
agri_data = []
|
|
31
|
+
start_date = datetime(2025, 1, 1)
|
|
32
|
+
|
|
33
|
+
for i in range(num_records):
|
|
34
|
+
item_name = random.choice(crop_list)
|
|
35
|
+
item_info = CROPS_INFO[item_name]
|
|
36
|
+
record_date = start_date + timedelta(days=np.random.randint(1, 365))
|
|
37
|
+
area_hectares = np.random.uniform(50, 2000)
|
|
38
|
+
climate = random.choice(CLIMATE_CONDITIONS)
|
|
39
|
+
region = random.choice(REGIONS)
|
|
40
|
+
|
|
41
|
+
climate_factor = {'Ideal': 1.1, 'Normal': 1.0, 'Drought': 0.7, 'Excess Rain': 0.85}[climate]
|
|
42
|
+
base_yield = item_info['yield_base']
|
|
43
|
+
|
|
44
|
+
if item_info['type'] == 'Grain' or item_info['type'] == 'Permanent Crop':
|
|
45
|
+
final_yield = base_yield * climate_factor * np.random.uniform(0.9, 1.1)
|
|
46
|
+
total_production = final_yield * area_hectares
|
|
47
|
+
unit = 'kg' if item_info['type'] == 'Grain' else 'bags'
|
|
48
|
+
price_key = 'price_per_ton' if item_info['type'] == 'Grain' else 'price_per_bag'
|
|
49
|
+
total_revenue = (total_production / 1000) * item_info.get('price_per_ton', 0) if item_info['type'] == 'Grain' else total_production * item_info.get('price_per_bag', 0)
|
|
50
|
+
|
|
51
|
+
elif item_info['type'] == 'Livestock':
|
|
52
|
+
num_animals = np.random.randint(50, 1000)
|
|
53
|
+
avg_weight = np.random.uniform(400, 600)
|
|
54
|
+
total_production = num_animals * avg_weight
|
|
55
|
+
unit = 'kg'
|
|
56
|
+
price_key = 'price_per_arroba'
|
|
57
|
+
total_revenue = (total_production / 15) * item_info.get('price_per_arroba', 0)
|
|
58
|
+
|
|
59
|
+
elif item_info['type'] == 'Input':
|
|
60
|
+
total_production = np.random.uniform(10, 500)
|
|
61
|
+
unit = 'tons'
|
|
62
|
+
price_key = 'price_per_ton'
|
|
63
|
+
total_revenue = 0
|
|
64
|
+
|
|
65
|
+
farmer_info = get_fake_person_info()
|
|
66
|
+
|
|
67
|
+
agri_data.append({
|
|
68
|
+
'record_id': 9000 + i,
|
|
69
|
+
'record_date': record_date,
|
|
70
|
+
'item_name': item_name,
|
|
71
|
+
'type': item_info['type'],
|
|
72
|
+
'region': region,
|
|
73
|
+
'area_hectares': round(area_hectares, 2),
|
|
74
|
+
'climate_condition': climate,
|
|
75
|
+
'production_unit': unit,
|
|
76
|
+
'total_production_volume': round(total_production, 2),
|
|
77
|
+
'market_price_unit': item_info.get(price_key, 0),
|
|
78
|
+
'total_revenue': round(total_revenue, 2),
|
|
79
|
+
'farm_owner': farmer_info['customer_name']
|
|
80
|
+
})
|
|
81
|
+
return create_dataframe(agri_data, "Agribusiness Production and Sales")
|
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
# Copyright 2025 w.Sanice
|
|
2
|
+
#
|
|
3
|
+
# Licensed under the Apache License, Version 2.0 (the "License");
|
|
4
|
+
# you may not use this file except in compliance with the License.
|
|
5
|
+
# You may obtain a copy of the License at
|
|
6
|
+
#
|
|
7
|
+
# http://www.apache.org/licenses/LICENSE-2.0
|
|
8
|
+
#
|
|
9
|
+
# Unless required by applicable law or agreed to in writing, software
|
|
10
|
+
# distributed under the License is distributed on an "AS IS" BASIS,
|
|
11
|
+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
12
|
+
# See the License for the specific language governing permissions and
|
|
13
|
+
# limitations under the License.
|
|
14
|
+
|
|
15
|
+
from .utils import np, pd, random, datetime, timedelta, set_seed, create_dataframe, get_fake_person_info, fake
|
|
16
|
+
|
|
17
|
+
PRODUCTS_APPAREL = {
|
|
18
|
+
'Slim Fit Jeans': {'category': 'Bottom Wear', 'price': 180.00},
|
|
19
|
+
'Basic Cotton T-Shirt': {'category': 'Top Wear', 'price': 60.00},
|
|
20
|
+
'Casual Running Shoes': {'category': 'Footwear', 'price': 320.00},
|
|
21
|
+
'Summer Midi Dress': {'category': 'Womenswear', 'price': 150.00},
|
|
22
|
+
'Dress Socks (Pair)': {'category': 'Accessories', 'price': 15.00},
|
|
23
|
+
}
|
|
24
|
+
SIZES = ['XS', 'S', 'M', 'L', 'XL']
|
|
25
|
+
COLORS = ['Black', 'White', 'Navy Blue', 'Grey', 'Red']
|
|
26
|
+
|
|
27
|
+
def generate_apparel_sales(num_records=500):
|
|
28
|
+
set_seed()
|
|
29
|
+
product_list = list(PRODUCTS_APPAREL.keys())
|
|
30
|
+
sales_data = []
|
|
31
|
+
start_date = datetime(2025, 9, 1)
|
|
32
|
+
|
|
33
|
+
for i in range(num_records):
|
|
34
|
+
product_name = random.choice(product_list)
|
|
35
|
+
|
|
36
|
+
order_date = start_date + timedelta(days=i * random.uniform(0.5, 1.5))
|
|
37
|
+
if order_date.month in [10, 11, 12]:
|
|
38
|
+
quantity = np.random.randint(1, 10)
|
|
39
|
+
else:
|
|
40
|
+
quantity = np.random.randint(1, 5)
|
|
41
|
+
|
|
42
|
+
unit_price = PRODUCTS_APPAREL[product_name]['price'] * np.random.uniform(0.9, 1.1)
|
|
43
|
+
|
|
44
|
+
customer_info = get_fake_person_info()
|
|
45
|
+
|
|
46
|
+
sales_data.append({
|
|
47
|
+
'transaction_id': 3000 + i,
|
|
48
|
+
'transaction_date': order_date,
|
|
49
|
+
'product': product_name,
|
|
50
|
+
'category': PRODUCTS_APPAREL[product_name]['category'],
|
|
51
|
+
'unit_price': round(unit_price, 2),
|
|
52
|
+
'quantity': quantity,
|
|
53
|
+
'total_sale': round(unit_price * quantity, 2),
|
|
54
|
+
'size': random.choice(SIZES),
|
|
55
|
+
'color': random.choice(COLORS),
|
|
56
|
+
'customer_id': customer_info['customer_id'],
|
|
57
|
+
'return_flag': np.random.choice([True, False], p=[0.15, 0.85])
|
|
58
|
+
})
|
|
59
|
+
return create_dataframe(sales_data, "Apparel and Fashion")
|
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
# Copyright 2025 w.Sanice
|
|
2
|
+
#
|
|
3
|
+
# Licensed under the Apache License, Version 2.0 (the "License");
|
|
4
|
+
# you may not use this file except in compliance with the License.
|
|
5
|
+
# You may obtain a copy of the License at
|
|
6
|
+
#
|
|
7
|
+
# http://www.apache.org/licenses/LICENSE-2.0
|
|
8
|
+
#
|
|
9
|
+
# Unless required by applicable law or agreed to in writing, software
|
|
10
|
+
# distributed under the License is distributed on an "AS IS" BASIS,
|
|
11
|
+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
12
|
+
# See the License for the specific language governing permissions and
|
|
13
|
+
# limitations under the License.
|
|
14
|
+
|
|
15
|
+
from .utils import np, pd, random, datetime, timedelta, set_seed, create_dataframe, get_fake_person_info, fake
|
|
16
|
+
|
|
17
|
+
PRODUCTS_FINANCIAL = {
|
|
18
|
+
'Personal Loan': {'type': 'Loan', 'min_value': 5000, 'max_value': 50000, 'base_interest': 0.015},
|
|
19
|
+
'Credit Card': {'type': 'Service', 'min_value': 1000, 'max_value': 20000, 'base_interest': 0.05},
|
|
20
|
+
'Checking Account': {'type': 'Service', 'min_value': 0, 'max_value': 0, 'base_interest': 0.0},
|
|
21
|
+
'Mortgage': {'type': 'Loan', 'min_value': 100000, 'max_value': 500000, 'base_interest': 0.007},
|
|
22
|
+
}
|
|
23
|
+
RISK_LEVELS = ['Low', 'Medium', 'High']
|
|
24
|
+
|
|
25
|
+
def generate_financial_transactions(num_records=300):
|
|
26
|
+
set_seed()
|
|
27
|
+
product_list = list(PRODUCTS_FINANCIAL.keys())
|
|
28
|
+
transaction_data = []
|
|
29
|
+
start_date = datetime(2025, 7, 1)
|
|
30
|
+
|
|
31
|
+
for i in range(num_records):
|
|
32
|
+
product = random.choice(product_list)
|
|
33
|
+
value_base = PRODUCTS_FINANCIAL[product]['min_value'] + np.random.rand() * (PRODUCTS_FINANCIAL[product]['max_value'] - PRODUCTS_FINANCIAL[product]['min_value'])
|
|
34
|
+
|
|
35
|
+
risk = random.choice(RISK_LEVELS)
|
|
36
|
+
risk_factor = {'Low': 0.9, 'Medium': 1.0, 'High': 1.2}[risk]
|
|
37
|
+
|
|
38
|
+
final_interest = PRODUCTS_FINANCIAL[product]['base_interest'] * risk_factor * np.random.uniform(0.95, 1.05)
|
|
39
|
+
|
|
40
|
+
is_default = (risk == 'High' and np.random.rand() < 0.2) or \
|
|
41
|
+
(product == 'Credit Card' and np.random.rand() < 0.1)
|
|
42
|
+
|
|
43
|
+
transaction_data.append({
|
|
44
|
+
'client_id': 7000 + np.random.randint(1, 100),
|
|
45
|
+
'transaction_date': start_date + timedelta(days=np.random.randint(1, 150)),
|
|
46
|
+
'financial_product': product,
|
|
47
|
+
'type': PRODUCTS_FINANCIAL[product]['type'],
|
|
48
|
+
'contracted_value': round(value_base, 2),
|
|
49
|
+
'monthly_interest_rate': round(final_interest, 4),
|
|
50
|
+
'client_risk_level': risk,
|
|
51
|
+
'is_default': is_default
|
|
52
|
+
})
|
|
53
|
+
return create_dataframe(transaction_data, "Financial Services")
|
|
@@ -0,0 +1,61 @@
|
|
|
1
|
+
# Copyright 2025 w.Sanice
|
|
2
|
+
#
|
|
3
|
+
# Licensed under the Apache License, Version 2.0 (the "License");
|
|
4
|
+
# you may not use this file except in compliance with the License.
|
|
5
|
+
# You may obtain a copy of the License at
|
|
6
|
+
#
|
|
7
|
+
# http://www.apache.org/licenses/LICENSE-2.0
|
|
8
|
+
#
|
|
9
|
+
# Unless required by applicable law or agreed to in writing, software
|
|
10
|
+
# distributed under the License is distributed on an "AS IS" BASIS,
|
|
11
|
+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
12
|
+
# See the License for the specific language governing permissions and
|
|
13
|
+
# limitations under the License.
|
|
14
|
+
|
|
15
|
+
from .utils import np, pd, random, datetime, timedelta, set_seed, create_dataframe, get_fake_person_info, fake
|
|
16
|
+
|
|
17
|
+
PRODUCTS_FOOD = {
|
|
18
|
+
'Whole Milk 1L': {'category': 'Dairy', 'price': 5.50, 'perishable': True},
|
|
19
|
+
'Roasted Coffee 500g': {'category': 'Grocery', 'price': 18.00, 'perishable': False},
|
|
20
|
+
'Beef Tenderloin (kg)': {'category': 'Meat', 'price': 65.00, 'perishable': True},
|
|
21
|
+
'Craft Beer 6-pack': {'category': 'Beverages', 'price': 55.00, 'perishable': False},
|
|
22
|
+
'Parboiled Rice 5kg': {'category': 'Grocery', 'price': 22.00, 'perishable': False},
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
def generate_food_sales(num_records=400):
|
|
26
|
+
set_seed()
|
|
27
|
+
product_list = list(PRODUCTS_FOOD.keys())
|
|
28
|
+
sales_data = []
|
|
29
|
+
start_date = datetime(2025, 10, 1)
|
|
30
|
+
|
|
31
|
+
for i in range(num_records):
|
|
32
|
+
product_name = random.choice(product_list)
|
|
33
|
+
order_date = start_date + timedelta(days=np.random.randint(1, 150), hours=np.random.randint(0, 23))
|
|
34
|
+
quantity = np.random.randint(1, 20)
|
|
35
|
+
|
|
36
|
+
base_price = PRODUCTS_FOOD[product_name]['price']
|
|
37
|
+
|
|
38
|
+
if PRODUCTS_FOOD[product_name]['perishable'] and np.random.rand() < 0.15:
|
|
39
|
+
unit_price = base_price * 0.80
|
|
40
|
+
else:
|
|
41
|
+
unit_price = base_price * np.random.uniform(0.95, 1.05)
|
|
42
|
+
|
|
43
|
+
is_perishable = PRODUCTS_FOOD[product_name]['perishable']
|
|
44
|
+
validity_days = np.random.randint(3, 30 if is_perishable else 365)
|
|
45
|
+
expiration_date = order_date + timedelta(days=validity_days)
|
|
46
|
+
|
|
47
|
+
customer_info = get_fake_person_info()
|
|
48
|
+
|
|
49
|
+
sales_data.append({
|
|
50
|
+
'transaction_id': 5000 + i,
|
|
51
|
+
'order_date': order_date,
|
|
52
|
+
'product': product_name,
|
|
53
|
+
'category': PRODUCTS_FOOD[product_name]['category'],
|
|
54
|
+
'unit_price': round(unit_price, 2),
|
|
55
|
+
'quantity': quantity,
|
|
56
|
+
'total_sale': round(unit_price * quantity, 2),
|
|
57
|
+
'expiration_date': expiration_date,
|
|
58
|
+
'customer_name': customer_info['customer_name'],
|
|
59
|
+
'delivery_zipcode': fake.postcode()
|
|
60
|
+
})
|
|
61
|
+
return create_dataframe(sales_data, "Food and Beverages")
|
|
@@ -0,0 +1,63 @@
|
|
|
1
|
+
# Copyright 2025 w.Sanice
|
|
2
|
+
#
|
|
3
|
+
# Licensed under the Apache License, Version 2.0 (the "License");
|
|
4
|
+
# you may not use this file except in compliance with the License.
|
|
5
|
+
# You may obtain a copy of the License at
|
|
6
|
+
#
|
|
7
|
+
# http://www.apache.org/licenses/LICENSE-2.0
|
|
8
|
+
#
|
|
9
|
+
# Unless required by applicable law or agreed to in writing, software
|
|
10
|
+
# distributed under the License is distributed on an "AS IS" BASIS,
|
|
11
|
+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
12
|
+
# See the License for the specific language governing permissions and
|
|
13
|
+
# limitations under the License.
|
|
14
|
+
|
|
15
|
+
from .utils import np, pd, random, datetime, timedelta, set_seed, create_dataframe, get_fake_person_info, fake
|
|
16
|
+
|
|
17
|
+
PRODUCTS_FORESTRY = {
|
|
18
|
+
'Eucalyptus Grandis (Pulp)': {'species': 'Eucalyptus', 'target_age': 7, 'unit': 'm3/ha', 'price_per_unit': 80},
|
|
19
|
+
'Pinus Elliotti (Sawwood)': {'species': 'Pinus', 'target_age': 18, 'unit': 'm3/ha', 'price_per_unit': 150},
|
|
20
|
+
'Native Hardwood (Sust. Harvest)': {'species': 'Native', 'target_age': 30, 'unit': 'm3/ha', 'price_per_unit': 400},
|
|
21
|
+
'Biomass/Energy Wood': {'species': 'Eucalyptus', 'target_age': 5, 'unit': 'tons', 'price_per_unit': 50},
|
|
22
|
+
}
|
|
23
|
+
MANAGEMENT_TYPES = ['Intensive', 'Sustainable', 'Reforestation']
|
|
24
|
+
REGIONS_FLORESTAL = ['Northern', 'Southern', 'Coastal']
|
|
25
|
+
|
|
26
|
+
def generate_forestry_records(num_records=350):
|
|
27
|
+
set_seed()
|
|
28
|
+
product_list = list(PRODUCTS_FORESTRY.keys())
|
|
29
|
+
forestry_data = []
|
|
30
|
+
start_date = datetime(2025, 1, 1)
|
|
31
|
+
|
|
32
|
+
for i in range(num_records):
|
|
33
|
+
product_name = random.choice(product_list)
|
|
34
|
+
product_info = PRODUCTS_FORESTRY[product_name]
|
|
35
|
+
record_date = start_date + timedelta(days=np.random.randint(1, 365))
|
|
36
|
+
area_hectares = np.random.uniform(100, 5000)
|
|
37
|
+
planting_age = np.random.randint(1, product_info['target_age'] * 2)
|
|
38
|
+
management = random.choice(MANAGEMENT_TYPES)
|
|
39
|
+
region = random.choice(REGIONS_FLORESTAL)
|
|
40
|
+
age_factor = min(planting_age / product_info['target_age'], 1.5) if product_info['target_age'] > 0 else 1.0
|
|
41
|
+
management_factor = {'Intensive': 1.1, 'Sustainable': 1.0, 'Reforestation': 0.9}[management]
|
|
42
|
+
volume_per_unit = product_info['price_per_unit']
|
|
43
|
+
total_volume = volume_per_unit * age_factor * management_factor * np.random.uniform(0.9, 1.1) * area_hectares
|
|
44
|
+
total_revenue = total_volume * product_info['price_per_unit'] * np.random.uniform(0.9, 1.1)
|
|
45
|
+
|
|
46
|
+
owner_info = get_fake_person_info()
|
|
47
|
+
|
|
48
|
+
forestry_data.append({
|
|
49
|
+
'inventory_id': 6000 + i,
|
|
50
|
+
'record_date': record_date,
|
|
51
|
+
'product_name': product_name,
|
|
52
|
+
'species': product_info['species'],
|
|
53
|
+
'region': region,
|
|
54
|
+
'area_hectares': round(area_hectares, 2),
|
|
55
|
+
'planting_age_years': planting_age,
|
|
56
|
+
'management_type': management,
|
|
57
|
+
'unit_of_measure': product_info['unit'],
|
|
58
|
+
'total_volume': round(total_volume, 2),
|
|
59
|
+
'estimated_unit_price': product_info['price_per_unit'],
|
|
60
|
+
'total_estimated_revenue': round(total_revenue, 2),
|
|
61
|
+
'owner_name': owner_info['customer_name']
|
|
62
|
+
})
|
|
63
|
+
return create_dataframe(forestry_data, "Forestry and Timber")
|
|
@@ -0,0 +1,65 @@
|
|
|
1
|
+
# Copyright 2025 w.Sanice
|
|
2
|
+
#
|
|
3
|
+
# Licensed under the Apache License, Version 2.0 (the "License");
|
|
4
|
+
# you may not use this file except in compliance with the License.
|
|
5
|
+
# You may obtain a copy of the License at
|
|
6
|
+
#
|
|
7
|
+
# http://www.apache.org/licenses/LICENSE-2.0
|
|
8
|
+
#
|
|
9
|
+
# Unless required by applicable law or agreed to in writing, software
|
|
10
|
+
# distributed under the License is distributed on an "AS IS" BASIS,
|
|
11
|
+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
12
|
+
# See the License for the specific language governing permissions and
|
|
13
|
+
# limitations under the License.
|
|
14
|
+
|
|
15
|
+
from .utils import np, pd, random, datetime, timedelta, set_seed, create_dataframe, get_fake_person_info, fake
|
|
16
|
+
|
|
17
|
+
PRODUCTS_HEALTH_BEAUTY = {
|
|
18
|
+
'Hydrating Facial Cream': {'type': 'Product', 'category': 'Skincare', 'price': 85.00, 'recurrence_days': 60},
|
|
19
|
+
'Whey Protein Isolate 900g': {'type': 'Product', 'category': 'Supplements', 'price': 150.00, 'recurrence_days': 45},
|
|
20
|
+
'Hair Shampoo (Anti-Frizz)': {'type': 'Product', 'category': 'Haircare', 'price': 35.00, 'recurrence_days': 30},
|
|
21
|
+
'Lip Filler Session': {'type': 'Service', 'category': 'Aesthetics', 'price': 1200.00, 'recurrence_days': 180},
|
|
22
|
+
'Deep Tissue Massage': {'type': 'Service', 'category': 'Wellness', 'price': 150.00, 'recurrence_days': 90},
|
|
23
|
+
'Multivitamin Daily': {'type': 'Product', 'category': 'Supplements', 'price': 70.00, 'recurrence_days': 90},
|
|
24
|
+
}
|
|
25
|
+
DISCOUNT_CHANNELS = ['Online Store', 'Physical Store', 'Subscription']
|
|
26
|
+
|
|
27
|
+
def generate_health_beauty_sales(num_records=550):
|
|
28
|
+
set_seed()
|
|
29
|
+
product_list = list(PRODUCTS_HEALTH_BEAUTY.keys())
|
|
30
|
+
sales_data = []
|
|
31
|
+
start_date = datetime(2025, 11, 1)
|
|
32
|
+
|
|
33
|
+
for i in range(num_records):
|
|
34
|
+
product_name = random.choice(product_list)
|
|
35
|
+
product_info = PRODUCTS_HEALTH_BEAUTY[product_name]
|
|
36
|
+
|
|
37
|
+
transaction_date = start_date + timedelta(days=np.random.randint(1, 120), hours=np.random.randint(0, 23))
|
|
38
|
+
quantity = np.random.randint(1, 4) if product_info['type'] == 'Product' else 1
|
|
39
|
+
channel = random.choice(DISCOUNT_CHANNELS)
|
|
40
|
+
unit_price = product_info['price']
|
|
41
|
+
|
|
42
|
+
if channel == 'Subscription':
|
|
43
|
+
unit_price = unit_price * 0.90
|
|
44
|
+
else:
|
|
45
|
+
unit_price = unit_price * np.random.uniform(0.95, 1.05)
|
|
46
|
+
|
|
47
|
+
days_to_next_purchase = product_info['recurrence_days'] + np.random.randint(-15, 15)
|
|
48
|
+
|
|
49
|
+
customer_info = get_fake_person_info()
|
|
50
|
+
|
|
51
|
+
sales_data.append({
|
|
52
|
+
'transaction_id': 8000 + i,
|
|
53
|
+
'transaction_date': transaction_date,
|
|
54
|
+
'item_name': product_name,
|
|
55
|
+
'type': product_info['type'],
|
|
56
|
+
'category': product_info['category'],
|
|
57
|
+
'unit_price': round(unit_price, 2),
|
|
58
|
+
'quantity': quantity,
|
|
59
|
+
'total_sale': round(unit_price * quantity, 2),
|
|
60
|
+
'customer_id': customer_info['customer_id'],
|
|
61
|
+
'sales_channel': channel,
|
|
62
|
+
'days_until_next_purchase_expected': days_to_next_purchase,
|
|
63
|
+
'consultant_name': fake.name() if product_info['type'] == 'Service' else None
|
|
64
|
+
})
|
|
65
|
+
return create_dataframe(sales_data, "Health and Beauty")
|
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
# Copyright 2025 w.Sanice
|
|
2
|
+
#
|
|
3
|
+
# Licensed under the Apache License, Version 2.0 (the "License");
|
|
4
|
+
# you may not use this file except in compliance with the License.
|
|
5
|
+
# You may obtain a copy of the License at
|
|
6
|
+
#
|
|
7
|
+
# http://www.apache.org/licenses/LICENSE-2.0
|
|
8
|
+
#
|
|
9
|
+
# Unless required by applicable law or agreed to in writing, software
|
|
10
|
+
# distributed under the License is distributed on an "AS IS" BASIS,
|
|
11
|
+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
12
|
+
# See the License for the specific language governing permissions and
|
|
13
|
+
# limitations under the License.
|
|
14
|
+
|
|
15
|
+
from .utils import np, pd, random, datetime, timedelta, set_seed, create_dataframe, get_fake_person_info
|
|
16
|
+
|
|
17
|
+
PRODUCTS_TECH = {
|
|
18
|
+
'Gaming Laptop': {'category': 'Electronics', 'price': 7500.00},
|
|
19
|
+
'Vertical Mouse': {'category': 'Accessories', 'price': 250.00},
|
|
20
|
+
'Mechanical Keyboard': {'category': 'Accessories', 'price': 550.00},
|
|
21
|
+
'Ultrawide Monitor': {'category': 'Electronics', 'price': 2800.00},
|
|
22
|
+
'Gaming Chair': {'category': 'Furniture', 'price': 1200.00},
|
|
23
|
+
'Headset 7.1': {'category': 'Accessories', 'price': 800.00},
|
|
24
|
+
'Video Card': {'category': 'Hardware', 'price': 4500.00},
|
|
25
|
+
'SSD 1TB': {'category': 'Hardware', 'price': 600.00}
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
def generate_tech_sales(num_records=600):
|
|
29
|
+
set_seed()
|
|
30
|
+
product_list = list(PRODUCTS_TECH.keys())
|
|
31
|
+
sales_data = []
|
|
32
|
+
start_date = datetime(2026, 1, 1)
|
|
33
|
+
|
|
34
|
+
for i in range(num_records):
|
|
35
|
+
product_name = random.choice(product_list)
|
|
36
|
+
quantity = np.random.randint(1, 8)
|
|
37
|
+
order_date = start_date + timedelta(days=int(i / 5) * random.randint(1, 3), hours=random.randint(0, 23))
|
|
38
|
+
|
|
39
|
+
if product_name in ['Vertical Mouse', 'Mechanical Keyboard']:
|
|
40
|
+
unit_price = PRODUCTS_TECH[product_name]['price'] * np.random.uniform(0.9, 1.0)
|
|
41
|
+
else:
|
|
42
|
+
unit_price = PRODUCTS_TECH[product_name]['price']
|
|
43
|
+
|
|
44
|
+
customer_info = get_fake_person_info()
|
|
45
|
+
|
|
46
|
+
sales_data.append({
|
|
47
|
+
'order_id': 1000 + i,
|
|
48
|
+
'order_date': order_date,
|
|
49
|
+
'product_name': product_name,
|
|
50
|
+
'category': PRODUCTS_TECH[product_name]['category'],
|
|
51
|
+
'unit_price': round(unit_price, 2),
|
|
52
|
+
'quantity': quantity,
|
|
53
|
+
'total_sale': round(unit_price * quantity, 2),
|
|
54
|
+
'customer_id': customer_info['customer_id'],
|
|
55
|
+
'city': customer_info['city'],
|
|
56
|
+
'state': customer_info['state']
|
|
57
|
+
})
|
|
58
|
+
return create_dataframe(sales_data, "Technology Sales")
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
# Copyright 2025 w.Sanice
|
|
2
|
+
#
|
|
3
|
+
# Licensed under the Apache License, Version 2.0 (the "License");
|
|
4
|
+
# you may not use this file except in compliance with the License.
|
|
5
|
+
# You may obtain a copy of the License at
|
|
6
|
+
#
|
|
7
|
+
# http://www.apache.org/licenses/LICENSE-2.0
|
|
8
|
+
#
|
|
9
|
+
# Unless required by applicable law or agreed to in writing, software
|
|
10
|
+
# distributed under the License is distributed on an "AS IS" BASIS,
|
|
11
|
+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
12
|
+
# See the License for the specific language governing permissions and
|
|
13
|
+
# limitations under the License.
|
|
14
|
+
|
|
15
|
+
import pandas as pd
|
|
16
|
+
import numpy as np
|
|
17
|
+
import random
|
|
18
|
+
from datetime import datetime, timedelta
|
|
19
|
+
from faker import Faker
|
|
20
|
+
|
|
21
|
+
random.seed(42)
|
|
22
|
+
np.random.seed(42)
|
|
23
|
+
fake = Faker('en_US')
|
|
24
|
+
|
|
25
|
+
def set_seed(seed=42):
|
|
26
|
+
random.seed(seed)
|
|
27
|
+
np.random.seed(seed)
|
|
28
|
+
|
|
29
|
+
def get_fake_person_info():
|
|
30
|
+
return {
|
|
31
|
+
'customer_id': np.random.randint(100, 9999),
|
|
32
|
+
'customer_name': fake.name(),
|
|
33
|
+
'city': fake.city(),
|
|
34
|
+
'state': fake.state_abbr()
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
def create_dataframe(data_list, area_name):
|
|
38
|
+
df = pd.DataFrame(data_list)
|
|
39
|
+
print(f"Synthetic Data for {area_name} Generated Successfully. Total: {len(df)} records.")
|
|
40
|
+
return df
|
|
@@ -0,0 +1,140 @@
|
|
|
1
|
+
Metadata-Version: 2.1
|
|
2
|
+
Name: leblanc
|
|
3
|
+
Version: 0.6.0
|
|
4
|
+
Summary: A Python library to generate various synthetic DataFrames for different business sectors (Tech, Food, Finance, Apparel, forestry, etc.).
|
|
5
|
+
Home-page: https://github.com/wSanice/leblanc
|
|
6
|
+
Author: wSanice
|
|
7
|
+
Author-email: wansanice@proton.me
|
|
8
|
+
License: Apache 2.0
|
|
9
|
+
Platform: UNKNOWN
|
|
10
|
+
Classifier: Programming Language :: Python :: 3
|
|
11
|
+
Classifier: License :: OSI Approved :: Apache Software License
|
|
12
|
+
Classifier: Operating System :: OS Independent
|
|
13
|
+
Classifier: Intended Audience :: Science/Research
|
|
14
|
+
Classifier: Topic :: Scientific/Engineering :: Information Analysis
|
|
15
|
+
Requires-Python: >=3.6
|
|
16
|
+
Description-Content-Type: text/markdown
|
|
17
|
+
License-File: LICENSE
|
|
18
|
+
|
|
19
|
+
# leblanc: Sectorial Synthetic Data Generator
|
|
20
|
+
|
|
21
|
+
## I. Overview
|
|
22
|
+
|
|
23
|
+
**leblanc** is a modular Python library designed for the rapid generation of large-scale synthetic datasets across various business sectors. It is primarily built using **Pandas**, **NumPy**, and **Faker** to create realistic, structured DataFrames suitable for Data Science training, testing, and exploratory data analysis (EDA).
|
|
24
|
+
|
|
25
|
+
The library supports generating sector-specific data, complete with domain logic (e.g., product recurrence in Health, climate impact in Agribusiness, risk in Financials).
|
|
26
|
+
|
|
27
|
+
### Supported Sectors (Modules)
|
|
28
|
+
|
|
29
|
+
| Module | Data Generated | Key Domain Variables |
|
|
30
|
+
| :--- | :--- | :--- |
|
|
31
|
+
| `tech` | Tech Sales | Unit Price, Quantity, Category |
|
|
32
|
+
| `food` | Food & Beverages Sales | Expiration Date, Perishability |
|
|
33
|
+
| `apparel` | Apparel & Fashion Sales | Size, Color, Return Flag |
|
|
34
|
+
| `financial` | Financial Transactions | Interest Rate, Client Risk Level, Default Flag |
|
|
35
|
+
| `health_beauty` | Health & Beauty Sales/Services | Recurrence Days, Sales Channel |
|
|
36
|
+
| `agribusiness` | Agribusiness Records | Climate Condition, Area (Ha), Production Yield |
|
|
37
|
+
| `forestry` | Forestry Inventory/Harvest | Planting Age, Management Type, Total Volume ($m^3$) |
|
|
38
|
+
|
|
39
|
+
---
|
|
40
|
+
|
|
41
|
+
## II. Installation
|
|
42
|
+
|
|
43
|
+
leblanc is available on PyPI. Use `pip` to install the latest stable version:
|
|
44
|
+
|
|
45
|
+
```bash
|
|
46
|
+
pip install leblanc
|
|
47
|
+
```
|
|
48
|
+
## III. Basic Usage Example
|
|
49
|
+
|
|
50
|
+
The library exposes individual generation functions directly from the main package. The `set_seed` utility is recommended for data reproducibility.
|
|
51
|
+
|
|
52
|
+
```bash
|
|
53
|
+
import pandas as pd
|
|
54
|
+
from leblanc import generate_tech_sales, generate_agribusiness_records, set_seed
|
|
55
|
+
|
|
56
|
+
# Ensure data is reproducible across environments
|
|
57
|
+
set_seed(42)
|
|
58
|
+
|
|
59
|
+
# 1. Generate Technology Sales Data
|
|
60
|
+
df_tech_sales = generate_tech_sales(num_records=1000)
|
|
61
|
+
print(" Technology Data Sample")
|
|
62
|
+
print(df_tech_sales.head())
|
|
63
|
+
|
|
64
|
+
# 2. Generate Agribusiness Records
|
|
65
|
+
df_agro_records = generate_agribusiness_records(num_records=500)
|
|
66
|
+
print("\n Agribusiness Data Sample")
|
|
67
|
+
print(df_agro_records.head())
|
|
68
|
+
|
|
69
|
+
```
|
|
70
|
+
|
|
71
|
+
## IV. License
|
|
72
|
+
|
|
73
|
+
This project is licensed under the Apache License, Version 2.0. See the LICENSE file for details.
|
|
74
|
+
|
|
75
|
+
|
|
76
|
+
# 🇧🇷 leblanc: Gerador Setorial de Dados Sintéticos
|
|
77
|
+
|
|
78
|
+
## I. Visão Geral
|
|
79
|
+
|
|
80
|
+
**leblanc** é uma biblioteca Python modular projetada para a geração rápida de conjuntos de dados sintéticos de grande escala em diversos setores de negócios. É construída primariamente utilizando Pandas, NumPy e Faker para criar DataFrames estruturados e realistas, adequados para treinamento em Data Science, testes e análise exploratória de dados (AED).
|
|
81
|
+
|
|
82
|
+
A biblioteca suporta a geração de dados específicos do domínio, completos com lógica de negócio (ex: recorrência de produto em Saúde, impacto climático em Agronegócios, risco em Finanças).
|
|
83
|
+
|
|
84
|
+
Setores Suportados (Módulos)
|
|
85
|
+
|
|
86
|
+
# leblanc: Gerador Setorial de Dados Sintéticos
|
|
87
|
+
|
|
88
|
+
## I. Visão Geral
|
|
89
|
+
|
|
90
|
+
**leblanc** é uma biblioteca Python modular projetada para a geração rápida de grandes volumes de dados sintéticos em diversos setores de negócios. Ela é construída principalmente com **Pandas**, **NumPy** e **Faker**, permitindo criar DataFrames estruturados e realistas, adequados para treinamento em Data Science, testes e análise exploratória de dados (AED).
|
|
91
|
+
|
|
92
|
+
A biblioteca oferece geração de dados específica por setor, incluindo lógica de domínio (ex.: recorrência de produtos em Saúde, impacto climático em Agronegócios, risco em Finanças).
|
|
93
|
+
|
|
94
|
+
### Setores Suportados (Módulos)
|
|
95
|
+
|
|
96
|
+
| Módulo | Dados Gerados | Variáveis-Chave do Domínio |
|
|
97
|
+
| :--- | :--- | :--- |
|
|
98
|
+
| `tech` | Vendas de Tecnologia | Preço Unitário, Quantidade, Categoria |
|
|
99
|
+
| `food` | Vendas de Alimentos e Bebidas | Data de Validade, Perecibilidade |
|
|
100
|
+
| `apparel` | Vendas de Vestuário e Moda | Tamanho, Cor, Flag de Devolução |
|
|
101
|
+
| `financial` | Transações Financeiras | Taxa de Juros, Nível de Risco do Cliente, Flag de Inadimplência |
|
|
102
|
+
| `health_beauty` | Vendas/Serviços de Saúde e Beleza | Dias de Recorrência, Canal de Vendas |
|
|
103
|
+
| `agribusiness` | Registros de Agronegócios | Condição Climática, Área (Ha), Produtividade |
|
|
104
|
+
| `forestry` | Inventário/Colheita Florestal | Idade do Plantio, Tipo de Manejo, Volume Total (m³) |
|
|
105
|
+
|
|
106
|
+
## II. Instalação
|
|
107
|
+
|
|
108
|
+
leblanc está disponível no PyPI. Use o `pip` para instalar a versão estável mais recente:
|
|
109
|
+
|
|
110
|
+
```bash
|
|
111
|
+
pip install leblanc
|
|
112
|
+
```
|
|
113
|
+
|
|
114
|
+
## III. Exemplo de Uso Básico
|
|
115
|
+
|
|
116
|
+
A biblioteca expõe funções de geração individuais diretamente do pacote principal. A função auxiliar `set_seed` é recomendada para garantir a reprodutibilidade dos dados.
|
|
117
|
+
|
|
118
|
+
```bash
|
|
119
|
+
import pandas as pd
|
|
120
|
+
from leblanc import generate_tech_sales, generate_agribusiness_records, set_seed
|
|
121
|
+
|
|
122
|
+
# Garante que os dados sejam reprodutíveis em todos os ambientes
|
|
123
|
+
set_seed(42)
|
|
124
|
+
|
|
125
|
+
# 1. Gera Dados de Vendas de Tecnologia
|
|
126
|
+
df_vendas_tech = generate_tech_sales(num_records=1000)
|
|
127
|
+
print("\n Amostra de Dados de Tecnologia")
|
|
128
|
+
print(df_vendas_tech.head())
|
|
129
|
+
|
|
130
|
+
# 2. Gera Registros de Agronegócios
|
|
131
|
+
df_registros_agro = generate_agribusiness_records(num_records=500)
|
|
132
|
+
print("\n Amostra de Dados de Agronegócios")
|
|
133
|
+
print(df_registros_agro.head())
|
|
134
|
+
```
|
|
135
|
+
|
|
136
|
+
## IV. Licença
|
|
137
|
+
|
|
138
|
+
Este projeto está licenciado sob a Apache License, Version 2.0. Consulte a [LICENSE](https://www.apache.org/licenses/LICENSE-2.0)
|
|
139
|
+
para obter detalhes.
|
|
140
|
+
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
LICENSE
|
|
2
|
+
README.md
|
|
3
|
+
setup.py
|
|
4
|
+
leblanc/__init__.py
|
|
5
|
+
leblanc/agribusiness.py
|
|
6
|
+
leblanc/apparel.py
|
|
7
|
+
leblanc/financial.py
|
|
8
|
+
leblanc/food.py
|
|
9
|
+
leblanc/forestry.py
|
|
10
|
+
leblanc/health_beauty.py
|
|
11
|
+
leblanc/tech.py
|
|
12
|
+
leblanc/utils.py
|
|
13
|
+
leblanc.egg-info/PKG-INFO
|
|
14
|
+
leblanc.egg-info/SOURCES.txt
|
|
15
|
+
leblanc.egg-info/dependency_links.txt
|
|
16
|
+
leblanc.egg-info/requires.txt
|
|
17
|
+
leblanc.egg-info/top_level.txt
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
leblanc
|
leblanc-0.6.0/setup.cfg
ADDED
leblanc-0.6.0/setup.py
ADDED
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
# Copyright 2025 w.Sanice
|
|
2
|
+
#
|
|
3
|
+
# Licensed under the Apache License, Version 2.0 (the "License");
|
|
4
|
+
# you may not use this file except in compliance with the License.
|
|
5
|
+
# You may obtain a copy of the License at
|
|
6
|
+
#
|
|
7
|
+
# http://www.apache.org/licenses/LICENSE-2.0
|
|
8
|
+
#
|
|
9
|
+
# Unless required by applicable law or agreed to in writing, software
|
|
10
|
+
# distributed under the License is distributed on an "AS IS" BASIS,
|
|
11
|
+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
12
|
+
# See the License for the specific language governing permissions and
|
|
13
|
+
# limitations under the License.
|
|
14
|
+
|
|
15
|
+
from setuptools import setup, find_packages
|
|
16
|
+
|
|
17
|
+
setup(
|
|
18
|
+
name='leblanc',
|
|
19
|
+
version='0.6.0',
|
|
20
|
+
packages=find_packages(),
|
|
21
|
+
install_requires=[
|
|
22
|
+
'pandas>=1.0.0',
|
|
23
|
+
'numpy>=1.18.0',
|
|
24
|
+
'Faker>=18.0.0',
|
|
25
|
+
],
|
|
26
|
+
author='wSanice',
|
|
27
|
+
author_email='wansanice@proton.me',
|
|
28
|
+
description='A Python library to generate various synthetic DataFrames for different business sectors (Tech, Food, Finance, Apparel, forestry, etc.).',
|
|
29
|
+
long_description=open('README.md', encoding='utf-8').read(),
|
|
30
|
+
long_description_content_type='text/markdown',
|
|
31
|
+
url='https://github.com/wSanice/leblanc',
|
|
32
|
+
license='Apache 2.0',
|
|
33
|
+
classifiers=[
|
|
34
|
+
'Programming Language :: Python :: 3',
|
|
35
|
+
'License :: OSI Approved :: Apache Software License',
|
|
36
|
+
'Operating System :: OS Independent',
|
|
37
|
+
'Intended Audience :: Science/Research',
|
|
38
|
+
'Topic :: Scientific/Engineering :: Information Analysis'
|
|
39
|
+
],
|
|
40
|
+
python_requires='>=3.6',
|
|
41
|
+
)
|