semvec/pypi-packages huggingface dataset:
violetSpider 1.1.3
新冠疫情数据爬取

# 功能介绍

​	支持全球疫情数据获取以及对应的国家、省份、城市数据获取

# 具体操作

```python
import violetSpider as spider
from violetSpider.core.model import Word, Nation, Province

# 1.获取全球数据
word: Word = spider.find_word()
print(word, type(word))
# <violetSpider.core.model.World object at 0x0000021DD6FC3AC8> <class 'violetSpider.core.model.World'>

# 2.获取对应数据
# 获取该对象上所有的存储数据的 Key，drop=True【默认删除值为 None 的 Key】
keys = word.keys(drop=True)
values = word.values(drop=True)
value = word.name
print(keys, values, value)
# dict_keys(['name', 'nowConfirm', 'confirm', 'heal', 'dead', 'lastUpdateTime']) 
# dict_values(['地球', 46987153, 217021468, 165524088, 4510227, '2021-10-20 13:43:34'])
# 地球
```

## 获取国家数据

```python
# 根据全球数据获取国家数据
# 如果不指定具体国家，会获取所有国家
# 所有数据对象都包含 keys() 和 values()
nations: list = word.searchNation('美国', '法国', '西班牙')
nation: Nation = nations[0]
print(nations)
print(nation.keys(), nation.values())

# [<violetSpider.core.model.Nation object at 0x000002245C37AD30>, 
# <violetSpider.core.model.Nation object at 0x000002245C37ACF8>, 
# <violetSpider.core.model.Nation object at 0x000002245C37AC88>]

# dict_keys(['name', 'continent', 'y', 'date', 'confirmAdd', 'confirmAddCut', 'confirm', 'suspect', 'dead', 'heal', 'nowConfirm', 'confirmCompare', 'nowConfirmCompare', 'healCompare', 'deadCompare']) 

# dict_values(['美国', '北美洲', '2021', '08.31', 0, 0, 39668541, 0, 654696, 30826478, 8187367, 0, 0, 0, 0])
```

## 获取某个国家下的省份数据

```python
# 先获取具体国家
nation: Nation = word.searchNation_one('美国')

# 获取指定省份，如果不指定则获取所有
provinces = nation.searchProvince()
for province in provinces[:3]:
    print(province.name)
    
# 加利福尼亚
# 德克萨斯
# 佛罗里达
```

## 获取省份下面的城市

```python
nation: Nation = word.searchNation_one('美国')
province: Province = nation.searchProvince_one('德克萨斯')

# 获取指定城市，如果不指定则获取所有
citys = province.searchCity()
for city in citys[:3]:
    print(city)
    
# 当然，有些省份是没有公布城市数据的
# violetSpider.core.error.WorldData: 很抱歉, 德克萨斯, 并未开放城市数据
```

```python
# 所有你可以这样写
# 不过别报太大希望，城市一般不会获取到数据
nation: Nation = word.searchNation_one('美国')
provinces = nation.searchProvince()

for province in provinces:
    try:
        c = province.searchCity()[:3]
        for city in c:
            print(city.name)
        print(province.name)
        break
    except Exception as e:
        print(e)
```

## 保存数据

```python
# 目前支持 mysql 和 csv 保持
# 具体 API 如下
import violetSpider as spider

spider.save_csv(
	path: str,   # 存储路径，必须
    data: list,   # 数据，装有 Nation、Province、City 对象的列表 
    fields=None,  # 存储指定，不指定则全选
    drop=True     # 是否删除空值字段
)

spider.save_mysql(
    username: str,
    password: str,
    host: str,
    port: int,
    databases: str,
    data: list,        # 数据，装有 Nation、Province、City 对象的列表 
    table=None,        # 是否指定表
    fields=None,       # 指定保存的字段
    drop=True          # 只要有一个字段的值为空, 那么便不保存这个字段
)
```
## 更新内容
```python
1.1.0 -> 基本功能实现
1.1.3 -> 修复了 china 数据无法获取
```
topsis-102003527 1.1.0
It evaluates alternatives based on multiple criteria using TOPSIS method


# TOPSIS

Author: **Aarushi Abrol**.

Type: **Package**.

Title: **TOPSIS method for multiple-criteria decision making (MCDM)**.

Version: **1.1.0**

Date: **2022-1-22**

Maintainer: **Aarushi Abrol <aabrol_be20@thapar.edu>**.

Description: **Evaluation of alternatives based on multiple criteria using TOPSIS method.**.

---

## What is TOPSIS?

**T**echnique for **O**rder **P**reference by **S**imilarity to **I**deal **S**olution
(TOPSIS) originated in the 1980s as a multi-criteria decision making method.
TOPSIS chooses the alternative of shortest Euclidean distance from the ideal solution,
and greatest distance from the negative-ideal solution.

<br>

## How to install this package:

```
>> pip install 
```

### In Command Prompt

```
>> topsis data.csv "1,1,1,1" "+,+,-,+" result.csv
```
## License
© 2022 Aarushi Abrol

This repository is licensed under the MIT license. See LICENSE for details.