sdk for ali(Jason Lee)'s environment
Project description
jason-lee-tools
A tools for private cloud by Jason Lee.
Installation
pip install jason-lee-tools
发送短信提醒
api_key = '如有需要,找阿力'
api_secret = '如有需要,找阿力'
sms = SMS(api_key, api_secret)
phone = '18600806692'
msg = '你好,世界。'
try:
response = sms.send(phone, msg, '2024-07-15 13:46:00') #如果是立刻发哦送,最后一个参数可以为None
print('成功:', response)
except requests.exceptions.RequestException as e:
print('请求失败:', e)
发送提醒邮件
api_key = '如有需要,找阿力'
api_secret = '如有需要,找阿力'
email = Mail(api_key, api_secret)
to = '5988628@qq.com'
subject = "你好"
body = '你好,世界。'
try:
response = email.send(to, subject, body, '2024-07-15 13:46:00') #如果是立刻发哦送,最后一个参数可以为None
print('成功:', response)
except requests.exceptions.RequestException as e:
print('请求失败:', e)
获取天气预报
api_key = '' # 从和风天气获取的API密钥
location = '101010100' # 北京的地点ID
weather = get_weather(api_key, location)
if 'error' not in weather:
print(f"Location: {weather['location']}")
print(f"Temperature: {weather['temperature']}°C")
print(f"Weather: {weather['weather']}")
else:
print(weather['error'])
了解明天是否会下雨
api_key = '' # 从和风天气获取的API密钥
location = '101010100' # 北京的地点ID
tomorrow_weather = get_tomorrow_weather(api_key, location)
if 'error' not in tomorrow_weather:
if will_it_rain_tomorrow(tomorrow_weather):
print("明天会下雨")
else:
print("明天不会下雨")
else:
print(tomorrow_weather['error'])
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
File details
Details for the file jason-lee-tools-0.10.0.tar.gz
.
File metadata
- Download URL: jason-lee-tools-0.10.0.tar.gz
- Upload date:
- Size: 4.9 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/5.1.1 CPython/3.10.11
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 1983deb22904c11d6b9d2a2a86662c0ed2694809cb9b27cad23b92fe107a74b6 |
|
MD5 | 8d8a2565f1dd4c93c283b37da9d8a06c |
|
BLAKE2b-256 | 6413f40cfbf58325ba8629dd5bc73c05f751edd9bc703390045e3e8ab30c1d3b |
File details
Details for the file jason_lee_tools-0.10.0-py3-none-any.whl
.
File metadata
- Download URL: jason_lee_tools-0.10.0-py3-none-any.whl
- Upload date:
- Size: 6.9 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/5.1.1 CPython/3.10.11
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | a5e5ce430f6baac7579376d9e2f07d9d3696fe4aad722bc66fb0dabfc60e01d9 |
|
MD5 | 4abac1cf10719002bbffd153141784ca |
|
BLAKE2b-256 | 4485d1eb4575ebcc7390f3f801f3b4c1e0a680531b6448caf260e8fb15b2e75c |