semvec/pypi-packages huggingface dataset:
music-validator-micro 0.1.14
A media file tag checker tool, intended to work alone or fit into a larger toolchain
Requires Python: >=3.11.5

# MusicValidator

Application that provides a series of functions to inspect tag information from media files and validate their presence and correctness.

## Features

-   Define libraries by familiar name
-   Pulls all tags from supported media files
-   Stored in a SQLite DB for fast retrieval

# Requirements

-   Python 3+
-   MusicManagerMicro
-   MusicCheckerMicro

# Usage

```python
from music_validator_micro import MusicValidator as MV
library_name = "MY_MEDIA"
mv = MV(library_name)
report = mv.execute()
# Provides an object of tag properties and the file path that is
# missing them
'''
{
    'TALB':[
        '/media/music/pop/hit_me_baby.mp3'
    ]
    'TIT2':[
        '/media/music/pop/final_countdown.mp3'
    ]
}
'''
```

# Caching

You can safely remove the cache databases in `$HOME/$XDG_CACHE/MusicValidatorMicro/<library_name>`

# Testing

Run pytest in root directory passing in tests directory. Sample audio files are also contained within tests path

# Build

```python
python -m build
python -m twine upload dist/*
```
jsonsql 1.1.4
A way to accept SQL input with sanitization and parameterization with a json format
Requires Python: >=3.10

# JsonSQL

JsonSQL is a Python class that allows safe execution of SQL queries from untrusted JSON input. It validates the input against allowed queries, tables, columns etc. before constructing a safe SQL string.

## Usage

### Installing the package

```python
pip install jsonsql
```

### Full SQL String

Import the JsonSQL class:

```python
from jsonsql import JsonSQL
```

Initialize it by passing allowed queries, items, tables, connections and column types:

```python
allowed_queries = ["SELECT"]
allowed_items = ["*"] 
allowed_tables = ["users"]
allowed_connections = ["WHERE"]
allowed_columns = {"id": int, "name": str}

jsonsql = JsonSQL(allowed_queries, allowed_items, allowed_tables, allowed_connections, allowed_columns)
```

Pass a JSON request to sql_parse() to validate and construct the SQL:

```python
request = {
  "query": "SELECT", 
  "items": ["*"],
  "table": "users",
  "connection": "WHERE",
  "logic": {
    "id": {"=":123} 
  }
}

valid, sql, params = jsonsql.sql_parse(request)
```

The logic is validated against the allowed columns before constructing the final SQL string.

### Search Criteria for partial string

The logic_parse method can also be used independently to validate logic conditions without constructing a full SQL query. This allows reusing predefined or dynamically generated SQL strings while still validating any logic conditions passed from untrusted input.

For example:

```python
sql = "SELECT * FROM users WHERE"

logic = {
  "AND": [
     {"id": {"=":123}},
     {"name": {"=":"John"}}
  ]
}

valid, message, params = jsonsql.logic_parse(logic)

if valid:
  full_sql = f"{sql} ({message})"
  # execute full_sql with params
```

This validates the logic while allowing the SQL query itself to be predefined or constructed separately.

The logic_parse method will return False if the input logic is invalid. Otherwise it returns the parsed logic string and any bound parameters for safe interpolation into a SQL query.

All arguments to JsonSQL like allowed_queries, allowed_columns etc. are optional and can be empty lists or dicts if full validation of the SQL syntax is not needed.

### Current operations supported by the logic

```json
{
  "AND":[],
  "OR":[],
  {"variable":{"<, >, =, etc":"value"}},
  {"variable":{"BETWEEN":["value1","value2"]}},
  {"variable":{"IN":["value1","value2","..."]}}
}
```

values can also be valid variables such that `variable1 = variable2`

```json
{"variable":{"=":"othervariable"}}
```
mfdfa-toolkit 0.0.4
Multi-Fractal Detrended Fluctuation Analysis (MFDFA)

