semvec/pypi-packages huggingface dataset:
GiGS-eBook 1.0
a python library to search free eBooks online using Library Genesis's database
Requires Python: >=3.6

# GiGS-eBook
a python library to search free eBooks online using [Library Genesis](https://en.wikipedia.org/wiki/Library_Genesis)'s database

# Installation
`pip3 install GiGS-eBook`

# TODO
* Better error handling

# USAGE
* import the class FetchData

    `from GiGS-eBook import FetchData`
* initialize an instance of `FetchData` with the query

    `output = FetchData('your_query')`
* now `output.data` should be filled with the returned info, use it to your needs. e.g.

    `print(output.data)`

    should provide you with:

    ```
    [
        {
            'title': 'dummy',
            'author': 'dummy, dummy2',
            'year': '0000',
            'publication': 'dummy',
            'pages': '0',
            'language': 'dummy',
            'size': '0 Bytes',
            'extention': 'none',
            'links': ['https://example.example',
                      'https://example2.example']
        },

        {
            'title': 'dummy',
            'author': 'dummy, dummy2',
            'year': '0000',
            'publication': 'dummy',
            'pages': '0',
            'language': 'dummy',
            'size': '0 Bytes',
            'extention': 'none',
            'links': ['https://example.example',
                      'https://example2.example']
        },

        .
        .
        .
    ]
    ```

    *Note that the output above is not JSON, It's just a list of dictionaries. The representation is just to make it readable.*


# NOTES
**I DO NOT RECOMMEND PIRACY OF ANY CREATION, BUY THE ORIGINAL COPIES TO SUPPORT THE AUTHOR. THIS CODE IS FOR EDUCATIONAL PURPOSES. FOR OTHER USES, YOU ARE RESPONSIBLE FOR WHAT YOU DO.**

# LICENSE
Licensed under MIT License

*Copyright (c) 2020 Gaurav Kumar Yadav*

Head over to the `LICENSE` for details
fakeproj 1.0
Mostly useless code to demonstrate Python DevOps tools
Requires Python: >=3.6

# fakeproj: DevOps for Dummies

![unit test](https://github.com/lazyoracle/fakeproj/workflows/Unit%20Testing/badge.svg)
![integration test](https://github.com/lazyoracle/fakeproj/workflows/Integration%20Testing/badge.svg)
![coverage](https://github.com/lazyoracle/fakeproj/workflows/Code%20Coverage/badge.svg)
[![codecov](https://codecov.io/gh/lazyoracle/fakeproj/branch/master/graph/badge.svg)](https://codecov.io/gh/lazyoracle/fakeproj)
![complexity test](https://github.com/lazyoracle/fakeproj/workflows/Code%20Complexity/badge.svg)
![build test](https://github.com/lazyoracle/fakeproj/workflows/Python%20package%20Build/badge.svg)
<a href="https://github.com/psf/black"><img alt="Code style: black" src="https://img.shields.io/badge/code%20style-black-000000.svg"></a>
[![Documentation Status](https://readthedocs.org/projects/fakeproj/badge/?version=latest)](https://fakeproj.readthedocs.io/en/latest/?badge=latest)

A dummy project to introduce various DevOps tools and Best Practices to Python developers. Follow along with the tutorial on [fakeproj.readthedocs.io](https://fakeproj.readthedocs.io)

## Installation

```bash
pip install .
```

### Developer Setup

```bash
pip install -r requirements.txt
```

### Testing

```bash
pytest -s -v --cov=fakeproj test/
```

There are markers for individual modules from the library, eg, 

```bash
pytest -v -m "goodmodule" --cov=fakeproj test/
```

### Benchmarks

Benchmarks can be run locally using `asv run`, followed by `asv publish` and `asv preview`.

The benchmarks are also available to view online at [here](https://lazyoracle.github.io/fakeproj/).

To update the online dashboard by pushing the latest benchmarks, use `asv gh-pages`

### Complexity

```bash
radon cc -a .
xenon --max-absolute B --max-modules B --max-average A .
```

### Docstrings

```bash
docstr-coverage .
```

### GitHub Actions

* Unit Testing (Python 3.6, 3.7, 3.8 on ubuntu:latest)
* Code Coverage
* Code Complexity (Maximum CC of B/B/A)
* Build Testing (Python 3.6, 3.7, 3.8 on {ubuntu, macos, windows}:latest)

### Code Formatting

This project uses [Black](https://black.readthedocs.io/en/stable/) for Code Formatting

## To-Do

- [ ] Populate Docs
cddns 0.1
支持多域名的ddns脚本

# CDDNS

支持Dnspod, 自动更新IP

## 开始使用

1. 安装 `pip install cddns` 或者 `clone https://github.com/chr233/pyddns`

2. 修改配置文件,填写域名和dnspod API token

    ```toml
    [dnspod]
    token = ''

    [[domains]]
    domain = 'chrxw.com'
    sub = 'test'
    ```

    完整配置参考[example.config.toml][0]

3. 运行 `python3 ddns.py`

    或者自己调用 `cddns.ddns`:

    ```python
    from cddns import ddns
    ddns('config.toml', 'ip.txt') # 自行修改配置文件路径
    ```

4. 建议使用 `corntab` 来定时运行

   例如每30分钟运行一次:

   ```txt
   */30 * * * * python3 /root/ddns/ddns.py > /dev/null 2>&1 &
   ```

5. 更新脚本方法: `pip3 install cddns --upgrade`

[0]: https://github.com/chr233/pyddns/blob/main/example.config.toml
datamodel 0.0.10
一个可以从 JSON 映射到 Python 类的模块。

# datamodel

datamodel 是一个可以从 JSON 映射到 Python 类的模块。

**支持：**

- [x] 字典转对象 ( `dict` → `object` )；
- [x] 列表转对象数组 ( `list` → `List[object]` )；
- [x] 对象转字典 ( `object` → `dict` )；
- [x] 对多层级嵌套的数据结构支持友好。

目前网上并没有一个比较好的 JSON to Model 库，就算有，其写法也大多繁琐。
由于做项目需要经常把从服务器上请求到的 JSON 转换到对应类的实例，决定自己写一个。

## 使用

**JSON 转类对象**

```python
"""
包括需要继承的 DataModel 类，dataclasses 模块中的 dataclass 装饰器；
以及 typing 模块中常用的 List 和 Dict 类型。
"""
from datamodel import dataclass, Datamodel

@dataclass
class Person(Datamodel):
    name: str = ''
    age: int = 0
    height: int = 0

p = Person.decoder({"name": "HjzCy",
                    "age": 18,
                    "height": 170
                    })
print(p)
# Person(name='HjzCy', age=18, height=170)
```

**类对象转 JSON**

```python
print(p.asdict())
# {'name': 'HjzCy', 'age': 18, 'height': 170}
```

**JSON 转类型实例列表**

```python
data = """[{
    "name": "HjzCy",
    "age": "18",
    "height": "170"
},
{
    "name": "YDMS",
    "age": "15",
    "height": "176"
}]"""
    
p_list = Person.decoder(data)
print(p_list)
# [Person(name='HjzCy', age=18, height=170), Person(name='YDMS', age=15, height=176)]
```

## Api

- **`decoder(cls, data: object)`**

  接收一个 `dict` 、`list` 或 `str` 值作为参数，返回 **对应类型的实例或实例列表**。
  支持自动类型转换。例如：

  ```python
  @dataclass
  class Ip(Datamodel):
      ip: str = ""
      port: int = 0
  
  # 注意: 被解析的 port 字段值是 str 型
  # Ip(ip='192.136.1.95', port=8080)
  print(Ip.decoder({"ip": "192.136.1.95", "port": "8080"}))
  ```

  **注意**：如果某些值不能自动转换到对应的类型，则保留默认值。例如：

  ```python
  # Ip(ip='192.136.1.95', port=0)
  print(Ip.decoder({"ip": "192.136.1.95", "port": "a1234"}))

- **`asdict()`**

  将类实例对象转换为对应字段的字典。

## 使用说明

1. **类必须经过 `@dataclass` 修饰**

    python 3.7 的新特性，为简单起见，约束所有类型必须使用。参阅 [理解 Python 的 Dataclasses](https://zhuanlan.zhihu.com/p/59657729)。
    
2. **必须为所有属性提供默认值 ( 可为 `None` )**

    暂时强制遵守。原因我要在 `decoder` 方法中实例化传进来的类，如果该类中包含只是定义而不初始化的字段时，就会报错。例如：
    ```python
    @dataclass
    class Person:
        name: str
        age: int
    ```
    该 `Person` 传到 `decoder` 方法中会报错！

3. **不会检测 `__init__` 中定义的属性**

    如果你已经使用了 `@dataclass` 修饰类，也许就没必要在定义一个 `__init__` 方法了。如果需要，请在 `__post_init_` 方法中执行初始化后要执行的额外操作。
zeroloader 0.1
A package to read 0archive's data from google drive to csv
Requires Python: >=3.6

ZeroLoader
==

ZeroLoader is a part of [0archive project](https://0archive.tw/). Its purpose is to read 0archive's public data from [google drive](https://drive.google.com/drive/u/1/folders/1ckDs03tdXhLdeF0N2St5OP0EeqxFC1bm) into csv format.

## Setup
 
1. Get google api credentials

    Follow Step 1 from [this tutorial](https://developers.google.com/drive/api/v3/quickstart/python).

2. Install the package

    ```shell script
    $ pip install -U git+ssh://git@github.com/disinfoRG/ZeroLoader.git
    ```

3. Create environment file

    ```shell script
    touch .env
    echo GDRIVE_PUBLIC_FILE_MAPPING_ID=1OwAGYg7dJob_VMW8vt2FP4fO5Ie7B3EW > .env
    ```

4. Load data

    You need the producer_id to successfully load. The id of each producer could be found from google drive folder name or from this [csv](https://drive.google.com/file/d/1JpHclJLrfRO1Yz5oiPdfacEWggUoGTes/view?usp=sharing).
    
    ```python
    import zeroloader as zl
 
    df = zl.load_data(:producer_id, :yyyy-mm, :path-to-gdrive-api-credentials)
   
    # e.g. Load 2020 June's data of storm.mg into a csv
    df = zl.load_data("5030bba7-81fe-11ea-8627-f23c92e71bad", "2020-06", "service.json") 
    ```