semvec/pypi-packages huggingface dataset:
apicurio-datahub-kafka 2.1.1
DataHub ApiCurio Schema Registry for Kafka Source

# datahub-apicurio-kafka
ApiCurio Schema Registry implementation for [DataHub Kafka ingestion source](https://datahubproject.io/docs/generated/ingestion/sources/kafka/). Only support AVRO schema currently.

## Sample Ingestion Recipe
A sample recipe can be found [here](./kafka_src_recipe.yaml)

## Config Details
If `schema_registry_config.pagination` is omitted, all records from Schema Registry will be fetched.
To limit number of records fetched from the Schema Registry, you can set the `schema_registry_config.pagination` as shown below:
<pre>
source:
  type: "kafka"
  config:
    platform_instance: "local-docker"
    schema_registry_class: "apicurio_kafka.apicurio_schema_registry.ApicurioSchemaRegistry"
    connection:
      bootstrap: "localhost:9093"
      schema_registry_url: http://localhost:8085/apis/registry/v2
      <b>schema_registry_config:
        pagination: 100</b>
</pre>

## Installation
Package can be installed using `pip install apicurio-datahub-kafka`
pz-fileio 1.0.1
Lightweight, object-oriented utility library for convenient file management in Python.
Requires Python: >=3.0

# fileio

fileio is a lightweight, object-oriented utility library for convenient file management in Python. It provides a robust and intuitive API to perform file operations such as creation, reading, writing, appending, deleting, backup, and hashing, along with JSON and CSV support.

## Installation

fileio is a standalone Python package. To use it, simply download the `File.py` module and place it in your project directory.

Alternatively, if you plan to publish it on PyPI, you could install it via pip:

```bash
pip install fileio
```

*(Assuming the package is published under that name.)*

## Usage

Here’s how to use the `File` class:

### Import the module

```python
from pz_fileio import File
```

### Creating a File instance

```python
f = File("path/to/your/file.txt")
```

### Basic operations

- **Check if file exists**  
  ```python
  exists = f.Exists()
  ```

- **Create a new file**  
  ```python
  f.Create()
  ```

- **Delete a file**  
  ```python
  f.Delete()
  ```

- **Recreate the file (delete and create a new empty one)**  
  ```python
  f.Recreate()
  ```

- **Get basic information**  
  ```python
  print(f.GetBasename())      # filename only
  print(f.GetDirname())       # directory name
  print(f.GetAbsolutePath())  # absolute path
  print(f.GetFileSize())      # file size in bytes
  print(f.GetMimeType())      # file MIME type
  ```

### Reading and writing content

- **Read the entire file content**  
  ```python
  content = f.Read()
  ```

- **Read lines**  
  ```python
  lines = f.ReadLines()
  ```

- **Append content**  
  ```python
  f.Append("This is a new line.")
  ```

- **Overwrite content**  
  ```python
  f.Overwrite("This will replace everything.")
  ```

### JSON and CSV handling

- **Read as JSON**  
  ```python
  data = f.ReadAsJson()
  ```

- **Write as JSON**  
  ```python
  f.WriteAsJson({"name": "fileio", "version": 1.0})
  ```

- **Read as CSV**  
  ```python
  rows = f.ReadAsCsv()
  ```

- **Write as CSV**  
  ```python
  f.WriteAsCsv([["name", "value"], ["fileio", "awesome"]])
  ```

### Hashing and backup

- **Calculate file hash**  
  ```python
  file_hash = f.Hash()  # Defaults to SHA-256
  ```

- **Create a backup**  
  ```python
  backup_path = f.Backup()
  print(f"Backup created at: {backup_path}")
  ```

### Context manager usage

The `File` class implements the context management protocol (`with` statement). Use it for **read-only** scenarios:

```python
with File("path/to/your/file.txt") as f:
    content = f.Read()
```

### License

MIT License

---

Want to tweak this further (like adding examples for CSV, JSON, or advanced usage)? Let me know and I’ll extend it! 🚀