# 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/
Raw data
{
"_id": null,
"home_page": null,
"name": "beta-everysk-lib",
"maintainer": null,
"docs_url": null,
"requires_python": ">=3.11",
"maintainer_email": null,
"keywords": "python, setuptools, development, lib",
"author": null,
"author_email": null,
"download_url": "https://files.pythonhosted.org/packages/b2/04/aa44b3a37747b9755c2c9673b30e4ba463fa3214820e93d1328bfb99c2e6/beta_everysk_lib-1.3.656.tar.gz",
"platform": null,
"description": "\n# Everysk Lib\n\nEverysk's library was developed with the aim of unifying python\ncodes to be used in various company projects.\n\n\n## Docker\n\nTo run the pypi server:\n\n```bash\n docker build --file ./docker/Dockerfile --target everysk_pypi_server --tag everysk_pypi_server:latest .\n 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\n```\n\nTo build the library and send to Pypi server:\n\n```bash\n docker build --file ./docker/Dockerfile --target everysk_lib_build --tag everysk_lib_build:latest .\n docker run --rm -it -e PYPI_PASSWORD='123123' -e PYPI_HOST='192.168.0.116' everysk_lib_build:latest\n\n```\n\n## Usage/Examples\n\nModule object and fields are used to create class with consistent data.\n\n```python\n >>> from everysk.core.fields import BoolField\n >>> from everysk.core.object import BaseDict\n >>>\n >>> class MyClass(BaseDict):\n ... field: BoolField(required=True)\n >>>\n >>> obj = MyClass(field=True)\n >>> obj.field is True\n ... True\n >>> obj.field == obj['field']\n ... True\n\n```\n\nModule http has connection base class to use on HTTP Methods.\n\n```python\n >>> from everysk.core.http import HttpGETConnection\n >>>\n >>> class MyConnection(HttpGETConnection):\n ... url: StrField(defautl='https://example.com', readonly=True)\n ... def get_params(self) -> dict:\n ... # Will be added to url p=1&p=2\n ... return {'p': 1, 'p': 2}\n ...\n ... def message_error_check(self, message: str) -> bool:\n ... # If this message appear on HttpError then we try again.\n ... return 'server is busy' in message\n >>>\n >>> response = MyConnection().get_response()\n\n```\n\nModule settings is the sum of all settings.py created on the project.\nEvery setting will have it's value first from env otherwise from the attribute.\n\n```python\n >>> from everysk.core.config import settings\n >>> settings.DEBUG\n True\n\n```\n\nModule firestore.DocumentCached is a Redis/Firestore document. This uses Redis for\nread the data and Redis/Firestore to store the data. To keep the cache synchronized\nwith Firestore, use everysk/cloud_function. With this when we alter the data using\nFirestore interface the cache will be updated.\n\n```python\n >>> from everysk.core.firestore import DocumentCached\n >>> doc = Document(_collection_name='collection', firestore_id='firestore_id')\n >>> doc.firestore_id\n 'firestore_id'\n\n```\n\n## Installation\n\nInstall everysk-lib with pip:\n\n```bash\n pip install --index-url https://PYPI_HOST everysk-lib\n\n```\n\n\n## Running Tests\n\nTo run tests, run the following command in development VS Code environment:\n\n```bash\n ./run.sh tests\n```\n\nOnce this lib is installed from pypi on your project, to run tests use:\n\n```bash\n python3 -m unittest everysk.core.tests\n```\n\n\n## Running Tests with coverage\n\nTo run tests with coverage report, run the following command:\n\n```bash\n ./run.sh coverage\n```\n\n\n## Contributing\n\nContributions are always welcome!\n\nClone this repo from GIT and use it in VS Code with Dev Containers extension.\n\n\n## License\n\n(C) Copyright 2023 EVERYSK TECHNOLOGIES\n\nThis is an unpublished work containing confidential and proprietary\ninformation of EVERYSK TECHNOLOGIES. Disclosure, use, or reproduction\nwithout authorization of EVERYSK TECHNOLOGIES is prohibited.\n\nDate: Jan 2023\n\nContact: contact@everysk.com\n\nURL: https://everysk.com/\n",
"bugtrack_url": null,
"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/",
"summary": "Generic lib to share python code on Everysk.",
"version": "1.3.656",
"project_urls": null,
"split_keywords": [
"python",
" setuptools",
" development",
" lib"
],
"urls": [
{
"comment_text": "",
"digests": {
"blake2b_256": "4d48281a6598b9d6cf3b231f49bc6cd471f563947e2a4786c4e66417f1d59133",
"md5": "778694340822c8fd06ce11d894073d08",
"sha256": "3e949cf8339f02ee182ff3e6ca2bcccc544f8ea773b0b08cb4d575129cd0438c"
},
"downloads": -1,
"filename": "beta_everysk_lib-1.3.656-py3-none-any.whl",
"has_sig": false,
"md5_digest": "778694340822c8fd06ce11d894073d08",
"packagetype": "bdist_wheel",
"python_version": "py3",
"requires_python": ">=3.11",
"size": 184013,
"upload_time": "2024-04-24T20:54:11",
"upload_time_iso_8601": "2024-04-24T20:54:11.752984Z",
"url": "https://files.pythonhosted.org/packages/4d/48/281a6598b9d6cf3b231f49bc6cd471f563947e2a4786c4e66417f1d59133/beta_everysk_lib-1.3.656-py3-none-any.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": "",
"digests": {
"blake2b_256": "b204aa44b3a37747b9755c2c9673b30e4ba463fa3214820e93d1328bfb99c2e6",
"md5": "eb218e619d3d69920b41707c52278934",
"sha256": "8237543cdd33609364668f328d9e1c885811439bde399ac89527f01898732da1"
},
"downloads": -1,
"filename": "beta_everysk_lib-1.3.656.tar.gz",
"has_sig": false,
"md5_digest": "eb218e619d3d69920b41707c52278934",
"packagetype": "sdist",
"python_version": "source",
"requires_python": ">=3.11",
"size": 137188,
"upload_time": "2024-04-24T20:54:15",
"upload_time_iso_8601": "2024-04-24T20:54:15.044467Z",
"url": "https://files.pythonhosted.org/packages/b2/04/aa44b3a37747b9755c2c9673b30e4ba463fa3214820e93d1328bfb99c2e6/beta_everysk_lib-1.3.656.tar.gz",
"yanked": false,
"yanked_reason": null
}
],
"upload_time": "2024-04-24 20:54:15",
"github": false,
"gitlab": false,
"bitbucket": false,
"codeberg": false,
"lcname": "beta-everysk-lib"
}