greendeploy-django-ltree


Namegreendeploy-django-ltree JSON
Version 0.5.3 PyPI version JSON
download
home_pagehttps://github.com/GreenDeploy-io/greendeploy-django-ltree
SummaryDjango app to support ltree postgres extension
upload_time2023-09-18 01:36:51
maintainerKimsia Sim
docs_urlNone
authorKimSia Sim
requires_python>=2.7
licenseMIT
keywords django ltree postgres
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage
            ===================
greendeploy-django-ltree
===================

.. image:: https://img.shields.io/github/actions/workflow/status/GreenDeploy-io/greendeploy-django-ltree/main.yml?branch=main&style=for-the-badge
   :target: https://github.com/GreenDeploy-io/greendeploy-django-ltree/actions?workflow=CI

.. image:: https://img.shields.io/badge/Coverage-100%25-success?style=for-the-badge
  :target: https://github.com/GreenDeploy-io/greendeploy-django-ltree/actions?workflow=CI

.. image:: https://img.shields.io/pypi/v/greendeploy-django-ltree.svg?style=for-the-badge
    :target: https://pypi.org/project/greendeploy-django-ltree/

.. image:: https://img.shields.io/badge/code%20style-black-000000.svg?style=for-the-badge
    :target: https://github.com/psf/black

.. image:: https://img.shields.io/badge/pre--commit-enabled-brightgreen?logo=pre-commit&logoColor=white&style=for-the-badge
   :target: https://github.com/pre-commit/pre-commit
   :alt: pre-commit

The authoritative and broadly useful Django package for using Postgres
ltree fields in your Django models, designed to be transparent and
accessible for Django beginners.

Welcome
-------

Welcome to greendeploy-django-ltree, your go-to package for handling PostgreSQL
ltree fields in a Django project. We're mindful of the end-to-end context and
aim to make this package not just a code repository but **a complete learning
experience**.

We aim to achieve this in three ways:

1. **Beginner-friendly documentation**: We specifically tailor the
    documentation to help Django newcomers and include end-to-end
    demonstrations that make no assumptions about your prior knowledge of
    ltree or materialized paths.

2. **Quick, early wins in 10 mins each**: We have picked 3 base cases as early
    wins for you. Each of these should take you no more than 10 mins to
    complete, including reading the docs.

    - **Install in sandbox project**: We show you how to install the package
        in a sandbox project and create the field in your Postgres database.
    - **Add materialized path in ltree field**: We show you how to add data
        to your ltree field using your Django ORM.
    - **Query ltree field**: We show you how to query your ltree field using
        Django ORM.

3. **Active maintenance**: We are committed to maintaining this package and
    keeping it up to date with the latest Django, Python, and Postgres versions.
    We have plans to measure the mean time to close the Github issues and will
    reveal them in the near future.

About ltree
------------

`ltree` is a data type in Postgres database. It is a tree-like structure
where each node is a __label__. The label can be a string or a number.

Thus, the piece of data is basically a **string of labels separated by dots**.
Also known as a __label__ __path__.

A label consists of `A-Za-z0-9_` and can be up to 255 characters long.

The length of a label path is a maximum 65535 labels long.

An example of a label path is `Top.Countries.Europe.Russia` where `Top` is the
root node and `Russia` is the leaf node.

There's another name for label path that's more better known which is
`Materialized Path` coined by `Vadim Tropashko <http://vadimtropashko.wordpress.com/>`__
in `SQL Design Patterns <http://www.rampant-books.com/book_0601_sql_coding_styles.htm>`__.

Some good resources to read on the subject are:

* Postgres' own `documentation <https://www.postgresql.org/docs/current/ltree.html>`__
* Vadim Tropashko's `Nested Sets and Materialized Path SQL Trees <http://www.rampant-books.com/art_vadim_nested_sets_sql_trees.htm>`__
* `django-treebeard`'s `Materialized Path trees <https://django-treebeard.readthedocs.io/en/latest/mp_tree.html>`_


Requirements
------------

Postgres 15 supported.

Python 3.8 to 3.11 supported.

Django 4.2 supported.


----

Setup
-----

Install from **pip**:

.. code-block:: sh

    python -m pip install greendeploy-django-ltree

and then add it to your installed apps:

.. code-block:: python

    INSTALLED_APPS = [
        ...,
        "greendeploy-django-ltree",
        ...,
    ]

Make sure you add the trailing comma or you might get a ``ModuleNotFoundError``
(see `this blog
post <https://adamj.eu/tech/2020/06/29/why-does-python-raise-modulenotfounderror-when-modifying-installed-apps/>`__).

You will also need to run `django_ltree` migrations before you added the `PathField`.

See Quick Start below and in documentation for more details.


About
-----

**django-ltree** (`Github repository <https://github.com/mariocesar/django-ltree>`__) was
created in March 2020 by Mario-César. It went unmaintained from August 2021.

