semvec/pypi-packages huggingface dataset:
cherrypy-utils 1.1.0
Collection of utility functions and modules for cherrypy web servers
Requires Python: >=3.6

# Overview

This is a generic utility library full of helper functions relating to cherrypy webservice routines.
Included are handlers for:

-   authentication (authentication.py)
-   sqlalchemy with cherrypy (cherrypy_sqlalchemy_utils.py & database.py)
-   json parsing and constructing orm entities from json (json_utils.py)
-   timestamp (ISO and posix epoch) parsing (timestamp.py)
-   url construction and parsing from parts (similar to os.path.join) (url_utils.py)
-   ldap login utilities (login/ldap_auth.py & login/models.py)

## Usage

To use this package in your project as a dependency (using pipenv), you can add it as a package with the following definition:

    [packages]
    cherrypy_utils = { git = "${USERNAME}:${PASSWORD}@git.mindmodeling.org:ian.davis/CherrypyUtils.git" }

You will need to export appropriate environment variables for USERNAME and PASSWORD.
See this page for more info: https://pipenv.pypa.io/en/latest/advanced/#injecting-credentials-into-pipfiles-via-environment-variables
Alternatively, if you save your username/password in git config, pipenv will intelligently use that if you provide the http link instead:

    [packages]
    cherrypy_utils = { git = "https://git.mindmodeling.org/ian.davis/CherrypyUtils.git" }

## Development

This package is developed using Pipenv for package management, which makes dealing with pip packages easier.
Check out more here: https://pipenv.pypa.io/en/latest/install/#using-installed-packages

It also uses pyenv to manage multiple different installed versions of python.
Currently, this package targets python 3.6.8.

The package uses the black formatter and enforces a strict formatting policy, automatic formatting on save is required.

## GCP Deployment

https://packaging.python.org/en/latest/tutorials/packaging-projects/
https://cloud.google.com/artifact-registry/docs/python/authentication#keyring
https://cloud.google.com/artifact-registry/docs/python/manage-packages

```
gcloud artifacts print-settings python --project=afrl-il2-sbx-rh-mm-lab-i9sv --repository=online-experiment-python-utilities --location=us-central1
```

Setup requires pip packages:

-   `hatchling`
-   `keyring`
-   `keyrings.google-artifactregistry-auth`

Build and deploy using deploy_package_gcp.py
Documentation on hatch: https://hatch.pypa.io/dev/

```
pip install keyring
pip install keyrings.google-artifactregistry-auth
keyring --list-backends
gcloud artifacts print-settings python --project=afrl-il2-sbx-rh-mm-lab-i9sv --repository=online-experiment-python-utilities --location=us-central1
gcloud auth login
```
fakesnake 0.0.8
generate fake data

![FakeSnake_Logo](https://raw.githubusercontent.com/Vin-Cento/fakesnake/master/assets/banner.png)

## Usages

```bash
fakes --help
```

    Usage: fakes [OPTIONS] COMMAND [ARGS]...

    Options:
      --help  Show this message and exit.

    Commands:
      db   subcommand for database interaction
      gen  subcommand for generating data

### Generate Fake Data

![generate demo](https://raw.githubusercontent.com/Vin-Cento/fakesnake/development/assets/fakesnake_gen_demo.gif)

```bash
fakes gen --help
```

    Usage: fakes gen [OPTIONS] COMMAND [ARGS]...

      subcommand for generating data

    Options:
      --help  Show this message and exit.

    Commands:
      address   generate a list of address
      email     generate a list of email
      geojson   generate a list of geojson
      name      generate a list of name
      number    generate a list of number
      password  generate a list of password
      shape     generate a list of shape
      text      generate a list of text

### Insert Fake Data to Database

##### (\*postgres only... other databases coming soon)

![insert demo](https://raw.githubusercontent.com/Vin-Cento/fakesnake/development/assets/fakesnake_db_demo.gif)

```bash
fakes db --help
```

    Usage: fakes db [OPTIONS] COMMAND [ARGS]...

      subcommand for database interaction

    Options:
      --help  Show this message and exit.

    Commands:
      config    show the database config
      describe  describe the current database
      exec      execute a sql command
      insert    insert random data into table
      table     show all columns the table
      tables    show all tables the database

## Install

```bash
pip install fakesnake
```

## Postgres

Need to have the psycopg2-binary to connect to POSTGRES server. To install it, you need install postgres-client and postgres-dev.

```bash
# alpine
apk add postgres-client postgres-dev

# ubuntu
apt install postgres-client postgres-dev
```

```bash
pip install psycopg2-binary
```

## FAQ

1.  Q: Where to report problems?

    A: Open up an [issue](https://github.com/Vin-Cento/fakesnake/issues/new)