Metadata-Version: 2.1
Name: everysk-beta
Version: 1.4.815
Summary: Generic lib to share python code on Everysk.
License: (C) Copyright 2023 EVERYSK TECHNOLOGIES
        
        This is an unpublished work containing confidential and proprietary
        information of EVERYSK TECHNOLOGIES. Disclosure, use, or reproduction
        without authorization of EVERYSK TECHNOLOGIES is prohibited.
        
        Date: Jan 2023
        Contact: fscariott@everysk.com
        URL: https://everysk.com/
Keywords: python,setuptools,development,lib
Requires-Python: >=3.11
Description-Content-Type: text/markdown
License-File: LICENSE.txt
Requires-Dist: python-dateutil==2.8.2
Requires-Dist: holidays==0.32
Requires-Dist: tzdata==2024.1
Provides-Extra: requests
Requires-Dist: certifi==2024.2.2; extra == "requests"
Requires-Dist: charset-normalizer==3.3.2; extra == "requests"
Requires-Dist: idna==3.6; extra == "requests"
Requires-Dist: urllib3==2.2.1; extra == "requests"
Requires-Dist: requests==2.31.0; extra == "requests"
Provides-Extra: firestore
Requires-Dist: certifi==2024.2.2; extra == "firestore"
Requires-Dist: charset-normalizer==3.3.2; extra == "firestore"
Requires-Dist: idna==3.6; extra == "firestore"
Requires-Dist: urllib3==2.2.1; extra == "firestore"
Requires-Dist: requests==2.31.0; extra == "firestore"
Requires-Dist: pyasn1==0.5.1; extra == "firestore"
Requires-Dist: pyasn1-modules==0.3.0; extra == "firestore"
Requires-Dist: cachetools==5.3.2; extra == "firestore"
Requires-Dist: rsa==4.9; extra == "firestore"
Requires-Dist: google-auth==2.28.1; extra == "firestore"
Requires-Dist: googleapis-common-protos==1.62.0; extra == "firestore"
Requires-Dist: grpcio==1.60.1; extra == "firestore"
Requires-Dist: grpcio-status==1.60.1; extra == "firestore"
Requires-Dist: google-api-core[grpc]==2.17.1; extra == "firestore"
Requires-Dist: google-cloud-core==2.4.1; extra == "firestore"
Requires-Dist: proto-plus==1.23.0; extra == "firestore"
Requires-Dist: protobuf==4.25.3; extra == "firestore"
Requires-Dist: google-cloud-firestore==2.15.0; extra == "firestore"
Provides-Extra: redis
Requires-Dist: redis==5.0.1; extra == "redis"
Provides-Extra: tasks
Requires-Dist: certifi==2024.2.2; extra == "tasks"
Requires-Dist: charset-normalizer==3.3.2; extra == "tasks"
Requires-Dist: idna==3.6; extra == "tasks"
Requires-Dist: urllib3==2.2.1; extra == "tasks"
Requires-Dist: requests==2.31.0; extra == "tasks"
Requires-Dist: pyasn1==0.5.1; extra == "tasks"
Requires-Dist: pyasn1-modules==0.3.0; extra == "tasks"
Requires-Dist: cachetools==5.3.2; extra == "tasks"
Requires-Dist: rsa==4.9; extra == "tasks"
Requires-Dist: google-auth==2.28.1; extra == "tasks"
Requires-Dist: googleapis-common-protos==1.62.0; extra == "tasks"
Requires-Dist: grpcio==1.60.1; extra == "tasks"
Requires-Dist: grpcio-status==1.60.1; extra == "tasks"
Requires-Dist: google-api-core[grpc]==2.17.1; extra == "tasks"
Requires-Dist: google-cloud-core==2.4.1; extra == "tasks"
Requires-Dist: proto-plus==1.23.0; extra == "tasks"
Requires-Dist: protobuf==4.25.3; extra == "tasks"
Requires-Dist: grpc-google-iam-v1==0.13.0; extra == "tasks"
Requires-Dist: google-cloud-tasks==2.16.1; extra == "tasks"
Provides-Extra: gcp-log
Requires-Dist: certifi==2024.2.2; extra == "gcp-log"
Requires-Dist: charset-normalizer==3.3.2; extra == "gcp-log"
Requires-Dist: idna==3.6; extra == "gcp-log"
Requires-Dist: urllib3==2.2.1; extra == "gcp-log"
Requires-Dist: requests==2.31.0; extra == "gcp-log"
Requires-Dist: pyasn1==0.5.1; extra == "gcp-log"
Requires-Dist: pyasn1-modules==0.3.0; extra == "gcp-log"
Requires-Dist: cachetools==5.3.2; extra == "gcp-log"
Requires-Dist: rsa==4.9; extra == "gcp-log"
Requires-Dist: google-auth==2.28.1; extra == "gcp-log"
Requires-Dist: googleapis-common-protos==1.62.0; extra == "gcp-log"
Requires-Dist: grpcio==1.60.1; extra == "gcp-log"
Requires-Dist: grpcio-status==1.60.1; extra == "gcp-log"
Requires-Dist: google-api-core[grpc]==2.17.1; extra == "gcp-log"
Requires-Dist: google-cloud-core==2.4.1; extra == "gcp-log"
Requires-Dist: proto-plus==1.23.0; extra == "gcp-log"
Requires-Dist: protobuf==4.25.3; extra == "gcp-log"
Requires-Dist: grpc-google-iam-v1==0.13.0; extra == "gcp-log"
Requires-Dist: google-cloud-appengine-logging==1.4.1; extra == "gcp-log"
Requires-Dist: google-cloud-audit-log==0.2.5; extra == "gcp-log"
Requires-Dist: google-cloud-logging==3.9.0; extra == "gcp-log"


