aishare-txt 2025.11.6.13__py3-none-any.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1,475 @@
1
+ Metadata-Version: 2.4
2
+ Name: aishare-txt
3
+ Version: 2025.11.6.13
4
+ Summary: 中国股票技术指标文本生成工具包,用于为金融分析相关领域的AI智能体提供上下文服务。
5
+ Home-page: https://gitee.com/chaofanat/aishare-txt
6
+ Author: AIShareTxt Team
7
+ Author-email: chaofanat@gmail.com
8
+ License: MIT
9
+ Classifier: Development Status :: 4 - Beta
10
+ Classifier: Intended Audience :: Financial and Insurance Industry
11
+ Classifier: Operating System :: OS Independent
12
+ Classifier: Programming Language :: Python :: 3
13
+ Classifier: Programming Language :: Python :: 3.10
14
+ Classifier: Programming Language :: Python :: 3.11
15
+ Classifier: Programming Language :: Python :: 3.12
16
+ Classifier: Topic :: Office/Business :: Financial :: Investment
17
+ Requires-Python: >=3.10
18
+ Description-Content-Type: text/markdown
19
+ License-File: LICENSE
20
+ Requires-Dist: akshare>=1.9.0
21
+ Requires-Dist: TA-Lib>=0.4.26
22
+ Requires-Dist: pandas>=1.5.0
23
+ Requires-Dist: numpy>=1.21.0
24
+ Requires-Dist: requests>=2.28.0
25
+ Requires-Dist: pandas_market_calendars>=1.1.0
26
+ Requires-Dist: openai>=1.0.0
27
+ Requires-Dist: zhipuai>=2.0.0
28
+ Provides-Extra: dev
29
+ Requires-Dist: pytest>=7.0.0; extra == "dev"
30
+ Requires-Dist: pytest-cov>=4.0.0; extra == "dev"
31
+ Requires-Dist: black>=22.0.0; extra == "dev"
32
+ Requires-Dist: flake8>=5.0.0; extra == "dev"
33
+ Requires-Dist: sphinx>=5.0.0; extra == "dev"
34
+ Requires-Dist: sphinx-rtd-theme>=1.0.0; extra == "dev"
35
+ Requires-Dist: jupyter>=1.0.0; extra == "dev"
36
+ Requires-Dist: ipython>=8.0.0; extra == "dev"
37
+ Provides-Extra: ai
38
+ Requires-Dist: openai>=1.0.0; extra == "ai"
39
+ Requires-Dist: zhipuai>=2.0.0; extra == "ai"
40
+ Dynamic: author
41
+ Dynamic: author-email
42
+ Dynamic: classifier
43
+ Dynamic: description
44
+ Dynamic: description-content-type
45
+ Dynamic: home-page
46
+ Dynamic: license
47
+ Dynamic: license-file
48
+ Dynamic: provides-extra
49
+ Dynamic: requires-dist
50
+ Dynamic: requires-python
51
+ Dynamic: summary
52
+
53
+ # AIShareTxt
54
+
55
+ [![Python Version](https://img.shields.io/badge/python-3.8%2B-blue.svg)](https://python.org)
56
+ [![License](https://img.shields.io/badge/license-MulanPSL2-blue.svg)](LICENSE)
57
+
58
+ **专业的股票技术指标分析工具包**
59
+
60
+ AIShareTxt是一个功能强大的Python股票技术指标分析工具包,提供全面的股票数据获取、技术指标计算、AI智能分析和详细报告生成功能。
61
+
62
+ ## ✨ 主要功能
63
+
64
+ - 📊 **股票数据获取** - 基于akshare,支持多数据源获取实时和历史数据
65
+ - 📈 **技术指标计算** - 基于TA-Lib,支持50+种技术指标计算
66
+ - 🤖 **AI智能分析** - 集成DeepSeek和智谱AI,提供智能投资建议
67
+ - 📋 **详细报告生成** - 自动生成专业的股票分析报告
68
+ - 🔧 **模块化设计** - 清晰的模块结构,易于扩展和定制
69
+ - ⚡ **高性能计算** - 优化的算法,支持批量处理
70
+
71
+ ## 🚀 快速安装
72
+
73
+ ### 环境要求
74
+
75
+ - Python 3.8+
76
+ - Windows/Linux/macOS
77
+
78
+ ### 安装方法
79
+
80
+ ```bash
81
+ # 从源码安装
82
+ git clone https://gitee.com/chaofanat/aishare-txt
83
+ cd aishare-txt
84
+ pip install -e .
85
+
86
+ # 或者直接安装使用项目(推荐)
87
+ pip install aishare-txt
88
+ ```
89
+
90
+
91
+ ### 依赖说明
92
+
93
+ 项目会自动安装以下核心依赖:
94
+ - `akshare>=1.9.0` - 股票数据获取
95
+ - `TA-Lib>=0.4.26` - 技术指标计算(**需先系统级安装 TA-Lib 二进制库,详见下方提示**)
96
+ - `pandas>=1.5.0` - 数据处理
97
+ - `numpy>=1.21.0` - 数值计算
98
+ - `requests>=2.28.0` - HTTP请求
99
+ - `openai>=1.0.0` - AI分析(可选)
100
+ - `zhipuai>=2.0.0` - AI分析(可选)
101
+
102
+ > ⚠️ **(https://ta-lib.org/install/)[TA-Lib] 系统级安装提示**
103
+ > 在 Linux/macOS 上请先执行:
104
+ > ```bash
105
+ > # Ubuntu/Debian
106
+ > sudo apt-get install -y build-essential python3-dev ta-lib
107
+ > # macOS (Homebrew)
108
+ > brew install ta-lib
109
+ > ```
110
+ > Windows 用户请下载对应 Python 版本的 [TA-Lib 预编译 whl](https://github.com/cgohlke/talib-build) 后手动安装。
111
+ > 否则 `pip install TA-Lib` 会因缺少底层 C 库而失败。
112
+
113
+ ## 📖 快速开始
114
+
115
+ ### 基本使用
116
+
117
+ ```python
118
+ from AIShareTxt import StockAnalyzer
119
+
120
+ # 创建分析器实例
121
+ analyzer = StockAnalyzer()
122
+
123
+ # 分析股票(直接返回报告文本)
124
+ report = analyzer.analyze_stock("000001") # 平安银行
125
+ print(report)
126
+ ```
127
+
128
+ ### 使用便捷函数
129
+
130
+ ```python
131
+ from AIShareTxt import analyze_stock
132
+
133
+ # 简单分析(直接返回报告)
134
+ report = analyze_stock("000001")
135
+ print(report)
136
+ ```
137
+
138
+ ### AI智能分析
139
+
140
+ ```python
141
+ from AIShareTxt.ai.client import AIClient
142
+
143
+ # 创建AI客户端(需要配置API密钥)
144
+ ai_client = AIClient(api_key="your_api_key", provider="deepseek")
145
+
146
+ # 进行AI分析
147
+ if ai_client.is_available():
148
+ advice = ai_client.analyze_investment_recommendation(
149
+ technical_report="技术分析报告内容",
150
+ stock_code="000001"
151
+ )
152
+ print(f"AI投资建议: {ai_client.get_recommendation_text(advice)}")
153
+ else:
154
+ print("AI功能不可用,请检查API配置")
155
+ ```
156
+
157
+ ### 技术指标计算
158
+
159
+ ```python
160
+ from AIShareTxt.indicators.technical_indicators import TechnicalIndicators
161
+ import pandas as pd
162
+ import numpy as np
163
+
164
+ # 创建技术指标计算器
165
+ ti = TechnicalIndicators()
166
+
167
+ # 准备股票数据(OHLCV格式)
168
+ data = pd.DataFrame({
169
+ 'open': [100, 102, 101, 103, 104],
170
+ 'high': [105, 106, 104, 107, 108],
171
+ 'low': [99, 101, 100, 102, 103],
172
+ 'close': [102, 101, 103, 104, 105],
173
+ 'volume': [1000, 1200, 800, 1500, 900]
174
+ })
175
+
176
+ # 计算所有技术指标
177
+ indicators = ti.calculate_all_indicators(data)
178
+
179
+ # 计算单个指标
180
+ bias = ti.calculate_bias(data['close'], timeperiod=20)
181
+ ma_patterns = ti.analyze_ma_patterns(data['close'])
182
+ ```
183
+
184
+ ### 获取股票列表
185
+
186
+ ```python
187
+ from AIShareTxt.utils.stock_list import get_stock_list
188
+
189
+ # 获取沪深300主板成分股
190
+ stocks = get_stock_list()
191
+ print(f"获取到 {len(stocks)} 只股票")
192
+ print(stocks.head())
193
+ ```
194
+
195
+ ## 📁 项目结构
196
+
197
+ ```
198
+ AIShareTxt/
199
+ ├── core/ # 核心功能模块
200
+ │ ├── analyzer.py # 股票分析器(主要入口)
201
+ │ ├── data_fetcher.py # 数据获取器
202
+ │ ├── report_generator.py # 报告生成器
203
+ │ └── config.py # 配置管理
204
+ ├── ai/ # AI分析模块
205
+ │ └── client.py # AI客户端
206
+ ├── indicators/ # 技术指标模块
207
+ │ └── technical_indicators.py # 技术指标计算
208
+ ├── utils/ # 工具模块
209
+ │ ├── utils.py # 通用工具类
210
+ │ └── stock_list.py # 股票列表工具
211
+ └── examples/ # 示例代码
212
+ └── legacy_api.py # 传统API示例
213
+ ```
214
+
215
+ ## 📊 支持的技术指标
216
+
217
+ ### 趋势指标
218
+ - 移动平均线(MA5, MA10, MA20, MA60)
219
+ - 指数移动平均线(EMA5, EMA10, EMA12, EMA20, EMA26)
220
+ - 加权移动平均线(WMA10, WMA20)
221
+ - 布林带(BOLL)
222
+
223
+ ### 动量指标
224
+ - MACD指标
225
+ - RSI相对强弱指标(RSI9, RSI14)
226
+ - KDJ随机指标
227
+ - 威廉指标(Williams %R)
228
+ - CCI商品通道指标
229
+
230
+ ### 成交量指标
231
+ - OBV能量潮指标
232
+ - VWAP成交量加权平均价
233
+ - 量比指标
234
+
235
+ ### 波动率指标
236
+ - ATR平均真实波幅
237
+ - 历史波动率
238
+
239
+ ### 资金流向指标
240
+ - 主力资金净流入
241
+ - 5日资金流向趋势
242
+ - DMI动向指标(+DI, -DI, ADX)
243
+
244
+ ## ⚙️ 配置说明
245
+
246
+ ### AI配置
247
+
248
+ 在使用AI功能前,需要配置API密钥。项目支持DeepSeek和智谱AI两种AI服务:
249
+
250
+ 1. **DeepSeek配置**
251
+ - 需要设置环境变量 `DEEPSEEK_API_KEY`
252
+ - 获取API密钥:访问 [DeepSeek官网](https://platform.deepseek.com/) 注册并获取API密钥
253
+
254
+ **Windows系统设置方法:**
255
+ ```powershell
256
+ # 临时设置(当前会话有效)
257
+ $env:DEEPSEEK_API_KEY="your_deepseek_api_key"
258
+
259
+ # 永久设置(需要管理员权限)
260
+ setx DEEPSEEK_API_KEY "your_deepseek_api_key"
261
+ ```
262
+
263
+ **Linux/macOS系统设置方法:**
264
+ ```bash
265
+ # 临时设置(当前会话有效)
266
+ export DEEPSEEK_API_KEY="your_deepseek_api_key"
267
+
268
+ # 永久设置(添加到~/.bashrc或~/.zshrc)
269
+ echo 'export DEEPSEEK_API_KEY="your_deepseek_api_key"' >> ~/.bashrc
270
+ source ~/.bashrc
271
+ ```
272
+
273
+ 2. **智谱AI配置**
274
+ - 需要设置环境变量 `ZHIPUAI_API_KEY`
275
+ - 获取API密钥:访问 [智谱AI官网](https://open.bigmodel.cn/) 注册并获取API密钥
276
+
277
+ **Windows系统设置方法:**
278
+ ```powershell
279
+ # 临时设置(当前会话有效)
280
+ $env:ZHIPUAI_API_KEY="your_zhipuai_api_key"
281
+
282
+ # 永久设置(需要管理员权限)
283
+ setx ZHIPUAI_API_KEY "your_zhipuai_api_key"
284
+ ```
285
+
286
+ **Linux/macOS系统设置方法:**
287
+ ```bash
288
+ # 临时设置(当前会话有效)
289
+ export ZHIPUAI_API_KEY="your_zhipuai_api_key"
290
+
291
+ # 永久设置(添加到~/.bashrc或~/.zshrc)
292
+ echo 'export ZHIPUAI_API_KEY="your_zhipuai_api_key"' >> ~/.bashrc
293
+ source ~/.bashrc
294
+ ```
295
+
296
+ 3. **验证环境变量设置**
297
+ ```python
298
+ import os
299
+
300
+ # 检查环境变量是否设置成功
301
+ deepseek_key = os.environ.get('DEEPSEEK_API_KEY')
302
+ zhipuai_key = os.environ.get('ZHIPUAI_API_KEY')
303
+
304
+ print(f"DeepSeek API Key: {'已设置' if deepseek_key else '未设置'}")
305
+ print(f"智谱AI API Key: {'已设置' if zhipuai_key else '未设置'}")
306
+ ```
307
+
308
+ 4. **在代码中使用**
309
+ ```python
310
+ from AIShareTxt.ai.client import AIClient
311
+
312
+ # 使用DeepSeek(默认)
313
+ ai_client = AIClient(provider="deepseek")
314
+
315
+ # 使用智谱AI
316
+ ai_client = AIClient(provider="zhipuai")
317
+
318
+ # 进行AI分析
319
+ if ai_client.is_available():
320
+ advice = ai_client.analyze_investment_recommendation(
321
+ technical_report="技术分析报告内容",
322
+ stock_code="000001"
323
+ )
324
+ print(f"AI投资建议: {ai_client.get_recommendation_text(advice)}")
325
+ else:
326
+ print("AI功能不可用,请检查API配置")
327
+ ```
328
+
329
+ ### 分析配置
330
+
331
+ 可以通过配置文件调整分析参数:
332
+
333
+ ```python
334
+ from AIShareTxt.core.config import IndicatorConfig
335
+
336
+ config = IndicatorConfig()
337
+
338
+ # 调整均线周期
339
+ config.MA_PERIODS = {
340
+ 'short': [5, 10, 20], # 短期均线
341
+ 'medium': [60], # 中期均线
342
+ 'long': [120, 250] # 长期均线
343
+ }
344
+
345
+ # 调整MACD参数
346
+ config.MACD_CONFIG = {
347
+ 'fastperiod': 12,
348
+ 'slowperiod': 26,
349
+ 'signalperiod': 9
350
+ }
351
+ ```
352
+
353
+ ## 🔧 开发指南
354
+
355
+ ### 安装开发依赖
356
+
357
+ ```bash
358
+ pip install -e ".[dev]"
359
+ ```
360
+
361
+ ### 运行示例
362
+
363
+ ```bash
364
+ cd examples
365
+ python legacy_api.py
366
+ ```
367
+
368
+ ### 代码风格
369
+
370
+ 项目使用以下工具确保代码质量:
371
+
372
+ ```bash
373
+ # 代码格式化
374
+ black AIShareTxt/
375
+
376
+ # 代码检查
377
+ flake8 AIShareTxt/
378
+
379
+ # 运行测试
380
+ pytest
381
+ ```
382
+
383
+ ## 📈 使用示例
384
+
385
+ ### 完整分析流程
386
+
387
+ ```python
388
+ from AIShareTxt import StockAnalyzer
389
+
390
+ def analyze_example():
391
+ """完整的股票分析示例"""
392
+
393
+ # 1. 创建分析器
394
+ analyzer = StockAnalyzer()
395
+
396
+ # 2. 分析指定股票
397
+ stock_code = "000001" # 平安银行
398
+ report = analyzer.analyze_stock(stock_code)
399
+
400
+ # 3. 输出分析报告
401
+ print(f"股票 {stock_code} 分析报告:")
402
+ print("=" * 60)
403
+ print(report)
404
+
405
+ # 运行示例
406
+ if __name__ == "__main__":
407
+ analyze_example()
408
+ ```
409
+
410
+ ### 批量分析
411
+
412
+ ```python
413
+ from AIShareTxt.utils.stock_list import get_stock_list
414
+ from AIShareTxt import StockAnalyzer
415
+
416
+ def batch_analysis():
417
+ """批量分析示例"""
418
+
419
+ # 获取股票列表
420
+ stocks = get_stock_list()
421
+ if stocks is None:
422
+ print("无法获取股票列表")
423
+ return
424
+
425
+ # 分析前5只股票
426
+ analyzer = StockAnalyzer()
427
+
428
+ for idx, stock in stocks.head(5).iterrows():
429
+ stock_code = stock['代码']
430
+ stock_name = stock['名称']
431
+
432
+ print(f"\n分析 {stock_name} ({stock_code})...")
433
+ print("=" * 50)
434
+
435
+ try:
436
+ report = analyzer.analyze_stock(stock_code)
437
+ print(report)
438
+
439
+ except Exception as e:
440
+ print(f" 分析失败: {e}")
441
+
442
+ batch_analysis()
443
+ ```
444
+
445
+ ## 🤝 贡献指南
446
+
447
+ 欢迎贡献代码!请遵循以下步骤:
448
+
449
+ 1. Fork 本项目
450
+ 2. 创建特性分支 (`git checkout -b feature/AmazingFeature`)
451
+ 3. 提交更改 (`git commit -m 'Add some AmazingFeature'`)
452
+ 4. 推送到分支 (`git push origin feature/AmazingFeature`)
453
+ 5. 创建 Pull Request
454
+
455
+ ## 📄 许可证
456
+
457
+ 本项目采用木兰宽松许可证 第2版 - 查看 [LICENSE](LICENSE) 文件了解详情。
458
+
459
+ ## ⚠️ 免责声明
460
+
461
+ 本工具提供的所有信息仅供参考,不构成投资建议。投资有风险,入市需谨慎。
462
+
463
+ ## 📞 联系方式
464
+
465
+ - 项目主页: https://github.com/chaofanat/aishare-txt
466
+ - 问题反馈: https://github.com/chaofanat/aishare-txt/issues
467
+ - 邮箱: chaofanat@gmail.com
468
+
469
+ ## 🙏 致谢
470
+
471
+ 感谢以下开源项目的支持:
472
+ - [akshare](https://github.com/akfamily/akshare) - 金融数据接口
473
+ - [TA-Lib](https://mrjbq7.github.io/ta-lib/) - 技术分析库
474
+ - [pandas](https://pandas.pydata.org/) - 数据分析库
475
+ - [numpy](http://www.numpy.org/) - 科学计算库
@@ -0,0 +1,25 @@
1
+ AIShareTxt/__init__.py,sha256=-Kxd58V6tMwhj7A-11Q5gOoJ1u2wA4anpTCTYVdJLtc,1414
2
+ AIShareTxt/ai/__init__.py,sha256=DxZeISk6icURNm-tFYfx_xvjWz7hHpEJxIsa9w5SXMI,167
3
+ AIShareTxt/ai/client.py,sha256=CTE6RjmgYvxJPhMMwn8HqXICPCHjFR0DJaJx3n9HYVY,11308
4
+ AIShareTxt/ai/providers/__init__.py,sha256=xTHQjb3D8uhzORRK0PLIAtMGQjBiOAB1Ku_W56KWopU,140
5
+ AIShareTxt/core/__init__.py,sha256=amDOtASzAiPWcFF7bpqUDcbrnMB9cvbi3yb4XGUVkzs,390
6
+ AIShareTxt/core/analyzer.py,sha256=tlqJY4OM4TNw0a9A9-64ykyKMcp-ziiDBZUzXYlolTw,17782
7
+ AIShareTxt/core/config.py,sha256=DW4nhm2Jt4CLZ2M5vKIfMg--tOl0QLBhF9WIM2ZCdtc,9810
8
+ AIShareTxt/core/data_fetcher.py,sha256=bemF-8tytTq-EkaAH7CyrTYqc3dPtKkDUjpgqe_UXOM,24057
9
+ AIShareTxt/core/report_generator.py,sha256=og7kVDnBs08uZ2_OL8AhIZwA1L5zJorm7zatx48WAnY,34131
10
+ AIShareTxt/docs/AI_INTEGRATION.md,sha256=StPi2dGco6zxbPhzGp2LdaoXppi-MsZ5_6eadbnqj3k,4614
11
+ AIShareTxt/docs/README_重构说明.md,sha256=H3vayHj7HFSYy7Zgk6iWZH5fW5ySN70edxPfOZGj9Lk,5865
12
+ AIShareTxt/docs/重构完成总结.md,sha256=nJSDmxluKZhp230SXYy8F8sGe6gmGX73OO6Hyj3qmuY,5262
13
+ AIShareTxt/examples/legacy_api.py,sha256=wDzmmKhp2hTmXrrxOwZue5IFaOAwqnkS3gD9ziWPnjQ,8095
14
+ AIShareTxt/indicators/__init__.py,sha256=480C4jgAWc6oEi1mOsijK96qk6rijz1tRN0XF0lcfVA,319
15
+ AIShareTxt/indicators/technical_indicators.py,sha256=by9QPBtvS7RZDxgTU-DJ_u3R6IaTqmgzT0FrwIM5xT0,20301
16
+ AIShareTxt/tests/__init__.py,sha256=MlKVJxxbjvhfSuwtqxm3oTCvuR4vKKAF2RnteIreMzI,227
17
+ AIShareTxt/utils/__init__.py,sha256=0uIK4zwLAskgc6gWaJb1jLLYBuymHS4cB_bTezRz0W0,324
18
+ AIShareTxt/utils/stock_list.py,sha256=6sQr5kCPySZ6zEApSf5xeYh3hWv0N9Rlhj2SmANZehM,12338
19
+ AIShareTxt/utils/utils.py,sha256=OkMJgWw4ljFiRftHMGvF-Mdxkufnpd8FfIigPfLuX5c,18048
20
+ aishare_txt-2025.11.6.13.dist-info/licenses/LICENSE,sha256=8NreXJM3ab-0PXXvuVF9QqDoXrglPouAZDdv3Vj-70U,9247
21
+ aishare_txt-2025.11.6.13.dist-info/METADATA,sha256=avzsATOkVWrHunldKhVomyJ2_tw2WTVIyTg8yW6rfgU,12793
22
+ aishare_txt-2025.11.6.13.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
23
+ aishare_txt-2025.11.6.13.dist-info/entry_points.txt,sha256=oBpEICBCJsNJi8FpvmswG1rqeRMNz6c2KmVhZyEqXts,58
24
+ aishare_txt-2025.11.6.13.dist-info/top_level.txt,sha256=xblaN5YdcyV6_Y9T9yFQgC7uettcJc8gKYCmw4UW9I4,11
25
+ aishare_txt-2025.11.6.13.dist-info/RECORD,,
@@ -0,0 +1,5 @@
1
+ Wheel-Version: 1.0
2
+ Generator: setuptools (80.9.0)
3
+ Root-Is-Purelib: true
4
+ Tag: py3-none-any
5
+
@@ -0,0 +1,2 @@
1
+ [console_scripts]
2
+ aishare = AIShareTxt.core.analyzer:main
@@ -0,0 +1,194 @@
1
+ 木兰宽松许可证,第2版
2
+
3
+ 木兰宽松许可证,第2版
4
+
5
+ 2020年1月 http://license.coscl.org.cn/MulanPSL2
6
+
7
+ 您对“软件”的复制、使用、修改及分发受木兰宽松许可证,第2版(“本许可证”)的如下条款的约束:
8
+
9
+ 0. 定义
10
+
11
+ “软件” 是指由“贡献”构成的许可在“本许可证”下的程序和相关文档的集合。
12
+
13
+ “贡献” 是指由任一“贡献者”许可在“本许可证”下的受版权法保护的作品。
14
+
15
+ “贡献者” 是指将受版权法保护的作品许可在“本许可证”下的自然人或“法人实体”。
16
+
17
+ “法人实体” 是指提交贡献的机构及其“关联实体”。
18
+
19
+ “关联实体” 是指,对“本许可证”下的行为方而言,控制、受控制或与其共同受控制的机构,此处的控制是
20
+ 指有受控方或共同受控方至少50%直接或间接的投票权、资金或其他有价证券。
21
+
22
+ 1. 授予版权许可
23
+
24
+ 每个“贡献者”根据“本许可证”授予您永久性的、全球性的、免费的、非独占的、不可撤销的版权许可,您可
25
+ 以复制、使用、修改、分发其“贡献”,不论修改与否。
26
+
27
+ 2. 授予专利许可
28
+
29
+ 每个“贡献者”根据“本许可证”授予您永久性的、全球性的、免费的、非独占的、不可撤销的(根据本条规定
30
+ 撤销除外)专利许可,供您制造、委托制造、使用、许诺销售、销售、进口其“贡献”或以其他方式转移其“贡
31
+ 献”。前述专利许可仅限于“贡献者”现在或将来拥有或控制的其“贡献”本身或其“贡献”与许可“贡献”时的“软
32
+ 件”结合而将必然会侵犯的专利权利要求,不包括对“贡献”的修改或包含“贡献”的其他结合。如果您或您的“
33
+ 关联实体”直接或间接地,就“软件”或其中的“贡献”对任何人发起专利侵权诉讼(包括反诉或交叉诉讼)或
34
+ 其他专利维权行动,指控其侵犯专利权,则“本许可证”授予您对“软件”的专利许可自您提起诉讼或发起维权
35
+ 行动之日终止。
36
+
37
+ 3. 无商标许可
38
+
39
+ “本许可证”不提供对“贡献者”的商品名称、商标、服务标志或产品名称的商标许可,但您为满足第4条规定
40
+ 的声明义务而必须使用除外。
41
+
42
+ 4. 分发限制
43
+
44
+ 您可以在任何媒介中将“软件”以源程序形式或可执行形式重新分发,不论修改与否,但您必须向接收者提供“
45
+ 本许可证”的副本,并保留“软件”中的版权、商标、专利及免责声明。
46
+
47
+ 5. 免责声明与责任限制
48
+
49
+ “软件”及其中的“贡献”在提供时不带任何明示或默示的担保。在任何情况下,“贡献者”或版权所有者不对
50
+ 任何人因使用“软件”或其中的“贡献”而引发的任何直接或间接损失承担责任,不论因何种原因导致或者基于
51
+ 何种法律理论,即使其曾被建议有此种损失的可能性。
52
+
53
+ 6. 语言
54
+
55
+ “本许可证”以中英文双语表述,中英文版本具有同等法律效力。如果中英文版本存在任何冲突不一致,以中文
56
+ 版为准。
57
+
58
+ 条款结束
59
+
60
+ 如何将木兰宽松许可证,第2版,应用到您的软件
61
+
62
+ 如果您希望将木兰宽松许可证,第2版,应用到您的新软件,为了方便接收者查阅,建议您完成如下三步:
63
+
64
+ 1, 请您补充如下声明中的空白,包括软件名、软件的首次发表年份以及您作为版权人的名字;
65
+
66
+ 2, 请您在软件包的一级目录下创建以“LICENSE”为名的文件,将整个许可证文本放入该文件中;
67
+
68
+ 3, 请将如下声明文本放入每个源文件的头部注释中。
69
+
70
+ Copyright (c) [Year] [name of copyright holder]
71
+ [Software Name] is licensed under Mulan PSL v2.
72
+ You can use this software according to the terms and conditions of the Mulan
73
+ PSL v2.
74
+ You may obtain a copy of Mulan PSL v2 at:
75
+ http://license.coscl.org.cn/MulanPSL2
76
+ THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY
77
+ KIND, EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO
78
+ NON-INFRINGEMENT, MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE.
79
+ See the Mulan PSL v2 for more details.
80
+
81
+ Mulan Permissive Software License,Version 2
82
+
83
+ Mulan Permissive Software License,Version 2 (Mulan PSL v2)
84
+
85
+ January 2020 http://license.coscl.org.cn/MulanPSL2
86
+
87
+ Your reproduction, use, modification and distribution of the Software shall
88
+ be subject to Mulan PSL v2 (this License) with the following terms and
89
+ conditions:
90
+
91
+ 0. Definition
92
+
93
+ Software means the program and related documents which are licensed under
94
+ this License and comprise all Contribution(s).
95
+
96
+ Contribution means the copyrightable work licensed by a particular
97
+ Contributor under this License.
98
+
99
+ Contributor means the Individual or Legal Entity who licenses its
100
+ copyrightable work under this License.
101
+
102
+ Legal Entity means the entity making a Contribution and all its
103
+ Affiliates.
104
+
105
+ Affiliates means entities that control, are controlled by, or are under
106
+ common control with the acting entity under this License, ‘control’ means
107
+ direct or indirect ownership of at least fifty percent (50%) of the voting
108
+ power, capital or other securities of controlled or commonly controlled
109
+ entity.
110
+
111
+ 1. Grant of Copyright License
112
+
113
+ Subject to the terms and conditions of this License, each Contributor hereby
114
+ grants to you a perpetual, worldwide, royalty-free, non-exclusive,
115
+ irrevocable copyright license to reproduce, use, modify, or distribute its
116
+ Contribution, with modification or not.
117
+
118
+ 2. Grant of Patent License
119
+
120
+ Subject to the terms and conditions of this License, each Contributor hereby
121
+ grants to you a perpetual, worldwide, royalty-free, non-exclusive,
122
+ irrevocable (except for revocation under this Section) patent license to
123
+ make, have made, use, offer for sale, sell, import or otherwise transfer its
124
+ Contribution, where such patent license is only limited to the patent claims
125
+ owned or controlled by such Contributor now or in future which will be
126
+ necessarily infringed by its Contribution alone, or by combination of the
127
+ Contribution with the Software to which the Contribution was contributed.
128
+ The patent license shall not apply to any modification of the Contribution,
129
+ and any other combination which includes the Contribution. If you or your
130
+ Affiliates directly or indirectly institute patent litigation (including a
131
+ cross claim or counterclaim in a litigation) or other patent enforcement
132
+ activities against any individual or entity by alleging that the Software or
133
+ any Contribution in it infringes patents, then any patent license granted to
134
+ you under this License for the Software shall terminate as of the date such
135
+ litigation or activity is filed or taken.
136
+
137
+ 3. No Trademark License
138
+
139
+ No trademark license is granted to use the trade names, trademarks, service
140
+ marks, or product names of Contributor, except as required to fulfill notice
141
+ requirements in section 4.
142
+
143
+ 4. Distribution Restriction
144
+
145
+ You may distribute the Software in any medium with or without modification,
146
+ whether in source or executable forms, provided that you provide recipients
147
+ with a copy of this License and retain copyright, patent, trademark and
148
+ disclaimer statements in the Software.
149
+
150
+ 5. Disclaimer of Warranty and Limitation of Liability
151
+
152
+ THE SOFTWARE AND CONTRIBUTION IN IT ARE PROVIDED WITHOUT WARRANTIES OF ANY
153
+ KIND, EITHER EXPRESS OR IMPLIED. IN NO EVENT SHALL ANY CONTRIBUTOR OR
154
+ COPYRIGHT HOLDER BE LIABLE TO YOU FOR ANY DAMAGES, INCLUDING, BUT NOT
155
+ LIMITED TO ANY DIRECT, OR INDIRECT, SPECIAL OR CONSEQUENTIAL DAMAGES ARISING
156
+ FROM YOUR USE OR INABILITY TO USE THE SOFTWARE OR THE CONTRIBUTION IN IT, NO
157
+ MATTER HOW IT’S CAUSED OR BASED ON WHICH LEGAL THEORY, EVEN IF ADVISED OF
158
+ THE POSSIBILITY OF SUCH DAMAGES.
159
+
160
+ 6. Language
161
+
162
+ THIS LICENSE IS WRITTEN IN BOTH CHINESE AND ENGLISH, AND THE CHINESE VERSION
163
+ AND ENGLISH VERSION SHALL HAVE THE SAME LEGAL EFFECT. IN THE CASE OF
164
+ DIVERGENCE BETWEEN THE CHINESE AND ENGLISH VERSIONS, THE CHINESE VERSION
165
+ SHALL PREVAIL.
166
+
167
+ END OF THE TERMS AND CONDITIONS
168
+
169
+ How to Apply the Mulan Permissive Software License,Version 2
170
+ (Mulan PSL v2) to Your Software
171
+
172
+ To apply the Mulan PSL v2 to your work, for easy identification by
173
+ recipients, you are suggested to complete following three steps:
174
+
175
+ i. Fill in the blanks in following statement, including insert your software
176
+ name, the year of the first publication of your software, and your name
177
+ identified as the copyright owner;
178
+
179
+ ii. Create a file named "LICENSE" which contains the whole context of this
180
+ License in the first directory of your software package;
181
+
182
+ iii. Attach the statement to the appropriate annotated syntax at the
183
+ beginning of each source file.
184
+
185
+ Copyright (c) [Year] [name of copyright holder]
186
+ [Software Name] is licensed under Mulan PSL v2.
187
+ You can use this software according to the terms and conditions of the Mulan
188
+ PSL v2.
189
+ You may obtain a copy of Mulan PSL v2 at:
190
+ http://license.coscl.org.cn/MulanPSL2
191
+ THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY
192
+ KIND, EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO
193
+ NON-INFRINGEMENT, MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE.
194
+ See the Mulan PSL v2 for more details.