semvec/pypi-packages huggingface dataset:
shittycorn 0.0.11
a shitty web server

# shittycorn
a very simple implementation of web server supporting WSGI compatible applications


# Usage
install the package
```shell
python3 -m pip install shittycorn
```

in `main.py`:
```python
import flask

app = flask.Flask(__name__)

@app.get('/')
def index():
    return 'Hello, World!'
```

run the wsgi application:
```shell
python3 -m shittycorn main.app
```
cdcdeaths 0.0.2
A package for visualizing the number of deaths by age groups
Requires Python: >=3.8

# cdcdeaths
[![Open in Code Ocean](https://codeocean.com/codeocean-assets/badge/open-in-code-ocean.svg)](https://codeocean.com/capsule/a32b3cd5-c35e-417e-a047-75fc0ad20bc3/tree)

DOI: https://doi.org/10.24433/CO.8698120.v1

cdcdeaths is a PyPI package for displaying the number of deaths in the US due to COVID-19 by age groups.
cdcdeaths can scrape the latest data from cdc.
result.png file will be generated.

# how to install cdcdeaths
On WSL on Windows, MacOS, and Linux operating systems, run the following command to install it:

$ pip install cdcdeaths

On Windows 11 or 10,

$ pip install cdcdeaths --force-reinstall --no-cache-dir --no-binary :all:

# how to run cdcdeaths

$ cdcdeaths

<img src='https://github.com/y-takefuji/cdcdeaths/raw/main/result.png' width=640 height=480>
ft-jwt 0.1.2
A Python implementation of JSON Web Tokens (JWT) for authentication and authorization using a symmetric secret key and HMAC-SHA256.
Requires Python: >=3.6

# JWT Authentication

A Python implementation of JSON Web Tokens (JWT) for authentication and authorization using a symmetric secret key and HMAC-SHA256.

## Changelog

### 0.1.2
  - updated timezone awareness

### 0.1.0
  - does not return the 'user_id' as additional argument anymore.
  - 'user_id' is now added to the request object.
  - changed 404 to 401 if token is missing and updated response messages.
### 0.0.20
  - returns JsonResponse with {'message': "string"} and the status-code

## Features

- Generate JWT tokens with customizable expiration times
- Validate JWT tokens and verify their integrity using a symmetric secret key and HMAC-SHA256
- Extract user information (such as user ID 'sub') from JWT tokens

## Installation

You can install the package via pip:

```pip install ft_jwt```

## Usage

```python
from ft_jwt.ft_jwt import FT_JWT

# Create a JWT instance with your secret key

secret_key = 'your_secret_key'
ftjwt = FT_JWT(secret_key)

# Generate a token for a user

sub = '1'
token = jwt.createToken(sub)

# Validate a token

is_valid, message = ftjwt.validateToken(token)
if is_valid:
    print('Token is valid')
else:
    print(f'Token is invalid: {message}')

# Get the user ID from a token

user_id = ftjwt.getUserId(token)
print(f'User ID: {sub}')

# Use the decorator to validate against a JWT for a protected route

@ftjwt.token_required
def protected_route():
    # This function will be executed only if the token is valid
    # ...
```

# Contributing
Contributions are welcome! Please open an issue or submit a pull request.

# License
This project is licensed under the MIT License.
mtc-cli 0.2.0
A simple CLI tool for moving enwp files to Commons
Requires Python: >=3.12

# mtc-cli
[![Python 3.12+](https://upload.wikimedia.org/wikipedia/commons/5/50/Blue_Python_3.12%2B_Shield_Badge.svg)](https://www.python.org)
[![MediaWiki 1.35+](https://upload.wikimedia.org/wikipedia/commons/b/b3/Blue_MediaWiki_1.35%2B_Shield_Badge.svg)](https://www.mediawiki.org/wiki/MediaWiki)
[![License: GPL v3](https://upload.wikimedia.org/wikipedia/commons/8/86/GPL_v3_Blue_Badge.svg)](https://www.gnu.org/licenses/gpl-3.0.en.html)

mtc-cli is a command line tool that helps simplify and automate file imports from Wikipedia to Commons.

This is the rewritten, spiritual successor to the original [MTC!](https://github.com/fastily/mtc) tool.

### Install
```bash
pip install mtc-cli
```

### Usage
```
usage: __main__.py [-h] [-u username] [-f] [-d] [-a api_endpoint] [titles ...]

mtc CLI

positional arguments:
  titles           Files, usernames, templates, or categories

options:
  -h, --help       show this help message and exit
  -u username      the username to use
  -f               Force (ignore filter) file transfer(s)
  -d               Activate dry run/debug mode (does not transfer files)
  -a api_endpoint  The default desc generation API endpoint to use. Defaults to public toolforge instance.
```

👉 Password is set via env variable `<USERNAME>_PW`, such that `<USERNAME>` is the username of the bot in all caps.
noaatsi 0.0.2
A package for displaying TSI graph based on NOAA
Requires Python: >=3.8

# noaatsi
[![Open in Code Ocean](https://codeocean.com/codeocean-assets/badge/open-in-code-ocean.svg)](https://codeocean.com/capsule/5710884/tree )

takefuji (2022) noaatsi: a PyPI for displaying TSI graph based on NOAA [Source Code]. https://doi.org/10.24433/CO.6916537.v1

This is under review.

noaatsi is a PyPI package application to scrape the updated data from NOAA on TSI and to display the TSI graph.
Data is stored in the following site which will be automatically scraped by noaatsi:

https://www.ncei.noaa.gov/data/total-solar-irradiance/access/yearly/tsi_v02r01_yearly_s1610_e2021_c20220202.nc

NOAA file is based on netCDF4.
In order to read .nc file, netCDF4 library is needed. To install it, run the following command.

$ pip install netCDF4

In order to install noaatsi, run the following command.

$ pip install noaatsi

To generate TSI file (tsi.csv) and the graph on the screen (tsi.png), run the following command.

$ noaatsi


noaatsi.png is finally generated.

<img src='https://github.com/y-takefuji/noaatsi/raw/main/noaatsi.png' height=300 width=900>
asyffmpeg 0.2.4
A library for asynchronous operation with FFmpeg, providing the ability to track events such as start, end, and encoding progress.

# AsyFFmpeg

AsyFFmpeg is a Python library for interacting asynchronously with FFmpeg to perform various operations on media files.

**Note**: When coding links, photos and more, the progress event will not work. _Progress is available only when encoding a local video file_

## Installation

To install AsyFFmpeg, run the following command:

```bash
pip install asyffmpeg
pip install -r requirements.txt --upgrade
```

## Usage
An example of how to use the library:
```python
import asyncio
from datetime import timedelta
from asyffmpeg import AsyFFmpeg

async def start(input:str, output:str):
    print(f'[start]: {input} -> {output}')

async def end(encoding_time:timedelta):
    print(f'[end]: {encoding_time}')

async def progress(progress:float, elapsed_time:timedelta, remaining_time:timedelta,
                   frame:int, is_finished:bool, bitrate:float):
    print(f'#{frame} | [{progress}] [{elapsed_time}] [{bitrate}]: [{remaining_time}] [?:{is_finished}]')


async def encode_video():
    ffmpeg = AsyFFmpeg(debug=False)
    ffmpeg.input("input.mp4")
    ffmpeg.output("output.mp4")
    ffmpeg.args({'vf': 'scale=1920:1080', 'codec:a': 'aac'})
    ffmpeg.on_event('start', start)
    ffmpeg.on_event('end', end)
    ffmpeg.on_event('progress', progress)
    await ffmpeg.run()

asyncio.run(encode_video())
```

## Features
* Asynchronous interface for interacting with FFmpeg.
* User-friendly API for controlling video and audio encoding.
* Support for various FFmpeg parameters and filters.
* Support for events such as `progress`, `start` and `end`.


## License
AsyFFmpeg is distributed under the MIT license.
jpscore 0.0.9
A package for scoring prefecture COVID-19 policies in Japan
Requires Python: >=3.8

# Scoring covid-19 policies by prefecture in Japan 
[![Open in Code Ocean](https://codeocean.com/codeocean-assets/badge/open-in-code-ocean.svg)](https://codeocean.com/capsule/2570c898-d60b-41ec-bd42-25d0a0629ba9/tree)

DOI: https://doi.org/10.24433/CO.2522268.v1

Y. Takefuji, "The Best and Sustainable COVID-19 Policy in the World," in IEEE Transactions on Computational Social Systems, doi: 10.1109/TCSS.2022.3227926.

Takefuji, Y. Policy analysis and data mining tools for controlling COVID-19 policies. Netw Model Anal Health Inform Bioinforma 12, 4 (2023). https://doi.org/10.1007/s13721-022-00400-3

# Since the NHK dataset is not updated, the following dataset will be used.

https://covid19.mhlw.go.jp/public/opendata/deaths_cumulative_daily.csv

or

https://covid19.mhlw.go.jp/public/opendata/number_of_deaths_daily.csv


# How to install jpscore
You need pandas and openpyxl library.

$ pip install pandas

$ pip install openpyxl

On WSL on Windows, MacOS, or Linux operating systems, run the following command:

$ pip install jpscore

On Windows 11 or 10

$ pip install jpscore --force-reinstall --no-cache-dir --no-binary :all:

The latest data on the number of deaths by prefecture in Japan is at the following site:

https://www3.nhk.or.jp/n-data/opendata/coronavirus/nhk_news_covid19_prefectures_daily_data.csv

# How to run jpscore
The result.csv will be generated by the following command:
as of march 19, 2022

$ jpscore

This is with after version 0.7 or 0.8.

<img src='https://github.com/y-takefuji/covid_score_japan/raw/main/jpscoreEN.jpg' width=397 height=1393>

This is with version 0.1~0.6.

<img src='https://github.com/y-takefuji/covid_score_japan/raw/main/result.png' width=397 height=1393>

# Exercises
<pre>
1. Make a csv file of the total deaths by prefecture using the latest data.
Hints:
Use pandas DataFrame.
Prefecture deaths population score
...

Find the latest date on the total deaths by prefecture in the csv file.
Make a list of prefectures.
Make the total deaths data by prefecture.
Find the latest population csv.
Make the latest population by prefecture.
Calculate a score by prefecture.
agci 0.0.2
how to debut a PyPI for chemistry
Requires Python: >=3.8

# agci
[![Open in Code Ocean](https://codeocean.com/codeocean-assets/badge/open-in-code-ocean.svg)](https://codeocean.com/capsule/9562303/tree)

takefuji (2022) agci for a reproducible PyPI application [Source Code]. https://doi.org/10.24433/CO.8712645.v1

Takefuji, Y. An Updated Tutorial on Reproducible PyPI Applications for Advancing Chemometrics and Boosting Learner Motivation. Chemometrics and Intelligent Laboratory Systems (2023).

This is a tutorial on how to debut a PyPI application and how to validate software reproducibility.
This agci is renamed and modified from "Symmetric GC integration.py" at https://github.com/1mikegrn/pyGC/blob/master/JCE-supplemental/Asymmetric%20GC%20integration.py
The modification is used to show how to debut a PyPI application and how to validate software reproducibility 
via Code Ocean.

# how to install agci

$ pip install agci

# how to run agci
The result picture will be saved in result.png.

$ agci "csv data filename"

$ agci Sample\ GC\ data\ 1\ pt\ acetone\ 1\ pt\ cyclohexane.csv

<img src='https://github.com/y-takefuji/agci/raw/main/result.png' width=640 hight=480>
vud4 0.0.4
comparing effects on mortality between bivalent booster, fully vaccinated and unvaccinated
Requires Python: >=3.8

# vud4
[![Open in Code Ocean](https://codeocean.com/codeocean-assets/badge/open-in-code-ocean.svg)](https://codeocean.com/capsule/1960114/tree)


Takefuji Y. Vaccine effects on COVID-19 infection with bivalent boosting by age group. Drug Resist Updat. 2023 Dec 27;73:101039. doi: 10.1016/j.drup.2023.101039. Epub ahead of print. PMID: 38169273.

vud4.py is to calculate the time-series effect of vaccination on mortality in six age groups (18-29 years, 30-49 years, 50-64 years, 65-79 years, 80+ years, and all ages) for three vaccination types: bivalent booster, fully vaccinated, and unvaccinated. The CDC dataset for the period October 1, 2021 through January 23, 2023 was used for this study:
https://data.cdc.gov/api/views/54ys-qyzm/rows.csv

vud4 is a PyPI application. PyPI allows vud4 to run on Windows, MacOS and Linux Operating Systems as long as Python is installed on the system.

# How to install vud4
$ pip install vud4

# How to run vud4
$ vud4

enter one of age groups: vud4 80+

18-29,30-49,50-64,65-79,80+,all_ages

$ vud4 80+

<img src='https://github.com/y-takefuji/vud4/raw/main/bivalent_80%2B.png' height=240 width=280>
mastercard-api-client 2.0.3
MasterCard API Python Core SDK, fork of the mastercard-api-core library.
Requires Python: >=3.8

# MasterCard API Core

MasterCard API Python Core SDK, fork of the [mastercard-api-core](https://pypi.org/project/mastercard-api-core/) library.

## Installation

```bash
pip install mastercard-api-client
```
milspend 0.0.5
A package for visualizing military spending of up to 4 countries
Requires Python: >=3.8

# defense
This is under review.

[![Open in Code Ocean](https://codeocean.com/codeocean-assets/badge/open-in-code-ocean.svg)](https://codeocean.com/capsule/a01e51d9-0f62-40c5-bc9e-b4c8b16b421e/tree)

DOI: https://doi.org/10.24433/CO.7896039.v1

This is under review.

The goal of this project is to visualize military spending of countries.

Using a SIPRI dataset, milspend can visualize military spending of up to four countries.

The SIPRI dataset is downloadable from:

https://sipri.org/sites/default/files/SIPRI-Milex-data-1949-2020_0.xlsx

or the latest dataset from:

https://www.sipri.org/sites/default/files/SIPRI-Milex-data-1949-2022.xlsx

The number of the vertical axis indicates the US dollars in millions.

<img src='https://github.com/y-takefuji/defense/raw/main/result.png' width=640 height=480>

# How to install milspend on Linux, MacOS, or WSL on Windows
You may need matplotlib library.

$ pip install matplotlib

$ pip install -U milspend


# How to install milspend if you have a trouble.
$ pip install milspend --force-reinstall --no-cache-dir --no-binary :all:

# How to run milspend
Milspend program allows user to specify up to four countries to plot military spending of the specified countries.
For example, the following command can display military spending of the US, China, Russia and Japan in the graph.

For 0.0.1 and 0.0.2 with 1949-2020 dataset: Seperate countries with spaces.

$ milspend USA China Russia Japan

<img src='https://github.com/y-takefuji/defense/raw/main/uscnrujp.png' height=480 width=640>
The following command can display military spending of Japan and South Korea.


For 0.0.3 with with 1949-2022: Enclose up to four countries in single quotes and separate them with colons.

$ milspend 'Japan:Korea, South'

<img src='https://github.com/y-takefuji/defense/raw/main/jpkr.png' height=480 width=640>