# Everysk Lib

Everysk's library was developed with the aim of unifying python
codes to be used in various company projects.


## Docker

To run the pypi server:

```bash
  docker build --file ./docker/Dockerfile --target everysk_pypi_server --tag everysk_pypi_server:latest .
  docker run --rm -it -e PYPI_PASSWORD='123123' -p 0.0.0.0:8080:80 -p 0.0.0.0:2020:22 everysk_pypi_server:latest
```

To build the library and send to Pypi server:

```bash
  docker build --file ./docker/Dockerfile --target everysk_lib_build --tag everysk_lib_build:latest .
  docker run --rm -it -e PYPI_PASSWORD='123123' -e PYPI_HOST='192.168.0.116' everysk_lib_build:latest

```

## Usage/Examples

Module object and fields are used to create class with consistent data.

```python
    >>> from everysk.core.fields import BoolField
    >>> from everysk.core.object import BaseDict
    >>>
    >>> class MyClass(BaseDict):
    ...     field: BoolField(required=True)
    >>>
    >>> obj = MyClass(field=True)
    >>> obj.field is True
    ... True
    >>> obj.field == obj['field']
    ... True

```

Module http has connection base class to use on HTTP Methods.

```python
    >>> from everysk.core.http import HttpGETConnection
    >>>
    >>> class MyConnection(HttpGETConnection):
    ...     url: StrField(defautl='https://example.com', readonly=True)
    ...     def get_params(self) -> dict:
    ...         # Will be added to url p=1&p=2
    ...         return {'p': 1, 'p': 2}
    ...
    ...     def message_error_check(self, message: str) -> bool:
    ...         # If this message appear on HttpError then we try again.
    ...         return 'server is busy' in message
    >>>
    >>> response = MyConnection().get_response()

```

Module settings is the sum of all settings.py created on the project.
Every setting will have it's value first from env otherwise from the attribute.

```python
    >>> from everysk.core.config import settings
    >>> settings.DEBUG
    True

```

Module firestore.DocumentCached is a Redis/Firestore document. This uses Redis for
read the data and Redis/Firestore to store the data. To keep the cache synchronized
with Firestore, use everysk/cloud_function. With this when we alter the data using
Firestore interface the cache will be updated.

```python
    >>> from everysk.core.firestore import DocumentCached
    >>> doc = Document(_collection_name='collection', firestore_id='firestore_id')
    >>> doc.firestore_id
    'firestore_id'

```

## Installation

Install everysk-lib with pip:

```bash
  pip install --index-url https://PYPI_HOST everysk-lib

```


## Running Tests

To run tests, run the following command in development VS Code environment:

```bash
  ./run.sh tests
```

Once this lib is installed from pypi on your project, to run tests use:

```bash
  python3 -m unittest everysk.core.tests
```


## Running Tests with coverage

To run tests with coverage report, run the following command:

```bash
  ./run.sh coverage
```


## Contributing

Contributions are always welcome!

Clone this repo from GIT and use it in VS Code with Dev Containers extension.


## License

(C) Copyright 2023 EVERYSK TECHNOLOGIES

This is an unpublished work containing confidential and proprietary
information of EVERYSK TECHNOLOGIES. Disclosure, use, or reproduction
without authorization of EVERYSK TECHNOLOGIES is prohibited.

Date: Jan 2023

Contact: contact@everysk.com

URL: https://everysk.com/