Kimsia Sim was motivated to fork it under the name **greendeploy-django-ltree** in September 2023
and make it support Django 4.2. The reason is that Kimsia needed to use it in a Django 4.2 project.

The pypi package name is under
`greendeploy-django-ltree <https://pypi.org/project/greendeploy-django-ltree/>`__ and formally
published on 11th September 2023.

**greendeploy-django-ltree** has had `close to 10 contributors
<https://github.com/greendeploy-io/greendeploy-django-ltree/graphs/contributors>`__
in its time; gratitude and a big thank you to every one of them.

Quick Start
-------------

@TODO: Add quick start here.

            

Raw data

            {
    "_id": null,
    "home_page": "https://github.com/GreenDeploy-io/greendeploy-django-ltree",
    "name": "greendeploy-django-ltree",
    "maintainer": "Kimsia Sim",
    "docs_url": null,
    "requires_python": ">=2.7",
    "maintainer_email": "",
    "keywords": "django,ltree,postgres",
    "author": "KimSia Sim",
    "author_email": "kimsia@oppoin.com",
    "download_url": "https://files.pythonhosted.org/packages/8f/43/8aeb299cf9136023ff0d0c0f9f36a5d1a490048c481a52233f86042ecd76/greendeploy-django-ltree-0.5.3.tar.gz",
    "platform": null,
    "description": "===================\ngreendeploy-django-ltree\n===================\n\n.. image:: https://img.shields.io/github/actions/workflow/status/GreenDeploy-io/greendeploy-django-ltree/main.yml?branch=main&style=for-the-badge\n   :target: https://github.com/GreenDeploy-io/greendeploy-django-ltree/actions?workflow=CI\n\n.. image:: https://img.shields.io/badge/Coverage-100%25-success?style=for-the-badge\n  :target: https://github.com/GreenDeploy-io/greendeploy-django-ltree/actions?workflow=CI\n\n.. image:: https://img.shields.io/pypi/v/greendeploy-django-ltree.svg?style=for-the-badge\n    :target: https://pypi.org/project/greendeploy-django-ltree/\n\n.. image:: https://img.shields.io/badge/code%20style-black-000000.svg?style=for-the-badge\n    :target: https://github.com/psf/black\n\n.. image:: https://img.shields.io/badge/pre--commit-enabled-brightgreen?logo=pre-commit&logoColor=white&style=for-the-badge\n   :target: https://github.com/pre-commit/pre-commit\n   :alt: pre-commit\n\nThe authoritative and broadly useful Django package for using Postgres\nltree fields in your Django models, designed to be transparent and\naccessible for Django beginners.\n\nWelcome\n-------\n\nWelcome to greendeploy-django-ltree, your go-to package for handling PostgreSQL\nltree fields in a Django project. We're mindful of the end-to-end context and\naim to make this package not just a code repository but **a complete learning\nexperience**.\n\nWe aim to achieve this in three ways:\n\n1. **Beginner-friendly documentation**: We specifically tailor the\n    documentation to help Django newcomers and include end-to-end\n    demonstrations that make no assumptions about your prior knowledge of\n    ltree or materialized paths.\n\n2. **Quick, early wins in 10 mins each**: We have picked 3 base cases as early\n    wins for you. Each of these should take you no more than 10 mins to\n    complete, including reading the docs.\n\n    - **Install in sandbox project**: We show you how to install the package\n        in a sandbox project and create the field in your Postgres database.\n    - **Add materialized path in ltree field**: We show you how to add data\n        to your ltree field using your Django ORM.\n    - **Query ltree field**: We show you how to query your ltree field using\n        Django ORM.\n\n3. **Active maintenance**: We are committed to maintaining this package and\n    keeping it up to date with the latest Django, Python, and Postgres versions.\n    We have plans to measure the mean time to close the Github issues and will\n    reveal them in the near future.\n\nAbout ltree\n------------\n\n`ltree` is a data type in Postgres database. It is a tree-like structure\nwhere each node is a __label__. The label can be a string or a number.\n\nThus, the piece of data is basically a **string of labels separated by dots**.\nAlso known as a __label__ __path__.\n\nA label consists of `A-Za-z0-9_` and can be up to 255 characters long.\n\nThe length of a label path is a maximum 65535 labels long.\n\nAn example of a label path is `Top.Countries.Europe.Russia` where `Top` is the\nroot node and `Russia` is the leaf node.\n\nThere's another name for label path that's more better known which is\n`Materialized Path` coined by `Vadim Tropashko <http://vadimtropashko.wordpress.com/>`__\nin `SQL Design Patterns <http://www.rampant-books.com/book_0601_sql_coding_styles.htm>`__.\n\nSome good resources to read on the subject are:\n\n* Postgres' own `documentation <https://www.postgresql.org/docs/current/ltree.html>`__\n* Vadim Tropashko's `Nested Sets and Materialized Path SQL Trees <http://www.rampant-books.com/art_vadim_nested_sets_sql_trees.htm>`__\n* `django-treebeard`'s `Materialized Path trees <https://django-treebeard.readthedocs.io/en/latest/mp_tree.html>`_\n\n\nRequirements\n------------\n\nPostgres 15 supported.\n\nPython 3.8 to 3.11 supported.\n\nDjango 4.2 supported.\n\n\n----\n\nSetup\n-----\n\nInstall from **pip**:\n\n.. code-block:: sh\n\n    python -m pip install greendeploy-django-ltree\n\nand then add it to your installed apps:\n\n.. code-block:: python\n\n    INSTALLED_APPS = [\n        ...,\n        \"greendeploy-django-ltree\",\n        ...,\n    ]\n\nMake sure you add the trailing comma or you might get a ``ModuleNotFoundError``\n(see `this blog\npost <https://adamj.eu/tech/2020/06/29/why-does-python-raise-modulenotfounderror-when-modifying-installed-apps/>`__).\n\nYou will also need to run `django_ltree` migrations before you added the `PathField`.\n\nSee Quick Start below and in documentation for more details.\n\n\nAbout\n-----\n\n**django-ltree** (`Github repository <https://github.com/mariocesar/django-ltree>`__) was\ncreated in March 2020 by Mario-C\u00e9sar. It went unmaintained from August 2021.\n\nKimsia Sim was motivated to fork it under the name **greendeploy-django-ltree** in September 2023\nand make it support Django 4.2. The reason is that Kimsia needed to use it in a Django 4.2 project.\n\nThe pypi package name is under\n`greendeploy-django-ltree <https://pypi.org/project/greendeploy-django-ltree/>`__ and formally\npublished on 11th September 2023.\n\n**greendeploy-django-ltree** has had `close to 10 contributors\n<https://github.com/greendeploy-io/greendeploy-django-ltree/graphs/contributors>`__\nin its time; gratitude and a big thank you to every one of them.\n\nQuick Start\n-------------\n\n@TODO: Add quick start here.\n",
    "bugtrack_url": null,
    "license": "MIT",
    "summary": "Django app to support ltree postgres extension",
    "version": "0.5.3",
    "project_urls": {
        "Homepage": "https://github.com/GreenDeploy-io/greendeploy-django-ltree",
        "Source": "https://github.com/GreenDeploy-io/greendeploy-django-ltree",
        "Tracker": "https://github.com/GreenDeploy-io/greendeploy-django-ltree/issues"
    },
    "split_keywords": [
        "django",
        "ltree",
        "postgres"
    ],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "ee8099f3c6d198174c3fe227a8b1d4289097dd3116a08f784223a66cb9cd2529",
                "md5": "253f19f3c953feff75279cd82016bd64",
                "sha256": "d296e318fd9591d093c194da41cf081c8d5123cf5c9292dde0fb444fe09c1b58"
            },
            "downloads": -1,
            "filename": "greendeploy_django_ltree-0.5.3-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "253f19f3c953feff75279cd82016bd64",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": ">=2.7",
            "size": 10276,
            "upload_time": "2023-09-18T01:36:49",
            "upload_time_iso_8601": "2023-09-18T01:36:49.731227Z",
            "url": "https://files.pythonhosted.org/packages/ee/80/99f3c6d198174c3fe227a8b1d4289097dd3116a08f784223a66cb9cd2529/greendeploy_django_ltree-0.5.3-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "8f438aeb299cf9136023ff0d0c0f9f36a5d1a490048c481a52233f86042ecd76",
                "md5": "83c138aeed7a01d81b798fc6bd518b77",
                "sha256": "1ebbc5e7d09828112f0b067969ee70061d5aa1275116417d43910314ae392600"
            },
            "downloads": -1,
            "filename": "greendeploy-django-ltree-0.5.3.tar.gz",
            "has_sig": false,
            "md5_digest": "83c138aeed7a01d81b798fc6bd518b77",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": ">=2.7",
            "size": 11790,
            "upload_time": "2023-09-18T01:36:51",
            "upload_time_iso_8601": "2023-09-18T01:36:51.794822Z",
            "url": "https://files.pythonhosted.org/packages/8f/43/8aeb299cf9136023ff0d0c0f9f36a5d1a490048c481a52233f86042ecd76/greendeploy-django-ltree-0.5.3.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2023-09-18 01:36:51",
    "github": true,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "github_user": "GreenDeploy-io",
    "github_project": "greendeploy-django-ltree",
    "travis_ci": false,
    "coveralls": true,
    "github_actions": true,
    "requirements": [],
    "tox": true,
    "lcname": "greendeploy-django-ltree"
}
        
Elapsed time: 0.15846s