semvec/pypi-packages huggingface dataset:
bubltools 2.2
Some tools I coded
Requires Python: >=3.6

# About
---

Here are some little tools I have come up with. I dont have much right now but you could add an "issue" on the github or email me and suggest a tool or inclusion I could try to add.
# Tools
## linebreak
Creates an empty line in the console/terminal
### Usage
`bubltools.linebreak(lines)`

lines is the amount of lines to get rid of (default is 1)
kirui 0.6.0
UI framework with React / Preact and Django SSR backend


**kirUI** is a framework for building user interfaces.

Issues
======
- Ha a modal nincs nyitva, de a szerver 200-as válasszal tér vissza, akkor a modal link egy csúnya hibát dob. Jó lenne figyelmeztetni a felhasználót, hogy a backenden 403-mmal kell visszatérni.
publish-to-zhihu 0.1.4
Publish markdown to Zhihu
Requires Python: >=3.7,<4.0

# Inconvenience

## 选择mdnice或zhihu格式
今天这个项目依赖mdnice来转化公式，但是从mdnice复制到知乎编辑器时，所有H1、H2、H3标题通通会被变成H1。mdnice没有做错，应该是知乎编辑器的问题。

所以，对于没有公式的文章，请不加"--mdnice" flag，直接上传生成的md到知乎。

对于有公式的文章，用上"--mdnice" flag。



# 功能
这个工具帮助将Obsidian风格的Markdown文件转化为mdnice的格式，主要有以下功能
- 自动上传本地图片到Azure blob storage
- 保证每个image link都在每行的最开始，没有额外的空格
- 自动为每个list item前面增加额外的回车，不然知乎不识别
- 转换Obsidian的图片链接`![[attachments/Pasted image 20230511181810.png]]`到知乎格式

想要转化为知乎格式，其实还需要下面几个工作，不过我们依赖mdnice来做下面的转换。
- 自动转换latex公式
# 安装
首先自行创造Azure storage account和blob container

设置环境变量IMAGEHOST_CONN_STR，这个变量要求包含形如`AccountName=(.*?);.*EndpointSuffix=(.*?)($|;)")`的信息

安装工具

```bash
pipx install publish-to-zhihu
```

如果过去安装过，可以用下面的命令升级
```
pipx upgrade publish-to-zhihu
```

# 日常使用

## 生成知乎格式的md文件并上传所有图片
假设你有多个md文件需要发布，下面是命令
```
# Convert standard Markdown file to Zhihu Format and upload all local images
zhihu_prepare_md --container container_name image_link_root output_folder md_file0 md_file1
```

其中
- container_name是Azure blob container的名字，假设为publishpic
- 本工具假设图像是相对路径，如`![[attachments/Pasted image 20230511181810.png]]`。假设在你硬盘上的真实路径是`C:\Cloud\OneDrive\note\attachments\Pasted image 20230511181810.png`，那么image_link_root就是`C:\Cloud\OneDrive\note`。
- output_folder是知乎格式md文件存放的目录。

所以，我自己发布`《曼昆经济学》成本笔记.md`时用的命令就是
```
zhihu_prepare_md --container publishpic c:\Cloud\OneDrive\note\ c:\Cloud\OneDrive\published_to_zhihu\  C:\Cloud\OneDrive\note\经济学\《曼昆经济学》成本笔记.md 
```
## 发布到知乎

发布
- 访问`c:\Cloud\OneDrive\published_to_zhihu\ `找到刚刚生成的文件
- 打开mdnice，把md文件拷贝进去。然后从mdnice拷贝出渲染好的适合知乎的内容
- 打开知乎，发表新文章，粘贴从mdnice得到的内容
- 保证知乎成功导入图片：知乎会从图床中导入图片，有的时候图片上传不成功，需要手工点击图片重试一次
- 手工填写标题
- 对于长文章，点击“目录”按钮来生成目录
- 如果需要投稿到问题，手工操作
- 手工选择标签
- 预览
- 发表

修改已发表的文章
- 点击文章的修改按钮或链接
- 清空文章的所有内容
- 粘贴从mdnice得到的内容
- 重新导入本地生成的md文件
- 保证知乎成功导入图片
- 预览
- 发表

# 进一步简化从Obisidan中发布文件的流程

安装Obsidian `Shell Commands`插件，增加一个下面的命令
```
zhihu_prepare_md --container publishpic c:\Cloud\OneDrive\note\ c:\Cloud\OneDrive\published_to_zhihu\  {{file_path:absolute}}
```

这样，在Obisidian中打开需要发布的文件，然后打开command palette，搜索"zhihu"命令运行就能够生成知乎格式的md文件了。


# Setup Dev Environment

First clone this repo then change to the repo directory.

Then run following command:
```sh
pip install poetry
poetry install   # Create virtual environement, install all dependencies for the project
poetry shell     # activate the virtual environment
pre-commit install    # to ensure automatically formatting, linting, type checking and testing before every commit
```

If you want to run unit test manually, just activate virtual environment and run:
```sh
pytest
```

