By Haoran Wang, Sr. Big Data Solution Architect of Alibaba Cloud
Note: PyODPS2 is Python2 script. PyODPS3 is Python3 script.
You need to use Exclusive Resource Group, if you want to add some python library, eg. Using PIP to import some library
Purchase Exclusive Resource Group for Scheduling
After that find out the resource group and click O&M Assistant
Click Create Command
/home/tops/bin/pip3 install neo4j
Then Create and then Run
After it is running successfully, the driver is imported.
https://www.alibabacloud.com/help/en/maxcompute/latest/execution
https://pyodps.readthedocs.io/zh_CN/latest/df-basic.html#odps
from odps.df import DataFrame
from odps.df import output
df = DataFrame(o.get_table('ods_p2p'))
df.persist('ods_p2p_out', partition='dt=20230307', drop_partition=True, create_partition=True)
https://www.alibabacloud.com/help/en/maxcompute/latest/tables
records = [[111, 1.0], # A list can be specified.
[222, 2.0],
[333, 3.0],
[444, 4.0]]
o.write_table('my_new_table', records, partition='pt=test', create_partition=True) # Create a partition named test and write data to the partition.
https://www.alibabacloud.com/help/en/maxcompute/latest/tables
t = o.get_table('my_new_table')
with t.open_writer(partition='pt=test02', create_partition=True) as writer: # Create a partition named test02 and write data to the partition.
records = [[1, 1.0], # A list can be specified.
[2, 2.0],
[3, 3.0],
[4, 4.0]]
writer.write(records) # Records can be iterable objects.
/home/tops/bin/pip3 install pipedrive-python-lib
from pipedrive.client import Client
client = Client(domain='https://XXX.pipedrive.com/')
client.set_api_token('xxx')
ft_cols = ['_fivetran_start' , '_fivetran_active', '_fivetran_end', '_fivetran_synced', '_fivetran_deleted']
deals = []
more_item = True
start = 0
print(f'getting pipedrive - data!!!!')
while more_item == True:
dl = client.deals.get_all_deals({'start':start})
if dl['success'] == True:
deals.append(dl)
more_item = dl['additional_data']['pagination']['more_items_in_collection']
try:
start = dl['additional_data']['pagination']['next_start']
print(start)
except:
pass
else :
print('Get deal error, retrying!!!!')
print('getting data - Done!!!!')
print('transforming data!!!!')
/home/tops/bin/pip3 install zenpy
from zenpy import Zenpy
zenpy_client = Zenpy(subdomain = 'xxx',
email = 'xxx', password = 'xxx')
tkts = zenpy_client.search_export(type='ticket')
print(tkts)
import requests
import json
import pandas as pd
from pandas.io.json import json_normalize
r = requests.get('http://www.starcapital.de/test/Res_Stockmarketvaluation_FundamentalKZ_Tbl.php')
a = json.loads(r.text)
res = json_normalize(a)
##print(res)
df = pd.DataFrame(res)
print(df)
##df = pd.read_json(a)
##print(df)
import json
import requests
import base64
start = '20230305T01'
end = '20230305T02'
api_key=''
secret_key = ''
sample_string = api_key + ":" + secret_key
# sample_string_bytes = sample_string.encode('utf8')
# base64_bytes = base64.b64encode(sample_string_bytes)
# base64_string = base64_bytes.decode('utf8')
request_url = 'https://amplitude.com/api/2/export?start={}&end={}'.format(start, end)
headers = {
"Authorization": "Basic {}".format(sample_string)
}
headers = {"Content-Type": "application/json", "Accept": "application/json"}
r = requests.get(request_url, params={}, headers = headers, auth = (api_key, secret_key))
print(r)
Use Dataworks with Python3 to Import Data from MaxCompute to Neo4j
Streamlined Deployment and Integration of Large Language Models with PAI-EAS
JDP - June 25, 2021
Alibaba Cloud MaxCompute - April 26, 2020
Alibaba Clouder - September 3, 2019
JDP - May 20, 2021
Farruh - January 12, 2024
Alibaba Cloud MaxCompute - June 2, 2021
Alibaba Cloud provides big data consulting services to help enterprises leverage advanced data technology.
Learn MoreConduct large-scale data warehousing with MaxCompute
Learn MoreAlibaba Cloud experts provide retailers with a lightweight and customized big data consulting service to help you assess your big data maturity and plan your big data journey.
Learn MoreA secure environment for offline data development, with powerful Open APIs, to create an ecosystem for redevelopment.
Learn MoreMore Posts by Farruh