semvec/pypi-packages huggingface dataset:
constspace 0.1.5
A tiny library for read-only, non-instantiable namespace constants.
Requires Python: >=3.7

# ConstSpace 🚀

[![GitHub repo](https://img.shields.io/badge/GitHub-Repo-blue?logo=github)](https://github.com/fluffydogcatmouse/constspace)
[![PyPI version](https://img.shields.io/pypi/v/constspace.svg)](https://pypi.org/project/constspace/)
[![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://opensource.org/licenses/MIT)

**ConstSpace** is an ultra-lightweight Python library for defining **read-only, non-instantiable, and type-safe** constant namespaces.

It is designed to eliminate the verbosity of Python's `Enum` (which requires `.value` access) and the lack of protection in plain classes.

---

## 🌟 Key Features

* **Zero `.value` Overhead**: Access constants directly. What you see is what you get, with perfect IDE autocompletion.
* **Class-Level Read-Only Protection**: Uses metaclasses to block any attempt to modify or delete class attributes at runtime.
* **Strict Non-instantiability**: Ensures classes are used purely as namespaces. Attempting to instantiate will raise a `TypeError`.
* **Unified Type Grouping**: The decorator automatically injects a base class, allowing you to use `ConstSpaceType` for clean type hinting and management.
* **Seamless Integration**: Supports direct references between attributes during definition and works perfectly with static type checkers like MyPy.

---

## 📦 Installation

```bash
pip install constspace
```

---

## 🚀 Quick Start

### 1. Define Your Constant Space

```python
from constspace import constspace

@constspace
class ServiceConfig:
    API_KEY = "v1_sec_123"
    TIMEOUT = 60
    # Reference attributes directly without .value or self
    SIGNATURE = f"prefix_{API_KEY}_suffix" 

```

### 2. Security & Constraints

```python
# ✅ Normal Access
print(ServiceConfig.SIGNATURE) 

# ❌ Modify attribute -> Raises AttributeError
ServiceConfig.API_KEY = "new_key" 

# ❌ Instantiate -> Raises TypeError
cfg = ServiceConfig() 

```

### 3. Type Hinting & Management

```python
from typing import List
from constspace import constspace, ConstSpaceType

@constspace
class MySQL:
    PORT = 3306

@constspace
class Redis:
    PORT = 6379

# Use ConstSpaceType (alias for Type[ConstSpace]) for constraints
def print_port(cfg: ConstSpaceType):
    print(f"Port is: {cfg.PORT}")

configs: List[ConstSpaceType] = [MySQL, Redis]
for c in configs:
    print_port(c)

```

---

## 🧐 Why ConstSpace?

| Feature | **ConstSpace** | **Enum** | **Dataclass (frozen)** |
| --- | --- | --- | --- |
| **Easy Access** | ✅ Direct Value | ❌ Requires `.value` | ✅ Direct Value |
| **Block Instance** | ✅ Strictly Enforced | ❌ Allowed by default | ❌ Allowed by default |
| **Class Attribute Protection** | ✅ Strictly Read-only | ❌ Allowed to modify | ❌ Only protects instances |
| **Type Integrity** | ✅ Original Types | ❌ Enum Member Type | ✅ Original Types |

---

## 📜 License

MIT License.
dsslab-wdc-client 0.17.0
A small client for the WDC-Rest-API.
Requires Python: <4,>=3.10

# Description
This project includes a *very* small client to access data form 
the WebDataCollector-API. It is meant to provide a simple means 
of accessing the data in Json or as Panda-DataFrames.

# Usage

```
from dsslab.wdc_client import *

# make sure file ~/.wdc exists. Content:
# WDC_HOST=${the_host_you_are_using}
# WDC_TOKEN=${your_token}
# Alternative ways to initialize: see docs of WDCClient
client = WDCClient.fromEnv() 
df = client.loadAsDataFrame(
	'api/endpoint...', {'param1', 'value will be encoded'})
```

For more information about the client and usable endpoints, 
see the project homepage of WDC or directly consult the Documentation.

# Changelog
- 0.17.0	Add streaming method WDCClient#streamForEach
- 0.16.1	Add docs
- 0.16.0	Send parameter "body" as BODY
- 0.15.0	WDC.fromEnv uses ~/.wdc file if WDC_HOST has not been previously initialized
- 0.14.0	Added possiblity to pass native dicts and lists to loadAsXXX-methods
- 0.13.0	Add method WDCClient.loadAsDF(endpoint: str, **params) for brevity
- 0.12.0	Fix minor bug for Rate-Limiting.
- 0.11.0	Transparently handle Rate-Limiting from server.
- 0.10.0	Moved to new package structure with the namespace dsslab.

# Old changelog 
- 0.9.1		Make package obsolete.
- 0.9.0		Add method WDCClient#put to create PUT-Requests
- 0.8.2		Fix for duplicate parameters when paging.
- 0.8.1		Simplify new methods for loading a DomainGraph.
- 0.8.0		Added new methods for loading DomainGraphs.
- 0.7.3		Fix README
- 0.7.2		Include link for generated documentation
- 0.7.1 	Added generated documentation
- 0.7.0		Added new method WDCClient.loadDomainGraph for loading a DomainGraph as NetworkX-Object
- 0.6.0		WDCClient throws an WDCException if a request to the server fails
- 0.5.0		New signatures and methods taking care of encodings and working on large results
- 0.4.3		Add dependencies pandas["excel, plot"] as they are likely to be used.
- 0.4.2		Enhance README with Changelog and code-example.
- 0.4.1		Include a preferred variant for creating WDCClients from the Environment