semvec/pypi-packages huggingface dataset:
FOFA-py 2.0.3
Python library for FOFA (https://fofa.info)
License: MIT
Keywords: fofa,security,network

# FOFA SDK 使用说明

## 简介
  基于 [`FOFA API`](https://fofa.info/api) 编写的 `python` 版 `SDK`, 方便 `python` 开发者快速将 `FOFA` 集成到自己的项目中。

  [Api Documentation](https://fofapro.github.io/fofa-py/index.html)

## FOFA 命令行工具
  基于FOFA python SDK实现的简单命令行工具，用于简单的FOFA数据查询

## 安装
```shell
pip install fofa-py
```

## 用法

 显示所有支持的命令
```shell
fofa
```
### 设置fofa api key
  通过环境变量设置认证信息

| 环境变量Key  | Value                                                      |
|--------------|:----------------------------------------------------------:|
| `FOFA_EMAIL` | 用户登陆 `FOFA` 使用的 `Email`                             |
| `FOFA_KEY`   | 前往 [个人中心](https://fofa.info/userInfo) 查看 `API Key` |


### search
搜索子命令，从fofa搜索数据，

#### 搜索数据
搜索数据并展示结果
```shell
fofa search domain=bing.com --size 1000 -f ip,port,domain,title,certs_match,certs_expired
```

#### 统计搜索结果数量
```shell
fofa search domain=bing.com --count
382128
```

#### 查询聚合信息
```shell
fofa search domain=bing.com -f port,domain,protocol,title --stats --size 10
```

#### 保存结果数据
保存结果数据为csv或xls格式，示例:

```shell
# 保存数据为csv文件
fofa search domain=bing.com -f ip,port,domain,link,title,certs_match,certs_expired --size 50000 --save bing.csv

# 搜索证书匹配的数据
fofa search 'domain="bing.com" && cert.is_match=true' -f ip,port,domain,link,title,certs_match,certs_expired --size 50000 --save bing_cert_expired.xls
```

### host
查看一个域名或ip的host信息，示例

```shell
fofa host www.bing.com
{
    "asn": 59067,
    "category": [
        "其他企业应用"
    ],
    "consumed_fpoint": 0,
    "country_code": "CN",
    "country_name": "China",
    "domain": [
        "tuzhiji.com",
        "61.129.255.240:8080"
    ],
    "error": false,
    "host": "www.bing.com",
    "ip": "202.89.233.101",
    "org": "Microsoft Mobile Alliance Internet Services Co., Ltd",
    "port": [
        443,
        80,
        8080
    ],
    "product": [
        "Microsoft-RSA-TLS-CA",
        "Microsoft-RSA-TLS-CA-02"
    ],
    "protocol": [
        "https",
        "http"
    ],
    "required_fpoints": 0,
    "update_time": "2023-06-27 08:00:00"
}
```

### 代码使用sdk

``` python
# -*- coding: utf-8 -*-
import fofa

if __name__ == "__main__":
    email, key = ('test@test.com', 'xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx')  # 输入email和key
    client = fofa.Client(email, key)                # 将email和key传入fofa.Client类进行初始化和验证，并得到一个fofa client对象
    query_str = 'header="thinkphp" || header="think_template"'
    for page in range(1, 51):                       # 从第1页查到第50页
        fpoint = client.get_userinfo()["fofa_point"]      # 查询F点剩余数量
        if fpoint < 100:
            break                                   # 当F点小于100时，不再获取数据
        data = client.search(query_str, size=100, page=page, fields="ip,city")  # 查询第page页数据的ip和城市
        for ip, city in data["results"]:
            print "%s,%s" % (ip, city)              # 打印出每条数据的ip和城市

```


## 协议
`FOFA SDK` 遵循 `MIT` 协议，查看 [协议文件](https://opensource.org/licenses/mit)
fastapi-pagination-utilities 0.9.1
A module containing helpers for paginating responses with FastAPI
License: MIT

# FastAPI Pagination Utilities

This Python package contains utilities to aid in paginating responses from
FastAPI applications.

## Use

Install `fastapi-pagination-utilities` using pip:

```
pip install fastapi-pagination-utilities
```

The module can then be used as `fastapi_pagination`:

```python3
from fastapi import FastAPI
from fastapi_pagination import (
    CURSOR_QUERY, PAGE_SIZE_QUERY, PaginationDetails, PaginatedResults
)
from pydantic import BaseModel

app = FastAPI()

class Widget(BaseModel):
    name: str

@app.get(
    '/widgets',
    summary="List widgets",
    description="List all the widgers which are available."
    response_model=PaginatedResults[Widget]
)
def list_widgets(
        request: Request,
        cursor: Optional[str] = CURSOR_QUERY,
        page_size: Optional[int] = PAGE_SIZE_QUERY):

    # Get pagination.
    pagination = PaginationDetails(cursor, page_size)

    # list_widgets() should take a page size and offset and return a list of
    # results.
    results, has_more = list_widgets(pagination.offset, pagination.page_size)

    return PaginatedResults(
        next=(
            str(request.url.include_query_params(cursor=pagination.next_cursor()))
            if has_more else None
        ),
        previous=(
            str(request.url.include_query_params(cursor=pagination.previous_cursor()))
            if pagination.previous_cursor() else None
        ),
        results=results
    )
```

## Developer quickstart

This project contains a dockerized testing environment which wraps [tox](https://tox.readthedocs.io/en/latest/).

Tests can be run using the `./test.sh` command:

```bash
# Run all PyTest tests and Flake8 checks
$ ./test.sh

# Run just PyTest
$ ./test.sh -e py3

# Run a single test file within PyTest
$ ./test.sh -e py3 -- tests/test_identifiers.py

# Run a single test file within PyTest with verbose logging
$ ./test.sh -e py3 -- tests/test_identifiers.py -vvv
```
hcpsdk 0.9.5.post1
An SDK for the Hitachi Content Platform (HCP)
License: MIT
Keywords: hcp sdk Hitachi Content Platform

HCPsdk
======

HCPsdk provides a simple SDK to access an Hitachi Content Platform (HCP)
from Python3. It handles name resolution, multiple sessions spread across all
available HCP nodes, persistent connections and recovery from failing
connections.

It's that easy:

::

    >>> import hcpsdk

    >>> # initialize an *Authorization* object
    >>> auth = hcpsdk.NativeAuthorization('user', 'password')

    >>> # initialize a *Target* object
    >>> t = hcpsdk.Target("namespace.tenant.hcp.your.domain",
                          auth, port=443)

    >>> # initialize a Connection to the `Target``
    >>> c = hcpsdk.Connection(t)

    >>> # do something with the connection...
    >>> r = c.GET('/rest/your_file.txt')
    >>> c.response_status, c.response_reason
    (200, 'OK')
    >>> r.read()
    b'some data...'
    >>>
    >>> c.close()


Features
--------

- Handles HCP as a target object
- Connection objects, while tied to a target object, allow
  access to HCP through HCPs native http/REST dialect
- Higher level modules provide easy access to namespace
  statistics and some MAPI functionality, along with
  the ability to create unique object names / paths

Dependencies
------------

**hcpsdk** depends on `dnspython <http://www.dnspython.org>`_, which is used
for non-cached name resolution when bypassing the system's resolver.


Documentation
-------------

To be found at `readthedocs.org <http://hcpsdk.readthedocs.org>`_

Installation
------------

Install hcpsdk by running:

    ``pip install hcpsdk``


If you find any bugs, please let me know via the Issue Tracker;
if you have comments or suggestions, send an email to `<sw@snomis.de>`_

License
-------

The MIT License (MIT)

Copyright (c) 2014-2023 Thorsten Simons (sw@snomis.eu)

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.