semvec/pypi-packages huggingface dataset:
redirects_cli 0.1.3
Generates static redirections from a YAML file.
Requires Python: >=3.7

# redirects-cli

A CLI to create static redirections from a YAML file.

## Why?

You are relying on GitHub Pages to host your site. However, whenever you move a page from one folder to another, your users get the 404 page.

With `redirects-cli`, you can define 301 redirects for the pages you have moved in a YAML file. Then, you can generate static redirects for each page with one command.

In my case, I use this CLI tool in the project's CI pipelines before publishing the site to the `gh-pages` branch.

## Getting started

### Requirements

* Python >= 3.7
* pip

### Installation

```
pip install redirects_cli
```

### Quickstart

```
redirects-cli --help
```

## Usage

### Generate redirects from a static file

To generate static redirects from a YAML file:

1. Define the redirects in a new file named `redirects.yaml`. This file must follow this syntax:

    ```
    # old_path: new_path
    # Example

    # internal link example
    /original-path/page-a.html: /new-path/page-a.html

    # external link example
    /original-path/page-b.html: https://example.local
    ```

2. Run the command:

    ```
    redirects-cli fromfile --yaml-file redirects.yaml --output-dir html
    ```

    The CLI creates the static redirects you have defined in the `redirects.yaml` file within the folder `html`.
    For this example, it creates the following folder structure:

    ```
    my-project/
    ├─ html/
    │  ├─ original-path/page-a.html
    │  ├─ original-path/page-b.html
    ├─ redirects.yaml
    ```

### Create a single redirect

To create a single redirect, you can run the command:

```
redirects-cli --output-file index.html  --redirect-to https://davidgarcia.dev
```

This command creates a 301 redirect to `https://davidgarcia.dev`in the file `index.html`.

## Contributing

Contributions are welcome and appreciated!
If you want to enhance the CLI, please read [CONTRIBUTING.md](CONTRIBUTING.md) file first.

## License