# Fractality and Long-Range Correlations
Fractality is a characteristic of a complex system in which self-similarity at different scales can be found. Fractality quantifies dynamically fluctuating variability of systems through multi-scale analyses and provides insights into underlying structures of objects under study. Probably the most widely used methods to analyze fractality and long-range correlations are Detrended Fluctuation Analysis (DFA; Peng et al., 1994) and Multi-Fractal Detrended Fluctuation Analysis (MFDFA; Kantelhardt et al., 2002), which is an extension of DFA. For further explanation, please refer to this medium [post](https://medium.com/@mohsenim/fractality-and-long-range-correlations-case-studies-and-insights-from-the-textual-domain-81810720c4d1) or [this](./MFDFA.md) Github page. 

This library implement MFDFA and provides also funtions for represent of results.

# Installation

You can install `mfdfa-toolkit` using `pip`:

```
pip install mfdfa-toolkit
```
or from the Github repository:
```
pip install git+https://github.com/mohsenim/Multifractality.git
```

# Using mfdfa-toolkit
To apply MFDFA to a series:

```python
from mfdfa_toolkit import MFDFA
import numpy as np

x = np.loadtxt('./examples/Henry-James_The-Golden-Bowl.txt')
result = MFDFA(x)
print(f"Degree of fractality: {result['H']:.2f}")
print(f"Degree of multifractality: {result['multifractality']:.2f}")
print(f"Goodness of fit(R2):{result['R2'].mean():.2f}")
```
Fluctuations, $F_q(s)$, can be visualized using `visualization`: 
```python
from mfdfa_toolkit import visualization
import matplotlib.pyplot as plt

fig, ax = plt.subplots(1)
visualization.plot_fluctuations(result, ax)
```
![visualization_fluctuations](./fig/fluctuations.png)


Similarly, the singularity spectrum can be visualized: 
```python
from mfdfa_toolkit import visualization
import matplotlib.pyplot as plt

fig, ax = plt.subplots(1)
visualization.plot_fluctuations(result, ax)
```
![visualization_singularity](./fig/singularity.png)


You can view [MFDFA.ipynb](https://github.com/mohsenim/Multifractality/blob/main/MFDFA.ipynb) for running the code step by step and seeing examples.

### References
*  Peng, C.-K., S. V. Buldyrev, S. Havlin, M. Simons, H. E. Stanley, and A. L. Goldberger (1994). “Mosaic organization of DNA nucleotides”. In: Physical Review E 49.2, pp. 1685–1689.
*  Kantelhardt, JanW., Stephan A. Zschiegner, Eva Koscielny-Bunde, Shlomo Havlin, Armin Bunde, and H.Eugene Stanley (2002). “Multifractal detrended fluctuation analysis of nonstationary time series”. In: Physica A: Statistical Mechanics and Its Applications 316.1, pp. 87–114.
* Mohseni, Mahdi,Volker Gast, and ChristophRedies (2021). “Fractality andVariability in Canonical and Non-Canonical English Fiction and in Non-Fictional Texts”. In: Frontiers in Psychology 12, p. 920.
sling-mac-universal 1.2.2
Sling Binary for Mac (AMD64 & ARM64)
Keywords: sling, etl, elt, extract, load

<p align="center"><img src="https://github.com/slingdata-io/sling-python/raw/main/logo-with-text.png" alt="logo" width="250"/></p>

<p align="center">Slings from a data source to a data target.</p>

## Installation

`pip install sling`

Then you should be able to run `sling --help` from command line.

## Running a Extract-Load Task

### CLI

```shell
sling run --src-conn MY_PG --src-stream myschema.mytable \
  --tgt-conn YOUR_SNOWFLAKE --tgt-object yourschema.yourtable \
  --mode full-refresh
```

Or passing a yaml/json string or file

```shell
sling run -c '
source:
  conn: MY_PG
  stream: myschema.mytable

target:
  conn: YOUR_SNOWFLAKE
  object: yourschema.yourtable

mode: full-refresh
'
# OR
sling run -c /path/to/config.json
```

### From Lib

```python
from sling import Sling

config = {
  'source': {
    'conn': 'MY_PG',
    'stream': "select * from my_table",
  },
  'target': {
    'conn':  "s3://my_bucket/my_folder/new_file.csv",
  },
}

Sling(**config).run()
```

## Config Schema

`--src-conn`/`source.conn` and `--tgt-conn`/`target.conn`  can be a name or URL of a folder:
- `MY_PG` (connection ref in db, profile or env)
- `postgresql://user:password!@host.loc:5432/database`
- `s3://my_bucket/my_folder/file.csv`
- `gs://my_google_bucket/my_folder/file.json`
- `file:///tmp/my_folder/file.csv` (local storage)

`--src-stream`/`source.stream` can be an object name to stream from:
- `TABLE1`
- `SCHEMA1.TABLE2`
- `OBJECT_NAME`
- `select * from SCHEMA1.TABLE3`
- `/path/to/file.sql` (if source conn is DB)

`--tgt-object`/`target.object` can be an object name to write to:
- `TABLE1`
- `SCHEMA1.TABLE2`

### Example as JSON

```json
{
  "source": {
    "conn": "MY_PG_URL",
    "stream": "select * from my_table",
    "options": {}
  },
  "target": {
    "conn": "s3://my_bucket/my_folder/new_file.csv",
    "options": {
      "header": false
    }
  }
}
```
music-checker-micro 0.2.16
A media file tag checker tool, intended to work alone or fit into a larger toolchain
Requires Python: >=3.11.5

# MusicChecker

Application that provides a series of functions to retrieve tag information from media files.

## Features

-   Define libraries by familiar name
-   Pulls all tags from supported media files
-   Stored in a SQLite DB for fast retrieval

# Requirements

Python 3+

# Usage

```python
from music_checker_micro import MusicChecker as MC
library = "my_library"
mc = MC(library)
result = mc.execute()
```

# Supported Formats

-   MP3
-   ~~FLAC~~

# Caching

Cached data is stored in the standard XDG directory

```txt
$HOME/$XDG_CACHE/MusicCheckerMicro/<library_name>
```

Usually /home/username/.cache/MusicChecker

# Testing

Run pytest in root directory passing in tests directory. Sample audio files are also contained within tests path

# TODO

-   dynamic placement of cache dir
-   update on mtime

# Build

```python
python -m build
python -m twine upload dist/*
```