Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 5 additions & 5 deletions .github/workflows/pre-commit.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,8 @@ jobs:
- name: Install uv
uses: astral-sh/setup-uv@v5
with:
version: "0.6.17"
- name: Install dependencies
run: |
uv sync --group dev
- uses: pre-commit/action@v3.0.1
version: "0.9.5"
- name: Install dependencies (including dev)
run: uv sync --group dev
- name: Run pre-commit
run: uv run pre-commit run --all-files
23 changes: 0 additions & 23 deletions .github/workflows/pytest.yml

This file was deleted.

14 changes: 8 additions & 6 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -13,12 +13,6 @@ repos:
- id: isort
args:
- --line-length=79
- repo: https://github.com/pre-commit/mirrors-mypy
rev: v1.15.0
hooks:
- id: mypy
args: [--show-error-codes]
additional_dependencies: [types-requests, types-python-dateutil, types-waitress, types-PyYAML, pandas-stubs, types-setuptools]
- repo: https://github.com/macisamuele/language-formatters-pre-commit-hooks
rev: v2.14.0
hooks:
Expand All @@ -42,3 +36,11 @@ repos:
hooks:
- id: toml-sort
args: [-ia]
- repo: local
hooks:
- id: ty
name: ty check
entry: bash -c 'ty check suthing test'
language: system
pass_filenames: false
always_run: true
1 change: 0 additions & 1 deletion .python-version

This file was deleted.

1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ A Python utility package providing tools for file handling, timing, profiling, a