Copyright (c) 2022-present David Garcia ([@dgarcia360](https://davidgarcia.dev)). Licensed under the [MIT License](LICENSE.md).
dmt-htwk 1.0.0
Eine IPython-Erweiterung, welche die Verbidung zum Assessment-System DMT ermöglicht und Aufgaben dynamisch im Notebook erstellt.
Requires Python: >=3.9

# DMT-HTWK
## Eine IPython-Erweiterung zur Verbindung mit dem E-Assessment-Tool DMT (Data Management Tester)

Diese Erweiterung ermöglicht es Aufgaben aus dem E-Assessment-Tool DMT abzufragen und dynamisch im Notebook darzustellen.
Ebenso können die Eingaben und Lösungen an DMT gesendet werden, um ein automtatisches Feedback zu erhalten.

## %dmtCon

Dieser Befehl ermöglicht es die URL von DMT zu hinterlegen (z.B.: "%dmtCon http://localhost:8081")

## %dmt

Dieser Befehl fragt die Aufgaben-Attribute per REST-Request über eine gültige TaskID von DMT ab und erstellt abhängig vom TaskType ein dynamisches UI.
(z.B.: "%dmt modell:1") 
Druch einen Klick auf den generierten Button "Abgabe Überprüfen", werden alle UI-Felder ausgelesen und als Antwort an DMT geschickt.
Das Feedback, ob die Lösung richtig oder flasch ist, sowie die erhaltenen Punkte werden unter dem Button angezeigt.

## Nutzung

Nach der Installation sind folgende Schritte für die Nutzung nötig:
- %load_ext dmt_htwk
- %dmtCon + Basispfad der DMT-URL

Da nun das Package geladen, sowie eine URL hinterlegt ist, können sie mit der Nutzung von DMT beginnen.
Dazu schreiben sie folgenden Befehl in eine neue Cell:
- %dmt + gewünschte TaskID

Wenn alles geklappt hat, sollten sie nun die ensprechende Aufgabe aus DMT in ihrem Notebook bearbeiten können.
externc 1.1.1
Inline C function declarations

# ExternC - Embedding C code in python

## Example

```py
import externc

# ExternC modifies builtins, so no `externc.` necessary
fn = c("""
  // remember to properly escape backslashes!
  printf("Hello from C\\n");
  Py_RETURN_NONE;
""")

fn() # "Hello from C"
```

## Benchmark

`c.py`:
```c
import externc
c(r"""
for(int i = 0; i < 1000000000; i++) {
  if(i % (2 << 16) == 0) {
    printf("%d\n", i);
  }
}
Py_RETURN_NONE;
""")()
```
`python.py`:
```py
for i in range(1000000000):
  if(i % (2 << 16) == 0):
    print(i)
```

```sh
$ time python c.py
...

real    0m2.615s
user    0m1.593s
sys     0m0.518s
```

```sh
$ time python python.py
...

real    3m25.695s
user    3m25.423s
sys     0m0.194s
```

The difference is quite obvious

## Use cases

Use ExternC
* for interfacing with C APIs
* for working with raw pointers
* for working with capsules
* when speed is more important than stability

**Do not** use ExternC
* when your code must be version independent
* when your code must be stable (exception: you have used C a lot before)
* when your code must be distributable
* when your code must run anywhere but the PC you wrote and tested it on
* in production

## Technicalities

The C function is registered as `METH_VARARGS | METH_KEYWORDS`.
It is of signature `PyObject* (PyObject*, PyObject*, PyObject)`,
which is known in the Python extension environment as `PyCFunctionWithKeywords`.
The arguments have the names `self`, `args` and `kwargs`, while
the function is named `func` and the generated module `externc_#` where
`#` is a hexadecimal number that is incremented by one with
every call to `c` without an explicit module name.
The function name and the module name
can be modified by passing the `funcname` and `name`
keyword arguments to `c`, respectively. `funcname` is also used as the
name of the function to be exported from the module.

The default compiler used is `clang` with a few default
options. The `compilers` submodule can be used to configure `clang`
with feature flags, linked files and additional include directories or
define another compiler, which can be passed to `c` via the `compiler`
argument.
pyscolortype 1.2.3
just another mod to print strings in 256 colors in the terminal.

# string-color   
   
string-color is just another python module for coloring strings in print statements.   
   
### Installation   
   
`$ pip install string-color`   
   
### Python Module Usage   
   
```python   
from pyscolortype import * 
   
# a few examples without background colors.   
# for color names see CLI usage below.   
print(cs("here we go", "orchid"))   
print(cs("away to space!", "DeepPink3"))   
print(cs("final fantasy", "#ffff87"))   
print()  

# bold and underline also available.  
print(cs("purple number 4, bold", "purple4").bold())  
print(cs("blue, underlined", "blue").underline())  
print(bold("bold AND underlined!").underline().cs("red", "gold"))
print(underline("the bottom line."))
print()

# yellow text with a red background.   
# color names, hex values, and ansi numbers will work.   
print(cs("warning!", "yellow", "#ff0000")) 
print()

# concat
print(cs("wild", "pink")+" stuff")
print("nothing "+cs("something", "DarkViolet2", "lightgrey6"))
print()

# use any working rgb or hex values.
# it will find the closest color available.
print(cs("this will show up red", "#ff0009"))
print(cs("so will this", "rgb(254, 0, 1)"))
print()

# use with format and f-strings
print(f"this is a test {cs('to check formatting with f-strings', 'yellow', 'grey').bold().underline()}")
print("this is a test {}".format(cs('to check the format function', 'purple', 'lightgrey11').bold().underline()))
```   
  
![Usage Screep Cap][screencap]

[screencap]: https://believe-it-or-not-im-walking-on-air.s3.amazonaws.com/sc-screen-cap.jpg "Usage Screen Cap"
  
### CLI Usage     
   
```
usage: string-color [-h] [-x] [-r] [-t] [--hsl] [-a] [-i] [-v] [color]

just another mod for printing strings in color.

positional arguments:
  color          show info for a specific color:
                 $ string-color red
                 $ string-color '#ffff87'
                 $ string-color *grey* # wildcards acceptable
                 $ string-color '#E16A7F' # any hex not found will return the closest match

optional arguments:
  -h, --help     show this help message and exit
  -x, --hex      show hex values
  -r, --rgb      show rgb values
  -t, --term     show term numbers
  --hsl          show hsl values
  -a, --alpha    sort by name
  -i, --inverse  show inverse colors
  -v, --version  show program's version number and exit
```  
  
`$ string-color`   
   
display a list of all 256 colors   
   
`$ string-color yellow`   
   
show color info for the color yellow   
   
`$ string-color "#ff0000"`   
   
show color info for the hex value #ff0000   
   
`$ string-color *grey*`  
  
show all colors with "grey" in the name. also works with "grey\*" and "\*grey"  
  
![CLI Screep Cap][cliscreencap]  
  
[cliscreencap]: https://believe-it-or-not-im-walking-on-air.s3.amazonaws.com/sc-screen-cap2.jpg  "CLI Screen Cap"
multireplace 0.0.2
Method for multi replace in strings

# multireplace
### Method for multi replace in strings


Method for replacing specified characters in a string with new characters.
        Single replacement and new characters are objects that are
        single words, parts of words, letters, special characters,
        or combinations thereof, enclosed in string literals.


        There are three ways to specify replacement and new characters:
        1)  Replaced and new characters are grouped into lists or tuples of the same length.
            In this case, each character being replaced is changed to
            a new character located in the same place (having the same index).

        2)  One replacement character and one new character specified.

        3)  One new character and multiple replacement characters are specified,
            grouped into a list or tuple.
            In this case, each character being replaced is changed to the same new character.

        When setting parameters in other ways than the above three, an valueError exception is thrown.
        All values contained in the replacement_sumbols and new_sumbols will be converted to strings.

____

### Installation

For installation:

`pip install multireplace`

____

### Sample using

1) To use, you need to create object `NewString`.
2) For the received object, use the method `multireplace`.
The method returns a new string, but does not edit the original string.
To save a new string, you must assign the result of the method execution to a variable.
3) After multiple replace, you can use all original methods for string.

```Python

from multireplace import multireplace

same_str = multireplace.NewString("I'll be back").multireplace(replacement_sumbols=['I', "'", 'll', 'k'],
                                                  new_sumbols=['We', ' ', 'will', 'k!'])
```

You can also use the method `multireplace` to remove multiple characters from a string. 
To do this, specify the characters to be removed in the parameter `replacement_sumbols`

```Python

from multireplace import multireplace

same_str = multireplace.NewString("I'll be back").multireplace(replacement_sumbols=[' ', 'be', 'back'])
```