
Python Script
- or -
Post a project like this886
€20(approx. $23)
- Posted:
- Proposals: 8
- Remote
- #3786789
- Awarded
DATA ENTRY EXPERT |WEB SCRAPPING | PYTHON SCRAPPING | BEAUTIFUL SOAP|ADMIN ASSISTANT

WordPress Expert | Web & App Developer | SEO Specialist | Content Writer | Blockchain | Python | OpenAI | Machine Learning

WordPress Expert✮Shopify Expert✮Graphic Designer✮AutoCAD 2D & 3D✮CV Writer & Designer✮Fullstack developer

Quick Graphic Designer + Animator + Video Editor + Photo Editor + Logo Designer + Autocad Designer

Senior Python/PHP Developer, AWS Certified Solution Architect, API Expert, DevOps proficient Developer, Web Scraping Expert, Docker/Kubernetes Experienced Developer
24336973075310315100536365736476906552447615953613470818





Description
Experience Level: Entry
Hey
I´ve this code to read a PYTHON API and store the data in a mysql, I need to optimize and be faster.
Can you help me to optimize the python script to be faster.?
cur = con.cursor(buffered=True)
t = Tranco(cache=True, cache_dir='.tranco')
latest_list = t.list()
print(latest_list.top(1000000))
for i in range(len(latest_list.top(1000000))):
mySql_insert_query = """INSERT INTO Domain (rank, Domain, date) VALUES (%s, %s, %s)"""
my = (i,latest_list.top(1000000)[i],datetime.datetime.today())
cur.execute(mySql_insert_query, my)
con.commit()
print("Data was was inserted.")
i+=1
I´ve this code to read a PYTHON API and store the data in a mysql, I need to optimize and be faster.
Can you help me to optimize the python script to be faster.?
cur = con.cursor(buffered=True)
t = Tranco(cache=True, cache_dir='.tranco')
latest_list = t.list()
print(latest_list.top(1000000))
for i in range(len(latest_list.top(1000000))):
mySql_insert_query = """INSERT INTO Domain (rank, Domain, date) VALUES (%s, %s, %s)"""
my = (i,latest_list.top(1000000)[i],datetime.datetime.today())
cur.execute(mySql_insert_query, my)
con.commit()
print("Data was was inserted.")
i+=1

appolo.co.uk
100% (15)Projects Completed
13
Freelancers worked with
12
Projects awarded
34%
Last project
4 Dec 2024
Portugal
New Proposal
Login to your account and send a proposal now to get this project.
Log inClarification Board Ask a Question
-
You can create a temp table and add the rows in one transaction. The SQL query takes very long because of commiting each single row.
-
Hi I have experience with these kind of pipelines.
What is your ODBC driver version? and how much the memory on the server where you are running this script?
10433291043328
We collect cookies to enable the proper functioning and security of our website, and to enhance your experience. By clicking on 'Accept All Cookies', you consent to the use of these cookies. You can change your 'Cookies Settings' at any time. For more information, please read ourCookie Policy
Cookie Settings
Accept All Cookies