semvec/pypi-packages huggingface dataset:
cptextract 0.1.1
A simple Python package to automate the extraction of CPT data
Keywords: geotechnical, cpt

# cptextract
---
A Python package to automate extraction of cone penetration test (CPT) data from various sources.

## Description
`cptextract` is a library of function and class to help extract Cone Penetration Test (CPT) data from csv and Excel files that are store inconsistenly. For example:
- cpt data with different data headers or labels
- cpt data stored in different Excel sheets names
- cpt data table not starting at the first row
- cpt data stored in units of kPa instead of MPa

### Limitations
This package has been developed based on example data found on the New Zealand Geotechnical Database. Some other limitations include:
- only extracts Depth, Cone tip resistance (qc), Friction resistance (fs) and U2 pore pressure (u2)
- only works with units of meter for depth; and MPa or kPa for qc,fs and u2
- accepted file types are .csv, .xls and .xlsx

### Installation
```bash
pip install cptextract
```

## Usage
Please refer to example [notebook](https://github.com/geocodes-eng/cptextract). 

## Contributors
TBC
pytest-ditto 0.1.2
Snapshot testing pytest plugin with minimal ceremony and flexible persistence formats.
Requires Python: >=3.10
Keywords: pytest, testing

# pytest-ditto
[![PyPI version](https://badge.fury.io/py/pytest-ditto.svg)](https://badge.fury.io/py/pytest-ditto)
[![Continuous Integration](https://github.com/owlowlyowl/pytest-ditto/actions/workflows/ci.yml/badge.svg)](https://github.com/owlowlyowl/pytest-ditto/actions/workflows/ci.yml)

Snapshot testing pytest plugin with minimal ceremony and flexible persistence formats.

## Introduction
The `pytest-ditto` plugin is intended to be used snapshot/regression testing. There are
two key components: the `snapshot` fixture and the snapshot persistence formats.

### The `snapshot` Fixture
In the following basic example, the function to test is `fn`, the test is using the
`snapshot` fixture and it is asserting that the result of calling the `fn` with the
value of `x` does not change. 


```python
import ditto


def fn(x: int) -> int:
    return x + 1  # original implementation
    # return x + 2  # new implementation


def test_fn(snapshot) -> None:
    x = 1
    result = fn(x)
    assert result == snapshot(result, key="fn")
```

The first time the test is run, the `snapshot` fixture takes the data passed to it and
persists it to a `.ditto` directory in the same location as the test module. Subsequent
test runs will load the file and use that value in the test to test the output of the
computed value.

By default, the snapshot data is converted and persisted using `pickle`; however, there
are a range of persistence formats that can be used.

### @ditto Marks
If the default persistence format, `pickle`, isn't appropriate different formats can be
specified per test by using `ditto` marks - customised `pytest` mark decorators.

The default persistence types are: `pickle`, `yaml` and `json`; however additional
plugins can be installed as per below:
- pandas via `pytest-ditto-pandas`


## Usage

### `pd.DataFrame`

```python
import pandas as pd

import ditto


def awesome_fn_to_test(df: pd.DataFrame):
    df.loc[:, "a"] *= 2
    return df


# The following test uses pandas.DataFrame.to_parquet to write the data snapshot to the
# `.ditto` directory with filename:
# `test_fn_with_parquet_dataframe_snapshot@ab_dataframe.pandas.parquet`.

@ditto.pandas.parquet
def test_fn_with_parquet_dataframe_snapshot(snapshot):
    input_data = pd.DataFrame({"a": [1, 2, 3], "b": [4, 5, 9]})
    result = awesome_fn_to_test(input_data)
    pd.testing.assert_frame_equal(result, snapshot(result, key="ab_dataframe"))


# The following test uses pandas.DataFrame.to_json(orient="table") to write the data
# snapshot to the `.ditto` directory with filename:
# `test_fn_with_json_dataframe_snapshot@ab_dataframe.pandas.json`.

@ditto.pandas.json
def test_fn_with_json_dataframe_snapshot(snapshot):
    input_data = pd.DataFrame({"a": [1, 2, 3], "b": [4, 5, 9]})
    result = awesome_fn_to_test(input_data)
    pd.testing.assert_frame_equal(result, snapshot(result, key="ab_dataframe"))
```
Sparkback 0.2.0
Sparklines Library
Requires Python: >=3.8.1

sparkback
=========

A Python library for generating sparklines.

## Installation

```
$ poetry install
$ poetry shell
$ bin/spark --help
```

## Usage
You can use sparkback from the command line or in your Python scripts.

## Command Line

Run sparkback with a series of numbers:

```
spark --ticks default 10 20 30 40 50
```


You can also use different styles of ticks:

```
spark --ticks block 10 20 30 40 50
spark --ticks ascii 10 20 30 40 50
spark --ticks numeric 10 20 30 40 50
spark --ticks braille 10 20 30 40 50
spark --ticks arrows 10 20 30 40 50
```

Use the --stats option to display statistics about your data:

```
spark --ticks default 10 20 30 40 50 --stats
```

## Python API

You can also use sparkback in your Python scripts:

```
import sparkback

data = [10, 20, 30, 40, 50]
ticks = sparkback.scale_data(data, sparkback.TICKS_OPTIONS["default"])
sparkback.print_ansi_spark(ticks)
```

## See also:

* https://github.com/ajacksified/Clark/
* https://github.com/holman/spark
lapa-database-helper 0.0.7
helper to access the database layer for my personal server.

# lapa_database_helper

## about

helper to access the database layer for my personal server.

## installation

> pip install lapa_database_helper

## usage

[reference python file](./example.py)

## env

- python>=3.12.0

## changelog

### v0.0.7

- update example.py

### v0.0.6

- remove config file and reconfigure variables as class parameters.
- import class to init file

### v0.0.5

- Configuration is now being read with the help of lapa_commons.

### v0.0.4

- change default value of ignore_filters_and_get_all to False.

### v0.0.3

- add extra parameters for ignore_filter_and_x_all.

### v0.0.2

- rename to lapa.

### v0.0.1

- initial implementation.

## Feedback is appreciated. Thank you!
data-sanitizer 0.3.0
Data-Sanitizer is a comprehensive Python package designed to streamline the process of cleaning and preprocessing tabular data using pandas. Whether you are dealing with missing values, duplicates, outliers, or need to encode categorical variables and scale numerical features, DataSanitizer provides a suite of easy-to-use tools to prepare your data for analysis and machine learning.
Requires Python: >=3.6

data-sanitizer
data-sanitizer is a comprehensive Python package designed to streamline the process of cleaning and preprocessing tabular data using pandas. Whether you're dealing with missing values, duplicates, outliers, or need to encode categorical variables and scale numerical features, DataSanitizer provides a suite of easy-to-use tools to prepare your data for analysis and machine learning.

Features
1. Handle Missing Values: Easily fill missing values with mean, median, mode, or drop them entirely.
2. Remove Duplicates: Effortlessly identify and remove duplicate rows from your dataset.
3. Remove Outliers: Detect and remove outliers using Interquartile Range (IQR) or Z-score methods.
4. Convert Data Types: Seamlessly convert data types of specified columns to ensure consistency.
5. Encode Categorical Variables: Perform one-hot encoding on categorical features to prepare them for machine learning models.
6. Scale Numerical Features: Standardize or normalize numerical features to improve the performance of your algorithms.

Installation
Install DataSanitizer easily using pip: pip install data-sanitizer

Usage

data-sanitizer integrates smoothly with pandas DataFrames, making it intuitive for users familiar with pandas.

Example

import pandas as pd
from data-sanitizer import handle_missing_values, remove_duplicates, remove_outliers, convert_types, encode_categorical, scale_features

# Sample DataFrame
df = pd.DataFrame({
    'A': [1, 2, None, 4],
    'B': [None, 2, 3, 4],
    'C': ['cat', 'dog', 'cat', 'mouse'],
    'D': [10, 20, 30, 1000]
})

# Handling missing values
df = handle_missing_values(df, strategy='mean')

# Removing duplicates
df = remove_duplicates(df)

# Removing outliers
df = remove_outliers(df, columns=['D'], method='IQR')

# Converting data types
df = convert_types(df, columns=['A'], dtypes=[float])

# Encoding categorical variables
df = encode_categorical(df, columns=['C'])

# Scaling numerical features
df = scale_features(df, columns=['D'], strategy='standard')

print(df)

Contributing
We welcome contributions to improve Data-Sanitizer.

Contact
For any questions or issues, please contact the package maintainer at goradbj@gmail.com