MetaLM-tools
metalm的工具集,当前只有代码解释器这一个工具。
案例:
from metalm_tools import MetaLMInterpreterTool
import time
import json
packages=['numpy','pandas']
#画图
c = """
import matplotlib.pyplot as plt
import time
# 数据
x = [1, 2, 3, 4, 5]
y = [1, 4, 9, 16, 25]
# 创建折线图
plt.plot(x, y, marker='o')
# 添加标题和轴标签
plt.title("Simple Line Plot")
plt.xlabel("X Axis")
plt.ylabel("Y Axis")
# 显示图形
plt.grid(True) # 显示网格线
plt.show()
plt.savefig('test1.png')
x = [1, 2, 3, 4, 5]
y = [1, 4, 9, 16, 25]
# 创建折线图
plt.plot(x, y, marker='o')
# 添加标题和轴标签
plt.title("Simple Line Plot")
plt.xlabel("X Axis")
plt.ylabel("Y Axis")
# 显示图形
plt.grid(True) # 显示网格线
plt.show()
plt.savefig('test2.png')
for i in x:
print(i)
time.sleep(1)
"""
#操作csv
c2 = """
import pandas as pd
# 读取CSV文件
df = pd.read_csv('/codebox/1.csv')
# 获取前5行
df_first_five = df.head(5)
# 保存前5行到新的CSV文件
df_first_five.to_csv('output_file.csv', index=False)
print("前5行已保存到 'output_file.csv'")
"""
tool = MetaLMInterpreterTool(<服务url>,'empty')
print(tool.session.session_id)
tool.install_python_packages(packages)
res1 = tool.upload_files([<上传文件>],['这是要分析的数据'])
res2 = tool.upload_files([<上传图片>],['这是图片'])
print('path:',res1,res2)
rsp = tool._run(c2)
rsp = json.loads(rsp)
print(rsp)
tbyte = tool.download_files(['output_file.csv'])
print(tbyte)
rsp = tool._run(c)
rsp = json.loads(rsp)
print(rsp)
tool.close()
Metadata
Release files for metalm-tools 0.1.2
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| metalm_tools-0.1.2.tar.gz | 12.0 kB | Without provenance | Details for metalm_tools-0.1.2.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| metalm_tools-0.1.2-py3-none-any.whl | Python 3 | none | any | Details for metalm_tools-0.1.2-py3-none-any.whl |
Total release size: 19.5 kB
Release files / metalm_tools-0.1.2.tar.gz
| Download URL | metalm_tools-0.1.2.tar.gz |
|---|---|
| Size | 12.0 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
e8e55bd9ceb09d0c27b580cfc1e85b6df77c8eb8e9859eb31a39f18a2bde794d
|
|
BLAKE2b-256 checksum How to use checksums |
7facd3a993f59a30da450302cb78d3afab2884a7db01a4e26b84432ed230348e
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/4.0.2 CPython/3.9.19
|
Release files / metalm_tools-0.1.2-py3-none-any.whl
| Download URL | metalm_tools-0.1.2-py3-none-any.whl |
|---|---|
| Size | 7.5 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
7e2de658956324600889ba1159dfabf577c59e28221f857acd0f55579f91be11
|
|
BLAKE2b-256 checksum How to use checksums |
7a4958ee91ad7bfc1aa194e1859c4a2947e931c49112e7fa159a935a8df3369e
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/4.0.2 CPython/3.9.19
|
Security for metalm-tools 0.1.2
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.