# easy_fossy
[![Snake fonts](https://see.fontimg.com/api/renderfont4/mLZ3a/eyJyIjoiZnMiLCJoIjoxNzEsInciOjI2MjUsImZzIjo2NSwiZmdjIjoiIzAwMDAwMCIsImJnYyI6IiNGRkZGRkYiLCJ0IjoxfQ/ZWFzeV9mb3NzeQ/terasong.png)](https://www.fontspace.com/category/snake) For Font credit Refer <1>
Accessing fossy api is made easier (requires python 3.10)
[Production Index Registry](https://pypi.org/project/easy-fossy/)
[Test Index Registry](https://test.pypi.org/project/easy-fossy/)
```
pip install easy-fossy
```
Requires
```
#### 1. python 3.10
```
(uses latest structural matching case patterms)
```
#### 2. pip install easy-fossy
```
```
#### 3. configure your server in config.ini
```
(config.ini file with below contents is essential & effortless kickstart)
```
[test]
url = http://fossology-test.com:port/repo/api/v1/
uname =
pwd =
access = write
bearer_token = Bearer OHNSUFaI6OtoFNz
token_valdity_days = 365
token_expire = 2022-10-29
reports_location = reports/
group_name = fossy
[prod]
url = http://fossology.com:port/repo/api/v1/
uname =
pwd =
access = write
bearer_token = Bearer OHNSUFaI6OtoFNz
token_valdity_days = 365
token_expire = 2022-10-29
reports_location = reports/
group_name = fossy
```
```
#### 4. Kickstart straight away with example.py
```
[example.py](https://github.com/dineshr93/easy_fossy/blob/master/example.py)
```
Useful functions to import and try
from easy_fossy import easy_fossy as fossy
To set the location of config.ini file and get the instance to access all the methos use below code
use_fossy_to=fossy('location/config.ini','test')
use_fossy_to=fossy('location/config.ini','prod')
1. use_fossy_to.delete_uploads_by_upload_id(upload_id=7)
2. use_fossy_to.trigger_analysis_for_git_upload_package(
git_url='https://github.com/dineshr93/pageres', branch_name='master', folder_id=1)
Avoids duplicate uploads
3. use_fossy_to.trigger_analysis_for_url_upload_package(
file_download_url='https://github.com/dineshr93/pageres/archive/refs/heads/master.zip',
file_name='pageres.zip', branch_name='', folder_id=1)
Avoids duplicate uploads
4. use_fossy_to.trigger_analysis_for_upload_package(
file_path='uploads/commons-lang3-3.12.0-src.zip', folder_id=1)
Avoids duplicate uploads
5. use_fossy_to.trigger_analysis_for_upload_id(
upload_id=4, folder_id=1)
6. use_fossy_to.get_upload_id_by_giturl_package_upload(git_url='https://github.com/dineshr93/pageres',
branch_name='master', upload_name='',
folder_id=1, upload_desc='', visibility=Public.public)
7. use_fossy_to.get_upload_id_by_download_url_package_upload(
file_download_url='https://github.com/dineshr93/pageres/archive/refs/heads/master.zip',
file_name='pageres', folder_id=1, upload_desc='commons-io-2.11.0', visibility=Public.public)
8. use_fossy_to.get_upload_id_by_local_package_upload(
file_path='uploads/commons-io-2.11.0-src.zip', folder_id=1, upload_desc='commons-io-2.11.0',
visibility=Public.public)
9. use_fossy_to.get_licenses_found_by_agents_for_uploadid
(upload_id=2, show_directories=True, agents=[
Agent.ninka.name, Agent.monk.name, Agent.nomos.name, Agent.ojo.name,
Agent.reportImport.name,
Agent.reso.name])
10. use_fossy_to.get_all_uploads_based_on(folder_id=1, is_recursive=True,
search_pattern_key='', upload_status=ClearingStatus.Open,
assignee='', since_yyyy_mm_dd='', page=1, limit=1000)
11. use_fossy_to.get_upload_summary_for_uploadid(upload_id=2)
12. use_fossy_to.apply_action_to_folderid(actions=Action.move, folder_id=6, parent_folder_id=2)
13. use_fossy_to.delete_folder_by_id(folder_id=3)
14. use_fossy_to.get_all_folders()
15. use_fossy_to.create_folder_under_parent_folder_id(
parent_folder_id=1, folder_name='test')
16. use_fossy_to.change_folder_name_or_desc(folder_id=3, new_folder_name='', new_folder_desc='')
17. use_fossy_to.get_folder_info_by_id(folder_id=11)
18. use_fossy_to.get_all_folders()
19. use_fossy_to.generate_and_get_desired_report_for_uploadid(upload_id=3, report_format=ReportFormat.unifiedreport)
20. use_fossy_to.get_job_info_by_id(job_id=3)
21. use_fossy_to.get_job_info_by_upload_id(job_id=3)
22. use_fossy_to.get_all_jobs()
From 1.0.6
23. use_fossy_to.get_all_license_based_on(is_active='true', license_kind=Kind.main, page=1, limit=1)
24. sns = use_fossy_to.get_all_license_short_names_based_on(
is_active='true', license_kind=Kind.main, contains_key='gp', page=1, limit=10000)
for i, sn in enumerate(sns, start=1):
print(f'{i}. {sn}')
From 1.0.9
25. use_fossy_to.get_license_by_short_name(short_name='AGPL-1.0')
26. use_fossy_to.add_new_license(unique_short_name='', new_full_name='', new_license_text='',
new_url='', new_risk=2, isCandidate=True, merge_request=False)
27. use_fossy_to.update_license_info_by_short_name(short_name='', new_full_name='', new_license_text='', new_url='', new_risk=2)
```
### =====================================================================
### License: MIT
```
MIT License
Copyright (c) 2021 Dinesh Ravi
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
```
<1>
Font by Tehisa by Sealoung
https://www.fontspace.com/category/snake
License: Personal Use Free
没有合适的资源?快使用搜索试试~ 我知道了~
温馨提示
共13个文件
txt:4个
py:3个
pkg-info:2个
资源分类:Python库 所属语言:Python 资源全名:easy_fossy-2.0.1.tar.gz 资源来源:官方 安装方法:https://lanzao.blog.csdn.net/article/details/101784059
资源推荐
资源详情
资源评论
收起资源包目录
easy_fossy-2.0.1.tar.gz (13个子文件)
easy_fossy-2.0.1
PKG-INFO 7KB
pyproject.toml 109B
LICENSE 1KB
src
easy_fossy
models.py 19KB
__init__.py 47KB
easy_fossy.egg-info
PKG-INFO 7KB
requires.txt 157B
SOURCES.txt 282B
top_level.txt 11B
dependency_links.txt 1B
setup.cfg 42B
setup.py 1KB
README.md 6KB
共 13 条
- 1
资源评论
挣扎的蓝藻
- 粉丝: 13w+
- 资源: 15万+
上传资源 快速赚钱
- 我的内容管理 展开
- 我的资源 快来上传第一个资源
- 我的收益 登录查看自己的收益
- 我的积分 登录查看自己的积分
- 我的C币 登录后查看C币余额
- 我的收藏
- 我的下载
- 下载帮助
安全验证
文档复制为VIP权益,开通VIP直接复制
信息提交成功