semvec/pypi-packages huggingface dataset:
tree-creator 1.1.3
Create directory and file structures from tree-like text representations
License: MIT
Requires Python: >=3.7
Keywords: tree directory structure filesystem generator creator

# 📁 Tree Creator

![PyPI](https://img.shields.io/pypi/v/tree-creator)
![Python Versions](https://img.shields.io/pypi/pyversions/tree-creator)
![License](https://img.shields.io/pypi/l/tree-creator)

Create directory and file structures from tree-like text representations — just like the output of the `tree` command.

## ✨ Features

* Parse text-based tree structures and generate corresponding directories and files.
* Dry-run support (simulate without creating files).
* CLI and API support.
* Helpful logging for debugging and auditing.
* Version managed centrally via `_version.py`.
* Zero external dependencies.

## 📦 Installation

```bash
pip install tree-creator
```

or (for development):

```bash
git clone https://github.com/jack-low/tree-creator
cd tree-creator
pip install -e ".[dev]"
```

## 🚀 Usage

### ✨ Example (Python API)

```python
from tree_creator import TreeCreator

tree_text = '''
project/
├── src/
│   ├── main.py
│   └── utils.py
└── README.md
'''

creator = TreeCreator()
creator.create_from_text(tree_text, base_dir='./my_project')
```

### 💻 CLI

```bash
tree-creator tree.txt --base-dir ./my_project
tree-creator tree.txt --dry-run
echo "dir/\n└── file.txt" | tree-creator -
```

### 🧪 Example using Here Document (EOF)

```bash
tree-creator -b ./output-dir -d - <<EOF
myapp/
├── index.html
└── static/
    └── style.css
EOF
```

- `-d` enables dry-run mode
- `-b ./output-dir` sets the output base directory
- `-` reads from stdin

#### Options

| Option           | Description                                |
|------------------|--------------------------------------------|
| `-b, --base-dir` | Target base directory (default: `.`)       |
| `-e, --encoding` | Encoding for input file (default: `utf-8`) |
| `-d, --dry-run`  | Simulate without file creation             |
| `-v, --verbose`  | Verbose log output                         |
| `-V, --version`  | Display version                            |

## 📄 Tree Format

A valid tree structure should follow conventions like:

```
project/
├── src/
│   ├── main.py
│   └── utils.py
└── README.md
```

- Directories end with `/`
- Use characters like `├──`, `└──`, `│`

## 🧪 Development

```bash
pip install -e ".[dev]"
pytest
black .
flake8 .
mypy tree_creator
```

## 📜 License

MIT License © [Jack3Low](mailto:xapa.pw@gmail.com)

## 🔗 Links

* [PyPI tree-creator](https://pypi.org/project/tree-creator/)
* [Source Code](https://github.com/jack-low/tree-creator)
* [Issue Tracker](https://github.com/jack-low/tree-creator/issues)
* [Documentation](https://github.com/jack-low/tree-creator#readme)
* [Japanese README](https://github.com/jack-low/tree-creator/blob/main/README.ja.md)
* [Changelog](./CHANGELOG.md)
nopokedb 0.5.1
Disk-backed HNSW vector database with SQLite metadata
License: MIT
Requires Python: >=3.7

# 🐹 NoPokeDB

A **tiny, disk-backed vector database** built on [hnswlib](https://github.com/nmslib/hnswlib) (for approximate nearest neighbor search) and SQLite (for metadata).  
Simple, lightweight, and crash-safe — good for prototypes, side projects, or when you don’t want a heavyweight vector DB service.


## ✨ Features

- **Durable**: HNSW index + SQLite metadata, persisted on disk  
- **Crash safety**: write-ahead oplog with replay  
- **Fast**: batch inserts, bulk metadata fetch, auto-resize index  
- **Flexible metrics**: cosine / L2 / inner product  
- **CRUD**: `add`, `add_many`, `get`, `delete`, `upsert`  
- **Consistent scoring**: higher = better for all metrics (with raw `distance` included)  

## 📦 Installation

```bash
pip install nopokedb
```

## 🚀 Quickstart

```python
import numpy as np
from nopokedb import NoPokeDB

# Create (or load existing) DB with 128-d vectors
db = NoPokeDB(dim=128, max_elements=10_000, path="./vdb_data", space="cosine")

# Insert one vector
vec = np.random.rand(128).astype(np.float32)
vid = db.add(vec, metadata={"name": "foo"})

# Insert many at once (faster)
V = np.random.rand(5, 128).astype(np.float32)
metas = [{"i": i} for i in range(len(V))]
ids = db.add_many(V, metas)

# Query nearest neighbors
q = np.random.rand(128).astype(np.float32)
hits = db.query(q, k=3)
for h in hits:
    print(h["id"], h["score"], h["metadata"])

# Get / update / delete
print(db.get(vid))
db.upsert(vid, metadata={"name": "bar"})
db.delete(ids[0])

# Persist & close
db.save()
db.close()
```

Example query result:

```python
{'id': 0, 'metadata': {'name': 'foo'}, 'score': 0.991, 'distance': 0.009}
```


## 🛠 Development

### Bump version

The Makefile automates version bumps in `pyproject.toml` and `src/nopokedb/__init__.py`:

```bash
make bump V=0.2.0
```

That will:

* update both files
* commit with message `Bump to v0.2.0`
* tag `v0.2.0`
* push tag + main branch

### Publish to PyPI

1. Set your API key once:

   ```bash
   export PYPI_API_KEY=your-pypi-token
   ```

2. Build + upload:

   ```bash
   make publish
   ```

## 📜 License

MIT