![Python](https://img.shields.io/badge/python-3.10-blue.svg)
[![PyPI version](https://badge.fury.io/py/suthing.svg)](https://badge.fury.io/py/suthing)
[![PyPI Downloads](https://static.pepy.tech/badge/suthing)](https://pepy.tech/projects/suthing)
[![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://opensource.org/licenses/MIT)
[![pre-commit](https://github.com/growgraph/suthing/actions/workflows/pre-commit.yml/badge.svg)](https://github.com/growgraph/suthing/actions/workflows/pre-commit.yml)
[![pytest](https://github.com/growgraph/suthing/actions/workflows/pytest.yml/badge.svg)](https://github.com/growgraph/suthing/actions/workflows/pytest.yml)
Expand Down
Binary file modified docs/assets/favicon.ico
Binary file not shown.
25 changes: 0 additions & 25 deletions docs/examples.md
Original file line number Diff line number Diff line change
Expand Up @@ -46,31 +46,6 @@ process_data(size=1000, batch_size=50, _profiler=profiler)
stats = profiler.view_stats()
```

## Database Connection Management

Create and manage database connections with automatic type detection:

```python
from suthing.connection import ConfigFactory

# ArangoDB connection
arango_config = ConfigFactory.create_config("http://localhost:8529")

# Neo4j connection
neo4j_config = ConfigFactory.create_config({
"port": "7474",
"username": "neo4j",
"password": "password"
})

# WSGI application
wsgi_config = ConfigFactory.create_config({
"port": "8000",
"host": "0.0.0.0",
"path": "/api"
})
```

## Data Validation

Compare and validate complex data structures:
Expand Down
26 changes: 26 additions & 0 deletions docs/gen_pages.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
from pathlib import Path

import mkdocs_gen_files

nav = mkdocs_gen_files.Nav()
pname = "suthing"

for path in sorted(Path(pname).rglob("*.py")):
module_path = path.relative_to(pname).with_suffix("")
doc_path = path.relative_to(pname).with_suffix(".md")
full_doc_path = Path("reference", doc_path)

parts = list(module_path.parts)

if parts[-1] == "__init__":
parts = parts[:-1]
if not parts:
continue
parts_str: tuple[str] = tuple(parts)
nav[parts_str] = str(full_doc_path)

with mkdocs_gen_files.open(full_doc_path, "w") as f:
ident = ".".join([pname] + parts)
f.write(f"# `{ident}`\n\n::: {ident}\n")

mkdocs_gen_files.set_edit_path(full_doc_path, path)
18 changes: 0 additions & 18 deletions docs/getting_started/quickstart.md
Original file line number Diff line number Diff line change
Expand Up @@ -63,24 +63,6 @@ dict2 = {"a": {"b": 1, "c": [1, 2, 3]}}
result = equals(dict1, dict2) # True
```

## Connection Management

Create and manage database connections:

```python
from suthing.connection import ConfigFactory

# Create a connection from URL
config = ConfigFactory.create_config(url="http://localhost:8529")
# This will automatically detect it's an ArangoDB connection based on port

# Or from a dictionary
config = ConfigFactory.create_config(dict_like={
"port": "8529",
"username": "user",
"password": "pass"
})
```

## Next Steps

Expand Down
6 changes: 3 additions & 3 deletions docs/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,17 +4,17 @@ SUThing /ˈsu.θɪŋ/ or /ˈsʌ.θɪŋ/ (Some Useful Things) is a collection of

A Python utility package providing tools for file handling, timing, profiling, and data comparison.

![Python](https://img.shields.io/badge/python-3.10-blue.svg)
![Python](https://img.shields.io/badge/python-3.10-blue.svg)
[![PyPI version](https://badge.fury.io/py/suthing.svg)](https://badge.fury.io/py/suthing)
[![PyPI Downloads](https://static.pepy.tech/badge/suthing)](https://pepy.tech/projects/suthing)
[![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://opensource.org/licenses/MIT)
[![pre-commit](https://github.com/growgraph/suthing/actions/workflows/pre-commit.yml/badge.svg)](https://github.com/growgraph/suthing/actions/workflows/pre-commit.yml)
[![pytest](https://github.com/growgraph/suthing/actions/workflows/pytest.yml/badge.svg)](https://github.com/growgraph/suthing/actions/workflows/pytest.yml)
[![PyPI version](https://badge.fury.io/py/suthing.svg)](https://badge.fury.io/py/suthing)
<!-- [![Documentation Status](https://readthedocs.org/projects/suthing/badge/?version=latest)](https://suthing.readthedocs.io/en/latest/?badge=latest) -->

## Features

- **File Handling**: One-line file reading/writing with file format inference from provided extension (YAML, JSON, CSV, pickle, gz etc.)
- **API/Database Config Class**: Normalized representation of API connection configs
- **Performance Measurement**: Simple timer utilities and profiling decorators
- **Data Comparison**: Deep comparison of nested data structures
- **Error Handling**: Decorators for secure function execution and error tracking
Expand Down
39 changes: 0 additions & 39 deletions docs/reference/connection.md

This file was deleted.

6 changes: 0 additions & 6 deletions docs/reference/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,12 +9,6 @@ Welcome to the Suthing API Reference documentation. This section contains detail
- [Profiler](core.md#profiler) - Function profiling utilities
- [Comparison](core.md#comparison) - Deep data structure comparison

## Connection Modules

- [Connection Types](connection.md#connection-types) - Supported connection types
- [Configuration](connection.md#connection-configuration) - Connection configuration classes
- [Factories](connection.md#connection-factories) - Connection factory utilities

## Quick Links

- [Getting Started](../getting_started/quickstart.md) - Basic usage examples
Expand Down
1 change: 0 additions & 1 deletion mkdocs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,6 @@ nav:
- API Reference:
- Overview: reference/index.md
- Core: reference/core.md
- Connection: reference/connection.md
- Examples: examples.md
- Contributing: contributing.md

Expand Down
11 changes: 7 additions & 4 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,8 @@ requires = ["hatchling"]
dev = [
"pre-commit>=3.3.3,<4",
"pytest>=8.3.3,<9",
"setuptools>=80.1.0"
"setuptools>=80.1.0",
"ty>=0.0.1a25"
]
docs = [
"mkdocs-material",
Expand All @@ -23,9 +24,11 @@ classifiers = [
]
dependencies = [
"dataclass-wizard>=0.34.0,<0.35",
"mkdocs-gen-files>=0.5.0",
"pandas>=2.0.3,<3",
"python-dotenv>=1.0.0,<2",
"pyyaml>=3.10"
"pyyaml>=3.10",
"strenum>=0.4.15"
]
description = "Small Useful Things : python package for convenient primitives"
keywords = [
Expand All @@ -35,8 +38,8 @@ keywords = [
license = "MIT"
name = "suthing"
readme = "README.md"
requires-python = "~=3.10"
version = "0.4.1"
requires-python = ">=3.10, <4"
version = "0.5.0"

[project.urls]
Homepage = "https://github.com/growgraph/suthing"
Expand Down
17 changes: 1 addition & 16 deletions suthing/__init__.py
Original file line number Diff line number Diff line change
@@ -1,15 +1,5 @@
from importlib.metadata import version

from suthing.connection.factory import ConfigFactory
from suthing.connection.onto import (
ArangoConnectionConfig,
ConnectionKind,
DBConnectionConfig,
Neo4jConnectionConfig,
ProtoConnectionConfig,
WSGIConfig,
)

from .compare import equals
from .decorate import Report, Return, SProfiler, profile, secureit, timeit
from .file_handle import FileHandle
Expand All @@ -19,17 +9,12 @@


__all__ = [
"ArangoConnectionConfig",
"ConnectionKind",
"DBConnectionConfig",
"Neo4jConnectionConfig",
"ProtoConnectionConfig",
"WSGIConfig",
"Timer",
"equals",
"Report",
"Return",
"SProfiler",
"profile",
"secureit",
"FileHandle",
]
Empty file removed suthing/connection/__init__.py
Empty file.
16 changes: 0 additions & 16 deletions suthing/connection/config_mapping.py

This file was deleted.

Loading