# 本地开发流程

测试脚本是否正确
```bash
python -m publish_to_zhihu.prepare_md --container publishpic c:\Cloud\OneDrive\note\ c:\Cloud\OneDrive\published_to_zhihu\ C:\Cloud\OneDrive\note\经济学\《曼昆经济学》成本笔记.md 
```

发布到pipx
- bump version
- 发布
```
poetry publish --build --username %PYPI_USERNAME% --password %PYPI_PASSWORD%
```
- 本地升级最新版
```
pipx upgrade publish-to-zhihu
```



# Acknowledgement

- [搭建图床与自动上传 - 知乎 (zhihu.com)](https://zhuanlan.zhihu.com/p/258230175)
- [markdown公式转为知乎格式 - 知乎](https://zhuanlan.zhihu.com/p/87153002)
whackerhero 0.1.1
Generate Boomwhacker play-along videos from MIDI files
Requires Python: >=3.7
Keywords: boomwhacker video generator midi piano-roll

# Whacker Hero

Create play-along videos for [Boomwhackers](https://boomwhackers.com/).

![example animation of falling notes](https://user-images.githubusercontent.com/7693838/147457241-99963c9e-357b-468e-b7dd-2ec2b31da3c4.gif)

## Installation

    pip install "whackerhero[gui]"

`[gui]` is optional. It installs `gooey` which may take a while on Linux.
You have to do a pip-install in order to use the gui, it cannot be launched directly from python or the shell.

Other dependencies are `mido` for midi reading, `numpy` for graphics, and `moviepy` for video rendering.

## Usage

![screenshot of config window](https://user-images.githubusercontent.com/7693838/147457255-23bd71e7-ba8b-4ef2-99df-f19f9c7179ba.jpg)

If you've installed the gui, it's pretty straightforward.
The most work goes into writing a music arrangement suitable for playing along to (see the example below).
There are many midi files on the internet, but they can be big and messy.
You should trim it down to only one or two octaves.

The midi file will *only* be used for visuals. If you want it for audio too, you have to convert it manually.

There is also a command line variant:

    whackercmd -a music.mp3 -i background.jpg midifile.mid output.mp4

You can even create gif images for some reason.

    whackercmd -s 400x300 --fps 15 midifile.mid output.gif

Due to the single-core design of moviepy, rendering takes forever.
Use the `test` option to generate a 10 sec long video before you do your final rendering.

### Adding play-along to a music video

1. Download the music video and [extract](https://www.audacityteam.org/) the music.
1. Import the music into your [DAW](https://lmms.io) of choice. Don't add any silence at the beginning.
1. Write notes in sync with the music. What you hear is what you'll see.
   If you make all notes the same short length, things will look less cluttered in the final video.
1. Export to a midi file.
1. Run `whackerhero`
1. Select the midi file and the music video.
1. Check the `test` box and press start.
1. If everything looks good, uncheck `test` and run again.
airportfinder 1.0.0
Python library for airport lookup by IATA code or name
Requires Python: >=3.7

# airportfinder

airportfinder is a Python library that provides a simple interface for looking up airport information by IATA code or airport name. It uses a JSON dataset of airports worldwide to provide accurate and up-to-date information.

## Installation

You can install airportfinder using pip:

```python
pip install airportfinder


Usage

from airportfinder.airportfinder import Airports

# Create an instance of the Airports class
airports = Airports()

# Look up an airport by IATA code
airport = airports.airport_iata('LGA')
print(airport) # {'code': 'LGA', 'lat': '40.7731', 'lon': '-73.8756', 'name': 'LaGuardia Airport', 'city': 'Flushing', 'state': 'New York', 'country': 'United States', 'woeid': '12520509', 'tz': 'America/New_York', 'phone': '', 'type': 'Airports', 'email': '', 'url': '', 'runway_length': '7000', 'elev': '22', 'icao': 'KLGA', 'direct_flights': '82', 'carriers': '30'}

# Look up an airport by name
airport = airports.airport_name('LaGuardia Airport')
print(airport) # {'code': 'LGA', 'lat': '40.7731', 'lon': '-73.8756', 'name': 'LaGuardia Airport', 'city': 'Flushing', 'state': 'New York', 'country': 'United States', 'woeid': '12520509', 'tz': 'America/New_York', 'phone': '', 'type': 'Airports', 'email': '', 'url': '', 'runway_length': '7000', 'elev': '22', 'icao': 'KLGA', 'direct_flights': '82', 'carriers': '30'}
```

The airport_iata and airport_name methods return the airport object corresponding to the provided IATA code or name. If the airport is not found, it returns None.

Contributing
Contributions are welcome! If you have any suggestions, bug reports, or feature requests, please open an issue on the GitHub repository.

License
This project is licensed under the BSD 3-Clause License. See the LICENSE.txt file for details.

Acknowledgments
This project uses airport data provided by Thomas Reynolds's "Airports" gist on GitHub: 
https://gist.github.com/tdreyno/4278655

We would like to thank Thomas for his contributions to the open-source community and for making this data available to us.