semvec/pypi-packages huggingface dataset:
mod.io 0.6.0
mod.io python wrapper

# mod.io

![mod.io Logo](https://static.mod.io/v1/images/branding/modio-color-dark.png "https://mod.io")
[![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://opensource.org/licenses/MIT)


A wrapper for the mod.io API in Python. 
* [Docs](https://modio.readthedocs.io) 
* [Support](https://discord.gg/Hkq7X7n)


## Basic Examples
```py
import modio

client = modio.Client(api_key="your api key here", access_token="your o auth 2 token here")

game = client.get_game(345)
#gets the game with id 345

print(game.name)
#prints the name of the game

mod = game.get_mod(231)
#gets the mod for that game with id 231

```

## How to install
`pip install mod.io`

## Getting an OAuth 2 Access Token
To perform writes, you will need to authenticate your users via OAuth 2. To make this easy this library provides you with two functions to use in order to obtain your Access Token. You will need an API Key and an email adress to which you have access in order for this to work. Once you have both, follow the example below, you can either run this in a REPL or as a Python script. Don't forget to edit the script to add your own api key and email adress.

### Example
```py
import modio

client = modio.Client(api_key="your api key here")

#request a security code be sent at this email adress
client.email_request("necro@mordor.com")

#check your email for the security code
code = input("Code: ")

oauth2 = client.email_exchange(code)

#your oauth2 token is now stored in the variable

#to save into a file simply
with open("oauth2.txt", "w") as file:
    file.write(oauth2)

#and now the token is stored in oauth2.txt
```

## Unsupported Endpoints
Most `/external/` endpoints are unsupported as they are intended to be integrated directly into games which isn't
the scope of this wrapper. This wrapper is mainly for reading the site although it does have some support for 
editing and adding new stuff.

This also means that the Platform and Portal endpoints/headers are unsupported.
convert-trusted-gpg 1.0.0
Tool to convert apt trusted.gpg file into multiple trusted.gpg.d files
Requires Python: >=3.7

# convert-trusted-gpg

This tool read the [APT](https://en.wikipedia.org/wiki/APT_(software)) key store's single
file and creates multiple files, one for each key.

Doing this will prevent the deprecation warning when running `apt update`

> `W: https://example.com/ubuntu/dists/jammy/InRelease: Key is stored in legacy trusted.gpg keyring (/etc/apt/trusted.gpg), see the DEPRECATION section in apt-key(8) for details.`

The tool accomplishes this by 

1. Reading all the keys inside the `/etc/apt/trusted.gpg` file
2. For each key, if that key doesn't exist in its own file in `/etc/apt/trusted.gpg.d/`,
   the tool creates a new file in the `trusted.gpg.d` directory containing the key

The tool bases the new file's filename on the name and email address of the key.

The tool assumes that `apt` version `>=1.4` is installed which supports ASCII armored keys
with an `.asc` extension instead of binary keys with a `.gpg` extension.

## Usage

```shell
sudo convert-trusted-gpg
```

## Example output

```text
Skipping 1EDDE2CDFC025D17F6DA9EC0ADAE6AD28A8F901A as it already exists in /etc/apt/trusted.gpg.d/
Skipping 37C84554E7E0A261E4F76E1ED26E6ED000654A3E as it already exists in /etc/apt/trusted.gpg.d/
Creating /etc/apt/trusted.gpg.d/WineHQ_packages_wine-develwinehq.org.asc
Creating /etc/apt/trusted.gpg.d/NodeSource_gpgnodesource.com.asc
```