Skip to main content

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


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

jason-lee-tools-0.6.2.tar.gz (4.8 kB view details)

Uploaded Source

Built Distribution

jason_lee_tools-0.6.2-py3-none-any.whl (6.8 kB view details)

Uploaded Python 3

File details

Details for the file jason-lee-tools-0.6.2.tar.gz.

File metadata

  • Download URL: jason-lee-tools-0.6.2.tar.gz
  • Upload date:
  • Size: 4.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.1.1 CPython/3.10.11

File hashes

Hashes for jason-lee-tools-0.6.2.tar.gz
Algorithm Hash digest
SHA256 60255b41b2507e450ed1a3bc2cb769e7ccfe9688283145064f48fa09f74d6400
MD5 0738def5f6e9e0bd4fa1f6424b4f3a69
BLAKE2b-256 3a54bb0c4fd96d11a10fb8db5433cf7c5843ba7c4234cf36f0d8250c51c617e6

See more details on using hashes here.

File details

Details for the file jason_lee_tools-0.6.2-py3-none-any.whl.

File metadata

File hashes

Hashes for jason_lee_tools-0.6.2-py3-none-any.whl
Algorithm Hash digest
SHA256 ee6a077be70f344fc1526ab9e4fddc68269710d960ece4f312be546a6d68a91b
MD5 3ac3cd07b2413163722ca43705c71053
BLAKE2b-256 42f4e6b5b52d82113023c85417aaacb79ed6bae5afac0458b889cc9bb819cfa8

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page