semvec/pypi-packages huggingface dataset:
loving-wiki 2021.10.30.0
两性情感知识库
Requires Python: >=3.6

# 两性情感知识库

> 协议：[CC BY-NC-SA 4.0](http://creativecommons.org/licenses/by-nc-sa/4.0/)
> 
> 那一年我们望着星空，未来的未来从没想过。当故事失去美梦，美梦失去线索，而我们失去联络。——五月天《星空》

* [在线阅读](https://lovwiki.apachecn.org)
* [在线阅读（Gitee）](https://apachecn.gitee.io/doc-template/)
* [ApacheCN 学习资源](http://docs.apachecn.org/)

## 贡献指南

本项目需要校对，欢迎大家提交 Pull Request。

> 请您勇敢地去翻译和改进翻译。虽然我们追求卓越，但我们并不要求您做到十全十美，因此请不要担心因为翻译上犯错——在大部分情况下，我们的服务器已经记录所有的翻译，因此您不必担心会因为您的失误遭到无法挽回的破坏。（改编自维基百科）

## 联系方式

### 负责人

* [片刻](https://github.com/jiangzhonglian): 529815144

### 其他

*   在我们的 [apachecn/loving-wiki](https://github.com/apachecn/loving-wiki) github 上提 issue.
*   发邮件到 Email: `apachecn@163.com`.
*   在我们的 [组织学习交流群](http://www.apachecn.org/organization/348.html) 中联系群主/管理员即可.

## 下载

### Docker

```
docker pull apachecn0/loving-wiki
docker run -tid -p <port>:80 apachecn0/loving-wiki
# 访问 http://localhost:{port} 查看文档
```

### PYPI

```
pip install loving-wiki
loving-wiki <port>
# 访问 http://localhost:{port} 查看文档
```

### NPM

```
npm install -g loving-wiki
loving-wiki <port>
# 访问 http://localhost:{port} 查看文档
```

## 赞助我们

![](http://data.apachecn.org/img/about/donate.jpg)
openweathermap-simplified 0.0.1
A simple, opinionated wrapper for the openweathermap.org API
Requires Python: >=3.6

# Basic Openweathermap API wrapper

## Why

This is an extremely simple wrapper around the Openweathermap OneCall API. It currently only supports forecasts. As it
is designed to be simple to use at the expense of features, the data is flattened from the nested structure to a single
dictionary for each forecast. In the process some data points are dropped.

Users that are interested in the complete set of data points are encouraged to open an issue or submit a pull request.

## Setup

1. Obtain an Openweathermap API key at [openweathermap.org](https://www.openweathermap.org/api)
2. Save the api key in a file '.api.txt' or the environment variable 'OPENWEATHERMAP_API_KEY'

## Usage

```python
from openweathermap import get_daily_forecast, APIError

try:
    forecast = get_daily_forecast(49.24966, -123.11934)  # Vancouver, BC, Canada
except APIError as e:
    # Deal with missing/incorrect API key or failed requests
    print(e)
```

Example return value for one day:
```json
{
  "dt": "2021-10-29T13:00:00",
  "sunrise": "2021-10-29T08:56:00",
  "sunset": "2021-10-29T18:56:09",
  "clouds": 28,
  "snow": None,
  "rain": None,
  "pop": 0.26,
  "wind_speed": 5.32,
  "wind_deg": 283,
  "wind_gust": 7.76,
  "humidity": 72,
  "temp_day": 282.15,
  "temp_morn": 281.22,
  "temp_eve": 280.99
}
```
mcdatahelper 1.0.0
A small minecraft tool
Requires Python: >=3.6

# MinecraftDataHelper

### 一个 `Minecraft` 数据包配方小工具

#### 使用 `pip install mcdatahelper` 来安装模块

### 样例代码

```
from MinecraftDataHelper import items, tags
from MinecraftDataHelper.Recipes import *

testGen = allRecipes('testGen')

testGen.CraftingShaped.pattern('ABA').pattern('AAA').pattern('ABA').key('A', items.APPLE).key('B', items.BOOK).result(items.SAND, 64).build('test1')
testGen.CraftingShapeless.ingredients(items.BIRCH_LOG).ingredients(items.BIRCH_LOG).result(items.BIRCH_BOAT).build('test2')
testGen.CraftingShapeless.ingredients(tags.LOGS).result(items.BROWN_DYE, 64).build('1111')
testGen.Smelting.ingredient(items.OAK_LEAVES).experience(0).cookingtime(100).result(items.OAK_LOG).build('test3')
testGen.Smithing.base(items.APPLE).addition(items.GOLD_BLOCK).result(items.GOLDEN_APPLE).build('test4')
testGen.Campfire.ingredient(items.BIRCH_LOG).result(items.BIRCH_BOAT).build('test5')
testGen.StoneCutting.ingredient(items.STONE).result(items.STONE_SLAB).count(2).build('test6')
testGen.Smoking.ingredient(items.OAK_LEAVES).experience(0).cookingtime(100).result(items.OAK_LOG).build('test7')
testGen.Blasting.ingredient(items.OAK_LEAVES).experience(0).cookingtime(100).result(items.OAK_LOG).build('test8')
```
catilo 0.2.6
Manage configuration files from multiple source in python
Requires Python: >=3.6

# catilo

Manage configuration files from multiple source in python. Create a variable directory for your configuration sources. 

Directories contain sources and each source has a priority. The lower the priority value, higher is the priority. When you retrieve a variables, it looks into all the sources and retrieve the one with the highest priority. For eg, 
you have added two source - 
* **source1** : json config file - contain default values - priority = 10
* **source2** : url - contains overrides -  priority = 5

It will look into source 2 first, if not found will search in source1 , if then not found will raise "UndefinedVariableException"

## Quickstart

Use `pip install catilo` to install Catilo 

Import the module at the start and define a variable directory. 
```python
from catilo.catilo import VariableDirectory
my_directory = VariableDirectory()
```

For simple dictionaries: 
```python
my_directory.add_source("fruitdetails",priority=5,dictionary={
    "fruit": "Apple",
    "size": "Large",
    "color": "Red"
})
value = my_directory.get("fruit") ## returns "Apple"
```

For yaml/json based files
```python
my_directory.add_file_source("configfile",priority=6,file="path/to/config.yaml")
my_directory.get("variable")
```

For URL's
```python
my_directory.add_url_source("sampleurl",3,"https://raw.githubusercontent.com/jptalukdar/catilo/master/tests/tests_data/json/sample1.json")
value = my_directory.get("fruit") ## returns "Apple"
```

For Environment variables
```python
my_directory.enable_environment_vars(prefix="CATILO_")
value = my_directory.get("CATILO_my_variable")

## If you don't want to strip the prefix during get, use `strip_prefix=True`
my_directory.enable_environment_vars(prefix="CATILO_",strip_prefix=True)
value = my_directory.get("my_variable")
```


## Features

1. Allows you to store multiple configuration files with priority value.
2. Support for the following sources
    1. python dictionaries 
    1. yaml files
    1. json files
    1. url (get method, json format)
    1. Environment variables
3. Ability to add custom sources
4. Stores config in flat_dictionary (can be overriden) for '.' notation access
5. Ability to add variables in runtime
    1. Add as default variable
    1. Add as normal variable
6. Output multiple sources into a single json or yaml file
botlog 1.0.1
A logging interface for Discord bots
Requires Python: >=3.6

# BotLog

BotLog is a logging interface module for Discord bots. It allows bot developers to log to Discord channels along with the standard terminal console, providing an easy way to track events and errors.

```bash
pip install botlog
```

## Logging Levels

The logging interface is designed to simulate the standard Python logging levels: `debug`, `info`, `warning`, and `error`. 

### Debug / Info / Warning

The first three levels by default do *not* send to Discord. However, setting `send=True` provides this.

```py
from discord.ext import commands
import botlog

token = ""
bot = commands.Bot(token)
logger = botlog.BotLogger(bot=bot, name="mybot")
logging_channel = 818657960038250216

@bot.command(name="echo")
async def echo(ctx, *, input: str):
    await logger.info("Executing echo command", send=True, channel=logging_channel)
    await ctx.send(content=input)
```

### Error

For errors, the default is to send to Discord along with a traceback. Note, `critical=True` will add a mention to the message, so the guild owner will be notified directly.

```py
@bot.command(name="run")
async def run(ctx):
    try:
        await some_function()
    except Exception as e:
        await logger.error(
            "Could not execute some_function!", 
            exception=e, 
            context=context, 
            channel=logging_channel, 
            critical=True
        )

    await ctx.send(content=input)
```

In addition to the logging, the logger will attempt to map `discord.ext.commands.CommandError` child exceptions to an appropriate user response. For instance, if a user doesn't provide an arg that is required, the logger can figure that out and tell the user with a message like "You did not provide the command argument: `user: discord.member.Member`"

### Event

Additionally, there is an `event` level for handling Discord events.

```py
async def on_member_update(before, after):
    await logger.event(
        "member_update", before=before, after=after, send=True, channel=logging_channel
    )
```

The logger has built-in rendering of Discord events like `member_update`, so it is useful to hook the logger to all these events (see: https://discordpy.readthedocs.io/en/latest/api.html#event-reference)

## Console

If you just want to log to the standard logging console, you can still reference it with the bot logger. This is useful because it is not an async method and can be used in synchronous code.

```py
def setup_bot_config(bot, logger):
    logger.console.debug("Loading bot config")
    # ...
```

## Log Queue

Sending to Discord naturally makes one afraid of being rate limited by the Discord API. Unlike in the previous examples where the logger handles events right away, you can provide a `queue_wait` input (in seconds) to the constructor to store events in an in-memory queue, picking them off one-by-one.

```py
logger = botlog.BotLogger(bot=bot, name="mybot", queue_wait=1)
```

This will auto-queue the messages without you having to do anything differently.
goto-label 0.1.2
A function decorator, that rewrites the bytecode, to enable goto in Python
Requires Python: >=3.9

# Installation
make sure you are using python 3.9

```
pip install -U goto-label
```

**NOTE: support for python >=3.10 is very unstable, please run the test before using.**

# Usage
a simple example:

```py
from goto import with_goto
from goto import goto, label  # optional, for linter purpose

@with_goto
def x():
    goto .end
    print("this will not print")
    label .end
    print("this will print")
```

- use `label .NAME` to define a label.
- use `goto .NAME` to goto into a label.

# Limitation
```py
@with_goto
def x():
    try:
        pass
    finally:
        label .a
```

here we define the label "a" once. but if you run the code:

```py
SyntaxError: ambiguous label name: 'a'. at line 10
```

it's not a bug, but why is it?

let's try to disassemble the code without modifying it:
```
  7           0 SETUP_FINALLY           10 (to 12)

  8           2 POP_BLOCK

 10           4 LOAD_GLOBAL              0 (label)
              6 LOAD_ATTR                1 (a)
              8 POP_TOP
             10 JUMP_FORWARD             8 (to 20)
        >>   12 LOAD_GLOBAL              0 (label)
             14 LOAD_ATTR                1 (a)
             16 POP_TOP
             18 RERAISE
        >>   20 LOAD_CONST               0 (None)
             22 RETURN_VALUE
```

because the `finally` block is copy pasted by python.\
look at the instructions, there are two definitions of label "a".

# Thanks
this project was inspired by [snoack/python-goto](https://github.com/snoack/python-goto) .\
since the project seems to have been discontinued, I created this.