Skip to main content

A Python package to generate csv/json from command line. It allows you to create CSV/JSON files by asking you to manually enter data for each cells row by row in Terminal (Windows CMD / Bash).

Project description

kaggle_dataset_creator - A Python package to generate csv/json

A Python package that allows you to create CSV/JSON files by manually entering each of the entries of cells row by row in Terminal (Windows CMD / Bash).

Installation

Open terminal and enter the below command (Python 3).

pip install kaggle_dataset_creator

Features

  • It allows you to create your own CSV file if you are looking for creating a CSV with manually entered data. You can also get the JSON version of the entered data.

  • You can also view your data at any point of time in your Terminal and again continue to enter data if you wish to add more rows/records for your final CSV/JSON file.

Note: Currently the package is in development, it will be released soon.

Example

from kaggle_dataset_creator import KaggleDataSet

kd = KaggleDataSet()
kd.start()

print(kd.columns)
print(kd.container)

kd.view();   # To view the final DataFrame on Terminal
kd.to_csv(); # To save in csv, default file name is take if filename is not provided 

print("DATA:- ")
print(kd.dataset) # Accessing dataset attribute to get the final DataFrame

print('Total rows: ', kd.rows)
print('Types: ', kd.data_types)

If you want to try above in the terminal, try as below after installation.

In next version, it will be released with more features. Here our intension is to get the final CSV/JSON.

>>> from kaggle_dataset_creator import KaggleDataSet
>>>
>>> kd = KaggleDataSet()
>>> kd.start()
Enter number of columns that you want in your dataset: 3

SUCCESS: You are successfully done with no. of columns
Enter the name of 1st column: fullname
Enter the name of 2nd column: age
Enter the name of 3rd column: salary

SUCCESS: You are successfully done with the column names
[DATA ENTRY] <row: 1>  fullname    : Raj Shekhar
[DATA ENTRY] <row: 1>  age         : 45
[DATA ENTRY] <row: 1>  salary      : 600000

==================================================
Do you want to add 1 more row / view data (y/n/v): y
==================================================
[DATA ENTRY] <row: 2>  fullname    : Venc Bell
[DATA ENTRY] <row: 2>  age         : 67
[DATA ENTRY] <row: 2>  salary      : 900000

==================================================
Do you want to add 1 more row / view data (y/n/v): y
==================================================
[DATA ENTRY] <row: 3>  fullname    : Robert Grime
[DATA ENTRY] <row: 3>  age         : 89
[DATA ENTRY] <row: 3>  salary      : 9000000

==================================================
Do you want to add 1 more row / view data (y/n/v): v

--------------------------------------------------
       fullname age   salary
0   Raj Shekhar  45   600000
1     Venc Bell  67   900000
2  Robert Grime  89  9000000
--------------------------------------------------

==================================================
Do you want to add 1 more row / view data (y/n/v): y
==================================================
[DATA ENTRY] <row: 4>  fullname    : Elen Goom
[DATA ENTRY] <row: 4>  age         : 55
[DATA ENTRY] <row: 4>  salary      : 800000

==================================================
Do you want to add 1 more row / view data (y/n/v): y
==================================================
[DATA ENTRY] <row: 5>  fullname    : Rita Ora
[DATA ENTRY] <row: 5>  age         : 36
[DATA ENTRY] <row: 5>  salary      : 9900000

==================================================
Do you want to add 1 more row / view data (y/n/v): v

--------------------------------------------------
       fullname age   salary
0   Raj Shekhar  45   600000
1     Venc Bell  67   900000
2  Robert Grime  89  9000000
3     Elen Goom  55   800000
4      Rita Ora  36  9900000
--------------------------------------------------

==================================================
Do you want to add 1 more row / view data (y/n/v): y
==================================================
[DATA ENTRY] <row: 6>  fullname    : Senso Tomy
[DATA ENTRY] <row: 6>  age         : 54
[DATA ENTRY] <row: 6>  salary      : 7700000

==================================================
Do you want to add 1 more row / view data (y/n/v): n
Is this mistakenly typed (y/n): n
==================================================

SUCCESS: You are successfully done with entering data for your dataset
>>>
>>> # View the data
...
>>> kd.view()

--------------------------------------------------
       fullname age   salary
