semvec/pypi-packages huggingface dataset:
pyinels 0.6.16
Python library for iNels BUS
License: MIT
Keywords: iNels, Elko EP, Home assistant integration

[![Board Status](https://dev.azure.com/JH-Soft-Technology/56876c97-c932-49e4-9f94-ee53648b47f2/46ab7c1c-c809-440e-a908-a8bf4905312d/_apis/work/boardbadge/f600c878-c9b8-49eb-8b68-79918bbf1841?columnOptions=1)](https://dev.azure.com/JH-Soft-Technology/56876c97-c932-49e4-9f94-ee53648b47f2/_boards/board/t/46ab7c1c-c809-440e-a908-a8bf4905312d/Microsoft.RequirementCategory/)
[![Build status](https://dev.azure.com/JH-Soft-Technology/pyinels/_apis/build/status/Pyinels)](https://dev.azure.com/JH-Soft-Technology/pyinels/_build/latest?definitionId=6)

PyInels
========
A Python library that handles communication with proprietary home intelligent system
named [iNels](https://www.inels.com/) by ElkoEP company.

This package is developed against iNels BUS version. It is not tested on older
version CU2 and does not support RF components.

Requirements
============
For smooth using you need to have Python 3.8 or higher.

Install
=======
Use PyPI repository
```
pip install pyinels
```

Usage
=====
See the test directory for examples.

Testing
=======
I use [tox](https://tox.readthedocs.io) for testing.

```
$ pip install tox

```

Reason
======
I wrote PyInels library to use it for [home assistant](https://www.home-assistant.io/) integration.

Watch Feature
=============
In the future I would like to rewrite the library with better efficiency such ass [Asyncio](https://blog.heroku.com/python37-dataclasses-async-await#asyncio-and-the-code-async-code-code-await-code-keywords).

[![buy me a coffee](https://www.buymeacoffee.com/assets/img/custom_images/orange_img.png)](https://www.buymeacoffee.com/jhoralek)
colocal 2025.11.6.1340
Harmonises Jupyter and Colab notebook environments for consistent paths, imports, and working directories
License: MIT
Requires Python: >=3.8

# colocal

**Colab or local — same behaviour, same results.**

`colocal` is a lightweight utility that harmonises notebook environments across **Google Colab** and **local Jupyter**.

It automatically ensures your repository structure, imports, and working directory are consistent — so your notebooks run the same everywhere.

---

## ✨ Features

* **Seamless dual support** → Detects Colab vs Jupyter automatically.
* **Clean imports** → Adds your repository root to `sys.path`.
* **Consistent working directory** → Sets `cwd` to the notebook’s folder, avoiding fragile `../../` paths.
* **Branch-aware in Colab** → Parses the Colab badge, checks out the correct branch, and mirrors your local repo structure.
* **Fallback support** → If the notebook has no badge, you can specify the GitHub URL directly.
* **Reproducibility** → Run the same notebook in Colab or locally with identical results.

---

## 🚀 Usage

### 🟢 Running in Colab

If your notebook has a Colab badge that points to a Github repo like:

```markdown
<a href="https://colab.research.google.com/github/org/repo/blob/main/notebooks/demo.ipynb">
  <img src="https://colab.research.google.com/assets/colab-badge.svg" alt="Open in Colab"/>
</a>
```

just run:

```python
import colocal
colocal.setup()
```

`colocal` will:

* Clone the correct repo and branch into `/content/`
* Add it to `sys.path`
* Set the working directory to match the notebook’s location in the repo

---

### 🟡 No badge? Specify the repo manually

If the notebook doesn’t include a Colab badge, just provide the repository URL:

```python
import colocal
colocal.setup("https://github.com/org/repo")
```

This clones the repo’s **default branch**, adds it to `sys.path`, and sets the working directory to the repo root.

---

### ⚪ Running locally

If you’re in a local Jupyter environment, `colocal`:

* Detects the current notebook’s location
* Finds the repository root (via `.git`)
* Adds it to `sys.path`
* Changes directory to the notebook’s folder

That’s it — your imports and paths are now consistent with the Colab version.

---

### 🧩 Return values

```python
repo_root, branch, cwd = colocal.setup(...)
```

* `repo_root` → path to the repository root
* `branch` → current branch name (if known)
* `cwd` → current working directory after setup

---