tirthajyoti / pydbgen Goto Github PK
View Code? Open in Web Editor NEWRandom dataframe and database table generator
Home Page: https://pydbgen.readthedocs.io/en/latest/
License: MIT License
Random dataframe and database table generator
Home Page: https://pydbgen.readthedocs.io/en/latest/
License: MIT License
https://github.com/tirthajyoti/pydbgen/blob/master/pydbgen/pydbgen.py#L99
import pydbgen
myDB = pydbgen.pydb()
myDB.realistic_email("Peter Parker")
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "...../pydbgen/pydbgen/pydbgen.py", line 99, in realistic_email
print(path)
UnboundLocalError: local variable 'path' referenced before assignment
#from pydbgen import pydbgen
myDB=pydbgen.pydb()
testdf= myDB.gen_data_series(data_type='data')
print(testdf)
=====================
Traceback (most recent call last):
File "D:/python/Demopycharm/Test_month/z2020_01_month/Data-collect.py", line 40, in
testdf= myDB.gen_data_series(data_type='data')
File "D:\python\Demopycharm\Myspider\venv\lib\site-packages\pydbgen\pydbgen.py", line 191, in gen_data_series
fake.seed(self.seed)
File "D:\python\Demopycharm\Myspider\venv\lib\site-packages\faker\proxy.py", line 79, in getattribute
raise TypeError(msg)
TypeError: Calling .seed()
on instances is deprecated. Use the class method Faker.seed()
instead.
I've installed pydbgen using pip into venv and received FileNotFoundError for realistic email generator:
>>> import pydbgen
>>> from pydbgen import pydbgen
>>> myDB=pydbgen.pydb()
>>> for _ in range(10):
... print(db.realistic_email('Tirtha Sarkar'))
Traceback (most recent call last):
File "<stdin>", line 2, in <module>
File "/home/dr/devel/pydbgen/venv/lib/python3.6/site-packages/pydbgen/pydbgen.py", line 99, in realistic_email
fh = open(path)
FileNotFoundError: [Errno 2] No such file or directory: 'Domains.txt'
Version:
โ$ venv/bin/pip freeze | grep pydbgen
pydbgen==1.0.5
while generating datafram getting below error
testdf=myDB.gen_dataframe(25,fields=['name','city','phone','license_plate','email'],real_email=True,phone_simple=True)
Error
fh = open(path)
FileNotFoundError: [Errno 2] No such file or directory: 'Domains.txt'
Running in Jupyter notebook / Ipython 3 shell:
!pip3 install pydbgen
import pydbgen
pydbgen.pydb()
---------------------------------------------------------------------------
AttributeError Traceback (most recent call last)
<ipython-input-4-c22bf096fc05> in <module>
----> 1 myDB = pydbgen.pydb()
AttributeError: module 'pydbgen' has no attribute 'pydb'
Also:
dir(pydbgen)
['__doc__',
'__file__',
'__loader__',
'__name__',
'__package__',
'__path__',
'__spec__']
Fix is:
from pydbgen import pydbgen
when i am about to create a new db table ,it always throw an exception like Cannot choose from an empty sequence
When passing array containing only 'phone' into fields parameter for gen_excel function, column title but no data are present in the spreadsheet. Passing single column type seems to work fine for other data types.
The setup.py
file used when installing from the repo requires sqlite
. In py3 at least this should be sqlite3
?
code:
testdf=myDB.gen_dataframe(25,fields='name','city','phone',
'license_plate','email',real_email=True,phone_simple=True)
SyntaxError: positional argument follows keyword argument
The list of possible columns/fields is quite limited. How could I for example create a number column with random numbers?
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.