giant-utils


Namegiant-utils JSON
Version 0.2 PyPI version JSON
download
home_pagehttps://github.com/giantmade/giant-utils
SummaryA small reusable package that adds small commonly used functions to a project
upload_time2023-07-10 08:39:27
maintainer
docs_urlNone
authorDominic-Chaple
requires_python>3.7,<4
licenseMIT
keywords app
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage No coveralls.
            # Giant Utils

A re-usable package which can be used in any django project that allows small common use functions such as an email with text and/or html templates to be sent. 

Other functionality includes a format_bytes method that takes a byte size of file and converts it to a human-readable number with the appropriate Byte suffix (useful for download files).

Also includes a rich text field that can be used in various plugins where the admin may want to insert links or custom html.

## Installation

To install with the package manager, run:

    $ poetry add giant-utils

You should then add "giant_utils" to the `INSTALLED_APPS` in your project's settings file.  Then wherever you want to implement the function you can add the following import statements...

    from giant_utils.sender import send_email_from_template
    from giant_utils.format_bytes import format_bytes
    from giant_utils.fields import RichTextField

## Rich Text Field 

This field can be customised by adding your own WYSIWYG_CONFIG variable to your project's settings. Otherwise it will fallback to the default below...

    DEFAULT_WYSIWYG_CONFIG = {
        "lang": "en",
        "minHeight": "300px",
        "buttons": "html | format | undo redo | bold italic | ul ol | link | sub sup".split(),
        "formatting": ["h1", "h2", "h3", "p"],
        "linkTitle": True,
        "linkNewTab": True,
        "structure": True,
        "removeNewLines": True,
        "pasteImages": False,
        "tabAsSpaces": 4,
        "plugins": ["table"],
    }

## Pre-requisites

The minimum package dependencies for this project are as follows...

- Django 4.0
- python 3.11


## Preparing for release
 
 In order to prep the package for a new release on TestPyPi and PyPi there is one key thing that you need to do. You need to update the version number in the `pyproject.toml`.
 This is so that the package can be published without running into version number conflicts. The version numbering must also follow the Semantic Version rules which can be found here https://semver.org/.
 
## Publishing
 
 Publishing a package with poetry is incredibly easy. Once you have checked that the version number has been updated (not the same as a previous version) then you only need to run two commands.
 
    $ `poetry build` 

will package the project up for you into a way that can be published.
 
    $ `poetry publish`

will publish the package to PyPi. You will need to enter the username and password for the account which can be found in the company password manager
            

