dataforger 0.1.1__py3-none-any.whl
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.
- dataforger/__init__.py +3 -0
- dataforger/cli.py +98 -0
- dataforger/core.py +250 -0
- dataforger/countries.json +84146 -0
- dataforger/data.json +78 -0
- dataforger-0.1.1.dist-info/METADATA +106 -0
- dataforger-0.1.1.dist-info/RECORD +11 -0
- dataforger-0.1.1.dist-info/WHEEL +5 -0
- dataforger-0.1.1.dist-info/entry_points.txt +2 -0
- dataforger-0.1.1.dist-info/licenses/LICENSE +21 -0
- dataforger-0.1.1.dist-info/top_level.txt +1 -0
dataforger/data.json
ADDED
|
@@ -0,0 +1,78 @@
|
|
|
1
|
+
{
|
|
2
|
+
"first_names": [
|
|
3
|
+
"Alex",
|
|
4
|
+
"Avery",
|
|
5
|
+
"Casey",
|
|
6
|
+
"Drew",
|
|
7
|
+
"Jordan",
|
|
8
|
+
"Morgan",
|
|
9
|
+
"Quinn",
|
|
10
|
+
"Riley",
|
|
11
|
+
"Sam",
|
|
12
|
+
"Taylor"
|
|
13
|
+
],
|
|
14
|
+
"last_names": [
|
|
15
|
+
"Anderson",
|
|
16
|
+
"Bennett",
|
|
17
|
+
"Chen",
|
|
18
|
+
"Diaz",
|
|
19
|
+
"Garcia",
|
|
20
|
+
"Kim",
|
|
21
|
+
"Morgan",
|
|
22
|
+
"Patel",
|
|
23
|
+
"Smith",
|
|
24
|
+
"Wilson"
|
|
25
|
+
],
|
|
26
|
+
"streets": [
|
|
27
|
+
"Cedar",
|
|
28
|
+
"Highland",
|
|
29
|
+
"Lake",
|
|
30
|
+
"Maple",
|
|
31
|
+
"Oak",
|
|
32
|
+
"Park",
|
|
33
|
+
"Pine",
|
|
34
|
+
"River"
|
|
35
|
+
],
|
|
36
|
+
"street_types": [
|
|
37
|
+
"Ave",
|
|
38
|
+
"Blvd",
|
|
39
|
+
"Lane",
|
|
40
|
+
"Road",
|
|
41
|
+
"Street"
|
|
42
|
+
],
|
|
43
|
+
"companies": [
|
|
44
|
+
"Acme",
|
|
45
|
+
"Bluebird",
|
|
46
|
+
"Cedar",
|
|
47
|
+
"Evergreen",
|
|
48
|
+
"Northstar",
|
|
49
|
+
"Pioneer",
|
|
50
|
+
"Silverline",
|
|
51
|
+
"Summit"
|
|
52
|
+
],
|
|
53
|
+
"company_suffixes": [
|
|
54
|
+
"Group",
|
|
55
|
+
"Labs",
|
|
56
|
+
"Partners",
|
|
57
|
+
"Solutions",
|
|
58
|
+
"Studio"
|
|
59
|
+
],
|
|
60
|
+
"email_domains": [
|
|
61
|
+
"example.com",
|
|
62
|
+
"example.net",
|
|
63
|
+
"example.org",
|
|
64
|
+
"example.ai",
|
|
65
|
+
"dummy.com",
|
|
66
|
+
"dummy.net",
|
|
67
|
+
"dummy.org",
|
|
68
|
+
"dummy.ai",
|
|
69
|
+
"fakedata.com",
|
|
70
|
+
"fakedata.net",
|
|
71
|
+
"fakedata.org",
|
|
72
|
+
"fakedata.ai",
|
|
73
|
+
"dummydata.com",
|
|
74
|
+
"dummydata.net",
|
|
75
|
+
"dummydata.org",
|
|
76
|
+
"dummydata.ai"
|
|
77
|
+
]
|
|
78
|
+
}
|
|
@@ -0,0 +1,106 @@
|
|
|
1
|
+
Metadata-Version: 2.4
|
|
2
|
+
Name: dataforger
|
|
3
|
+
Version: 0.1.1
|
|
4
|
+
Summary: Generate fake data from Python or the command line.
|
|
5
|
+
License: MIT License
|
|
6
|
+
|
|
7
|
+
Copyright (c) 2026 Karmanshi Shrivastava
|
|
8
|
+
|
|
9
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
10
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
11
|
+
in the Software without restriction, including without limitation the rights
|
|
12
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
13
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
14
|
+
furnished to do so, subject to the following conditions:
|
|
15
|
+
|
|
16
|
+
The above copyright notice and this permission notice shall be included in all
|
|
17
|
+
copies or substantial portions of the Software.
|
|
18
|
+
|
|
19
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
20
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
21
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
22
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
23
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
24
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
25
|
+
SOFTWARE.
|
|
26
|
+
|
|
27
|
+
Classifier: Development Status :: 3 - Alpha
|
|
28
|
+
Classifier: Environment :: Console
|
|
29
|
+
Classifier: Intended Audience :: Developers
|
|
30
|
+
Classifier: License :: OSI Approved :: MIT License
|
|
31
|
+
Classifier: Programming Language :: Python :: 3
|
|
32
|
+
Classifier: Programming Language :: Python :: 3 :: Only
|
|
33
|
+
Requires-Python: >=3.10
|
|
34
|
+
Description-Content-Type: text/markdown
|
|
35
|
+
License-File: LICENSE
|
|
36
|
+
Dynamic: license-file
|
|
37
|
+
|
|
38
|
+
# dataforger
|
|
39
|
+
|
|
40
|
+
Generate realistic fake data from Python or the command line, and save it as
|
|
41
|
+
CSV or JSON. Dataforger uses only the Python standard library and has no
|
|
42
|
+
third-party runtime dependencies.
|
|
43
|
+
|
|
44
|
+
Built-in names, streets, companies, and email domains are stored in
|
|
45
|
+
`src/dataforger/data.json`. Country names and their associated cities are
|
|
46
|
+
stored in `src/dataforger/countries.json`; when generating a record with both
|
|
47
|
+
country and city fields, the city is selected from that country's list.
|
|
48
|
+
|
|
49
|
+
## Install
|
|
50
|
+
|
|
51
|
+
Requires Python 3.10 or later.
|
|
52
|
+
|
|
53
|
+
From a checkout of this repository:
|
|
54
|
+
|
|
55
|
+
```console
|
|
56
|
+
python -m pip install .
|
|
57
|
+
```
|
|
58
|
+
|
|
59
|
+
After publishing the package to PyPI:
|
|
60
|
+
|
|
61
|
+
```console
|
|
62
|
+
python -m pip install dataforger
|
|
63
|
+
```
|
|
64
|
+
|
|
65
|
+
## Publishing to PyPI
|
|
66
|
+
|
|
67
|
+
The GitHub Actions workflow runs the tests on Python 3.10 through 3.13 and
|
|
68
|
+
builds wheel and source distributions on pushes and pull requests. To publish,
|
|
69
|
+
configure a PyPI trusted publisher for this GitHub repository, using workflow
|
|
70
|
+
`.github/workflows/publish.yml` and the GitHub environment `pypi`. Then create
|
|
71
|
+
and publish a GitHub Release; the workflow publishes its tested distributions
|
|
72
|
+
to PyPI using trusted publishing.
|
|
73
|
+
|
|
74
|
+
## Command line
|
|
75
|
+
|
|
76
|
+
Run `dataforger` without field options for an interactive prompt. Or specify
|
|
77
|
+
all options directly:
|
|
78
|
+
|
|
79
|
+
```console
|
|
80
|
+
dataforger --rows 100 --field name:name --field email:email --field age:age --format csv --output users.csv --seed 42
|
|
81
|
+
```
|
|
82
|
+
|
|
83
|
+
The `--field` option can be repeated. Supported field types are `name`,
|
|
84
|
+
`first_name`, `last_name`, `email`, `phone`, `address`, `city`, `country`,
|
|
85
|
+
`company`, `uuid`, `date`, `age`, `integer`, `float`, and `boolean`. If
|
|
86
|
+
`--field` is omitted, the command prompts for the row count, format, output
|
|
87
|
+
path, and fields. When using command-line field options, the defaults are 10
|
|
88
|
+
rows, JSON format, and `data.json`.
|
|
89
|
+
|
|
90
|
+
## Python API
|
|
91
|
+
|
|
92
|
+
```python
|
|
93
|
+
from dataforger import generate_data, write_data
|
|
94
|
+
|
|
95
|
+
records = generate_data(
|
|
96
|
+
{"name": "name", "email": "email", "age": "age"},
|
|
97
|
+
rows=100,
|
|
98
|
+
seed=42,
|
|
99
|
+
)
|
|
100
|
+
|
|
101
|
+
write_data(records, "users.json", "json")
|
|
102
|
+
write_data(records, "users.csv", "csv")
|
|
103
|
+
```
|
|
104
|
+
|
|
105
|
+
`generate_data` returns a list of dictionaries. Pass the resulting records,
|
|
106
|
+
an output path, and either `"csv"` or `"json"` to `write_data`.
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
dataforger/__init__.py,sha256=WhbHQ-4RxsyRPpm1sMv0Tk-Ujd4X9D0oMhgsfhjWU7g,125
|
|
2
|
+
dataforger/cli.py,sha256=wPL4L2WmzVKBzq6YR-INqtMfHP9Rfr5bZhyJjDtd-oY,3461
|
|
3
|
+
dataforger/core.py,sha256=IZ30RZZ_FrI5rTctchkpp3kZMM1YlPHlKpqjkXmbelE,7363
|
|
4
|
+
dataforger/countries.json,sha256=3-M8PnN1U0c5UndXR9crsgX8MfJ_Her5ozBdWiXXO8o,1452600
|
|
5
|
+
dataforger/data.json,sha256=Zl0tHT6YTmxtI8ZltudendEo_WdOsy8MfXFO22vwdXY,1089
|
|
6
|
+
dataforger-0.1.1.dist-info/licenses/LICENSE,sha256=I-Bi2ubGJVRom4qBJe3M0xquz0aqbe5q21PpcZ2pgqU,1078
|
|
7
|
+
dataforger-0.1.1.dist-info/METADATA,sha256=DQ3HXIur39Fg1ruXxCtNDkCGIzpp9741usGiEBf2jU4,3977
|
|
8
|
+
dataforger-0.1.1.dist-info/WHEEL,sha256=YVMoNqKzERt-wjUZwJ33xBGAwnFl-4cqbYkTtWa4itE,91
|
|
9
|
+
dataforger-0.1.1.dist-info/entry_points.txt,sha256=hTz4qdENIShH6O17XGLvNkAZVpbvfJ4zy1UMTcbD8BE,51
|
|
10
|
+
dataforger-0.1.1.dist-info/top_level.txt,sha256=RwD0Eh48r78jIamgk4iso1zH2Avfn6MWfB99ndQrUk0,11
|
|
11
|
+
dataforger-0.1.1.dist-info/RECORD,,
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026 Karmanshi Shrivastava
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
dataforger
|