semvec/pypi-packages huggingface dataset:
kraken-class-entity 0.0.7
Kraken Class entity
License: MIT

# Entity class api

Generic class library to interact with kraken db through api. 

The library handles type and key conversion to ensure compliance. 

## Features
- Automatic schema type correction (imageobject --> schema:ImageObject)
- Automatic record_id assignation if missing
- Automatic variable name (key) correction (familyname --> schema:familyName)
- Automatic value type correction (www.test.com --> https://www.test.com/) 



## How to use:
- entity: single entity record
- entities: collection of entity records

## Entity
### Initialize
`entity = Entity()`

`entity.record_type = 'schema:Person'`

`entity.record_id = 'abc'`

### Get/store data
`name = entity.get('givenName')`

`entity.set('givenName', name)`

### Get/store record / json
`entity.record = record`

`record = entity.record`

`entity.json = json_string`

`json_string = entity.json`

### Get and store data to database
Set once for all subsequent entities

`entity.api_url = 'url_to_use'`

#### Get from db

`entity.get_api()`

`entity.get_api_async()`


#### Post to db

`entity.post_api()`

`entity.post_api_async()`


## Entities
### Initialize
`entities = Entities()`

`entities.record_type = 'schema:Person'`

`entities.record_id = 'abc'`

### Load / dump data
Will convert records to entity

`records = entity.dump()`

`entity.load(records)`

### Attributes
- entity.ref_id: dict reference to record ({'@type': 'record_type', '@id': 'record_id'})

### Get/store record / json
`entities.record = record`

`record = entities.record`

`entities.json = json_string`

`json_string = entities.json`

### Get and store data to database
Set once for all subsequent entities

`entities.api_url = 'url_to_use'`

#### Get from db

`entities.get_api()`

`entities.get_api_async()`


#### Post to db

`entities.post_api()`

`entities.post_api_async()`
cjolowicz-scripts 2022.1.9
Miscellaneous Python scripts
License: MIT
Requires Python: >=3.10

Miscellaneous Python scripts
============================

|PyPI| |Status| |Python Version| |License| |Read the Docs| |Tests| |Codecov|

.. |PyPI| image:: https://img.shields.io/pypi/v/cjolowicz-scripts.svg
   :target: https://pypi.org/project/cjolowicz-scripts/
   :alt: PyPI
.. |Status| image:: https://img.shields.io/pypi/status/cjolowicz-scripts.svg
   :target: https://pypi.org/project/cjolowicz-scripts/
   :alt: Status
.. |Python Version| image:: https://img.shields.io/pypi/pyversions/cjolowicz-scripts
   :target: https://pypi.org/project/cjolowicz-scripts
   :alt: Python Version
.. |License| image:: https://img.shields.io/pypi/l/cjolowicz-scripts
   :target: https://opensource.org/licenses/MIT
   :alt: License
.. |Read the Docs| image:: https://img.shields.io/readthedocs/cjolowicz-scripts/latest.svg?label=Read%20the%20Docs
   :target: https://cjolowicz-scripts.readthedocs.io/
   :alt: Read the documentation at https://cjolowicz-scripts.readthedocs.io/
.. |Tests| image:: https://github.com/cjolowicz/python-scripts/workflows/Tests/badge.svg
   :target: https://github.com/cjolowicz/python-scripts/actions?workflow=Tests
   :alt: Tests
.. |Codecov| image:: https://codecov.io/gh/cjolowicz/cjolowicz-scripts/branch/main/graph/badge.svg
   :target: https://codecov.io/gh/cjolowicz/cjolowicz-scripts
   :alt: Codecov


Welcome to my assortment of random Python scripts,
all of which come with no guarantees whatsoever.


Installation
------------

You can install these scripts via pip_ from PyPI_:

.. code:: console

   $ pip install cjolowicz-scripts


Usage
-----

Please see the Documentation_ for details.


Contributing
------------

Contributions are very welcome.
To learn more, see the `Contributor Guide`_.


License
-------

Distributed under the terms of the `MIT license`_,
these scripts are free and open source software.


Issues
------

If you encounter any problems,
please `file an issue`_ along with a detailed description.


Credits
-------

This project was generated from `@cjolowicz`_'s `Hypermodern Python Cookiecutter`_ template.

.. _@cjolowicz: https://github.com/cjolowicz
.. _Cookiecutter: https://github.com/audreyr/cookiecutter
.. _MIT license: https://opensource.org/licenses/MIT
.. _PyPI: https://pypi.org/
.. _Hypermodern Python Cookiecutter: https://github.com/cjolowicz/cookiecutter-hypermodern-python
.. _file an issue: https://github.com/cjolowicz/python-scripts/issues
.. _pip: https://pip.pypa.io/
.. github-only
.. _Contributor Guide: CONTRIBUTING.rst
.. _Documentation: https://cjolowicz-scripts.readthedocs.io/
verox 0.0.11
An implementation of IPC using websockets.
License: MIT
Requires Python: >=3.8.0,<3.11

[![PyPI](https://img.shields.io/pypi/v/verox)](https://pypi.org/project/verox)
![Maintenance](https://img.shields.io/maintenance/yes/2022)
![Code Style](https://img.shields.io/badge/code%20style-black-black)

# Verox
Verox (inspired by [discord-ext-ipc](https://github.com/Ext-Creators/discord-ext-ipc)) is an implementation of [IPC](https://en.wikipedia.org/wiki/Inter-process_communication) using websockets.
It's designed to make dashboard development a lot easier and quicker.
While it's aimed at the hikari community, it does not depend on it at all which means you can use it for any discord API wrapper you like.

## Installation
```
pip install verox
```
<details>
<summary>
    Didn't work?
</summary>

- `pip` is not in `PATH`
    ```sh
    python -m pip install verox
    ```

- Check if the path of your python executable matches the path of the interpreter you run your code with<br>
    In UNIX-like systems:
    ```sh
    which python
    ```

</details>

## Usage

Verox is split into client-side and server-side. The client-side is usually the web app, the server-side is the bot.

The following example uses [quart](https://github.com/pgjones/quart) and [hikari](https://github.com/hikari-py/hikari):

`webapp.py`
```py
from quart import Quart
from verox import Client

app = Quart(__name__)
client = Client("your_secret_key")

@app.route("/")
async def home():
    count = await client.request("guild_member_count", guild_id=1234567890)
    return str(count)

@app.after_serving
async def close_client():
    await client.close()

app.run(debug=True)
```

`bot.py`
```py
import hikari
import verox

bot = hikari.GatewayBot(token="your_token", intents=hikari.Intents.ALL)
server = verox.Server("your_secret_key") #must match the secret key of your client

@verox.endpoint()
async def guild_member_count(context: verox.Context):
    return len(bot.cache.get_members_view_for_guild(context.data.guild_id))

@bot.listen()
async def close_server(event: hikari.StoppingEvent):
    await server.close()

server.start()
bot.run()
```

For more advanced examples, please take a look at [examples](examples) and its README