Raw data

            {
    "_id": null,
    "home_page": "https://github.com/giantmade/giant-utils",
    "name": "giant-utils",
    "maintainer": "",
    "docs_url": null,
    "requires_python": ">3.7,<4",
    "maintainer_email": "",
    "keywords": "app",
    "author": "Dominic-Chaple",
    "author_email": "dominic.chaple@giantdigital.co.uk",
    "download_url": "https://files.pythonhosted.org/packages/18/3e/c2f00e19d2e6d4c220fcc2ffdf5706271f8111715aa597f63f12266f9711/giant_utils-0.2.tar.gz",
    "platform": null,
    "description": "# Giant Utils\n\nA re-usable package which can be used in any django project that allows small common use functions such as an email with text and/or html templates to be sent. \n\nOther functionality includes a format_bytes method that takes a byte size of file and converts it to a human-readable number with the appropriate Byte suffix (useful for download files).\n\nAlso includes a rich text field that can be used in various plugins where the admin may want to insert links or custom html.\n\n## Installation\n\nTo install with the package manager, run:\n\n    $ poetry add giant-utils\n\nYou should then add \"giant_utils\" to the `INSTALLED_APPS` in your project's settings file.  Then wherever you want to implement the function you can add the following import statements...\n\n    from giant_utils.sender import send_email_from_template\n    from giant_utils.format_bytes import format_bytes\n    from giant_utils.fields import RichTextField\n\n## Rich Text Field \n\nThis field can be customised by adding your own WYSIWYG_CONFIG variable to your project's settings. Otherwise it will fallback to the default below...\n\n    DEFAULT_WYSIWYG_CONFIG = {\n        \"lang\": \"en\",\n        \"minHeight\": \"300px\",\n        \"buttons\": \"html | format | undo redo | bold italic | ul ol | link | sub sup\".split(),\n        \"formatting\": [\"h1\", \"h2\", \"h3\", \"p\"],\n        \"linkTitle\": True,\n        \"linkNewTab\": True,\n        \"structure\": True,\n        \"removeNewLines\": True,\n        \"pasteImages\": False,\n        \"tabAsSpaces\": 4,\n        \"plugins\": [\"table\"],\n    }\n\n## Pre-requisites\n\nThe minimum package dependencies for this project are as follows...\n\n- Django 4.0\n- python 3.11\n\n\n## Preparing for release\n \n In order to prep the package for a new release on TestPyPi and PyPi there is one key thing that you need to do. You need to update the version number in the `pyproject.toml`.\n This is so that the package can be published without running into version number conflicts. The version numbering must also follow the Semantic Version rules which can be found here https://semver.org/.\n \n## Publishing\n \n Publishing a package with poetry is incredibly easy. Once you have checked that the version number has been updated (not the same as a previous version) then you only need to run two commands.\n \n    $ `poetry build` \n\nwill package the project up for you into a way that can be published.\n \n    $ `poetry publish`\n\nwill publish the package to PyPi. You will need to enter the username and password for the account which can be found in the company password manager",
    "bugtrack_url": null,
    "license": "MIT",
    "summary": "A small reusable package that adds small commonly used functions to a project",
    "version": "0.2",
    "project_urls": {
        "Homepage": "https://github.com/giantmade/giant-utils",
        "Repository": "https://github.com/giantmade/giant-utils"
    },
    "split_keywords": [
        "app"
    ],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "7c0489090f258b8af454bdd337440e2f40ee636eadcbd60e2149e02df8c764cf",
                "md5": "d4fe2b09f3c19f6bf1077551067926b5",
                "sha256": "783840a47eda5ca9ce7d84d29d28aa4fd8923cfaf00fd61bfc8fc284542cbc3d"
            },
            "downloads": -1,
            "filename": "giant_utils-0.2-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "d4fe2b09f3c19f6bf1077551067926b5",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": ">3.7,<4",
            "size": 7502,
            "upload_time": "2023-07-10T08:39:26",
            "upload_time_iso_8601": "2023-07-10T08:39:26.080552Z",
            "url": "https://files.pythonhosted.org/packages/7c/04/89090f258b8af454bdd337440e2f40ee636eadcbd60e2149e02df8c764cf/giant_utils-0.2-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "183ec2f00e19d2e6d4c220fcc2ffdf5706271f8111715aa597f63f12266f9711",
                "md5": "9f85b8fee123b1f72ab0f3a074afc41e",
                "sha256": "1a41176cfc61fceae65fa32a7e56e2da11fea802f6df1e9b3e3fd98b916b5273"
            },
            "downloads": -1,
            "filename": "giant_utils-0.2.tar.gz",
            "has_sig": false,
            "md5_digest": "9f85b8fee123b1f72ab0f3a074afc41e",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": ">3.7,<4",
            "size": 5630,
            "upload_time": "2023-07-10T08:39:27",
            "upload_time_iso_8601": "2023-07-10T08:39:27.945524Z",
            "url": "https://files.pythonhosted.org/packages/18/3e/c2f00e19d2e6d4c220fcc2ffdf5706271f8111715aa597f63f12266f9711/giant_utils-0.2.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2023-07-10 08:39:27",
    "github": true,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "github_user": "giantmade",
    "github_project": "giant-utils",
    "github_not_found": true,
    "lcname": "giant-utils"
}
        
Elapsed time: 0.10143s