0   Raj Shekhar  45   600000
1     Venc Bell  67   900000
2  Robert Grime  89  9000000
3     Elen Goom  55   800000
4      Rita Ora  36  9900000
5    Senso Tomy  54  7700000
--------------------------------------------------
True
>>>
>>> success = kd.view()

--------------------------------------------------
       fullname age   salary
0   Raj Shekhar  45   600000
1     Venc Bell  67   900000
2  Robert Grime  89  9000000
3     Elen Goom  55   800000
4      Rita Ora  36  9900000
5    Senso Tomy  54  7700000
--------------------------------------------------
>>>
>>> success
True
>>>
>>> # Store the dataset as DataFrame
...
>>> df = kd.dataset
>>> df
       fullname age   salary
0   Raj Shekhar  45   600000
1     Venc Bell  67   900000
2  Robert Grime  89  9000000
3     Elen Goom  55   800000
4      Rita Ora  36  9900000
5    Senso Tomy  54  7700000
>>>
>>> type(df)
<class 'pandas.core.frame.DataFrame'>
>>>
>>> kd.rows
6
>>>
>>> kd.data_types
{'fullname': 'string', 'age': 'numeric', 'salary': 'numeric'}
>>>

Generating random strings

Python 3.6.7 (v3.6.7:6ec5cf24b7, Oct 20 2018, 03:02:14) 
[GCC 4.2.1 Compatible Apple LLVM 6.0 (clang-600.0.57)] on darwin
Type "help", "copyright", "credits" or "license" for more information.
>>> 
>>> from kaggle_dataset_creator.random_string import random_string
>>> 
>>> random_string()
'VFdwQmVFOV'
>>> 
>>> random_string()
'TWpBeE9TMH'
>>> 
>>> random_string()
'=UDN0gDN54'
>>> 
>>> random_string()
'TWpBeE9TMH'
>>> 
>>> random_string()
'=ATM1UDMz4'
>>> 
>>> random_string(11)
'VFdwQmVFOVR'
>>> 
>>> random_string(15)
'5M2RW5kTUVVRxAT'
>>> 
>>> random_string(15)
'VFdwQmVFOVRNSGR'
>>> 
>>> random_string(15)
'5M2RS9kQUFVR5sW'
>>> 
>>> random_string(15)
'=AzN2MDMy4iNzoz'
>>> 
>>> random_string(15)
'MjAxOS0wNS0yMSA'
>>> 

Project details


Download files

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

Source Distribution

kaggle_dataset_creator-0.0.1.tar.gz (8.9 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

kaggle_dataset_creator-0.0.1-py3-none-any.whl (10.8 kB view details)

Uploaded Python 3

File details

Details for the file kaggle_dataset_creator-0.0.1.tar.gz.

File metadata

  • Download URL: kaggle_dataset_creator-0.0.1.tar.gz
  • Upload date:
  • Size: 8.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.13.0 pkginfo/1.5.0.1 requests/2.21.0 setuptools/41.0.1 requests-toolbelt/0.9.1 tqdm/4.31.1 CPython/3.6.7

File hashes

Hashes for kaggle_dataset_creator-0.0.1.tar.gz
Algorithm Hash digest
SHA256 1634f2c9ac9ca984d4db9daf306b48f33ea143e683c567fe8c43c682856f0b99
MD5 18ecc5decbc051aa71f98178bd411ec1
BLAKE2b-256 95e3cdf474eb008cdc6bf254bcf352a6509fdb71d17be625eff725d898e9655e

See more details on using hashes here.

File details

Details for the file kaggle_dataset_creator-0.0.1-py3-none-any.whl.

File metadata

  • Download URL: kaggle_dataset_creator-0.0.1-py3-none-any.whl
  • Upload date:
  • Size: 10.8 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.13.0 pkginfo/1.5.0.1 requests/2.21.0 setuptools/41.0.1 requests-toolbelt/0.9.1 tqdm/4.31.1 CPython/3.6.7

File hashes

Hashes for kaggle_dataset_creator-0.0.1-py3-none-any.whl
Algorithm Hash digest
SHA256 15adb478bbe278f2ed683872ed239342107ec7f5ec08d78cc7498360b52c9208
MD5 26c6fee7f094bef1400104609782da36
BLAKE2b-256 f10b45053e993622b44885eaca9e4821e62d6da2234c4d5ec95c7eba449173f0

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page