half-orm-dev


Namehalf-orm-dev JSON
Version 0.16.0a1 PyPI version JSON
download
home_pagehttps://github.com/collorg/halfORM_dev
Summaryhalf_orm development Framework.
upload_time2025-08-18 09:49:27
maintainerNone
docs_urlNone
authorJoël Maïzi
requires_pythonNone
licenseGNU General Public License v3 (GPLv3)
keywords postgres relation-object mapping
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage No coveralls.
            # halfORM packager (early alpha stage)

> **📢 Project Evolution Notice**
>
> **halfORM_dev is being redesigned to integrate with halfORM 0.16's new extension system.**
>
> This project will be refactored as `half-orm-dev` to provide development tools through the unified `half_orm` CLI interface. The core functionality (project management, database patches, code generation) will remain the same, but the integration and command structure will be modernized.
>
> **Current Status:**
> - halfORM core 0.16 with extension is about to be released
> - halfORM_dev refactoring will start soon
> - New `half-orm-dev` extension planned for Q3 2025
>
> **What's Changing:**
> - Commands will integrate with `half_orm dev` instead of standalone `hop`
> - Extension auto-discovery and security model
> - Simplified installation and configuration
> - Consistent CLI experience across all halfORM tools
>
> **For Current Users:**
> The existing halfORM_dev will continue to work as-is. The new extension will provide a migration path when ready.
>
> **Stay Updated:**
> Follow progress in [halfORM Discussions](https://github.com/collorg/halfORM/discussions) and [halfORM Issues](https://github.com/collorg/halfORM/issues).

---

THIS DOC IS A WORK IN PROGRESS...

This package allows you to patch/test a PostgreSQL model and its associated
Python code using the `hop` command.

It is based on the [half_orm](https://github.com/collorg/halfORM)
PostgreSQL → Python relation object mapper.


## Installation

Run `pip install half_orm_dev`.

## help

```
$ hop --help
Usage: hop [OPTIONS] COMMAND [ARGS]...

  Generates/Synchronises/Patches a python package from a PostgreSQL database

Options:
  -v, --version
  --help         Show this message and exit.

Commands:
  new     Creates a new hop project named <package_name>.
  patch   Applies the next patch
  test    Tests some common pitfalls.
  update  Updates the Python code with the changes made to the model.
  ```

## Create a new package for your database: *`hop new`*

```
hop new <package name>
```

**WARNING!** The `hop new` command will add to your database
two new schemas: `half_orm_meta` and "`half_orm_meta.view`".
The table `half_orm_meta.release` will containt the patch history
of your model (see `hop patch` bellow).


```
$ hop new pagila
HALFORM_CONF_DIR: /home/joel/.halform
Using '/home/joel/.halform/pagila' file for connexion.
Initializing git with a 'main' branch.
Initializing the patch system for the 'pagila' database.
Patch system initialized at release '0.0.0'.

The hop project 'pagila' has been created.
```

The tree command shows you the repartition of the modules in your package.

```
$ tree pagila
pagila
├── Backups
│   └── pagila-pre-patch.sql
├── pagila
│   ├── base_test.py
│   ├── db_connector.py
│   ├── __init__.py
│   └── public
│       ├── actor_info.py
│       ├── actor_info_test.py
│       ├── actor.py
│       ├── actor_test.py
│       ├── address.py
│       ├── address_test.py
│       ├── category.py
│       ├── category_test.py
│       ├── city.py
│       ├── city_test.py
│       ├── country.py
│       ├── country_test.py
│       ├── customer_list.py
│       ├── customer_list_test.py
│       ├── customer.py
│       ├── customer_test.py
│       ├── film_actor.py
│       ├── film_actor_test.py
│       ├── film_category.py
│       ├── film_category_test.py
│       ├── film_list.py
│       ├── film_list_test.py
│       ├── film.py
│       ├── film_test.py
│       ├── __init__.py
│       ├── inventory.py
│       ├── inventory_test.py
│       ├── language.py
│       ├── language_test.py
│       ├── nicer_but_slower_film_list.py
│       ├── nicer_but_slower_film_list_test.py
│       ├── payment_p2020_01.py
│       ├── payment_p2020_01_test.py
│       ├── payment_p2020_02.py
│       ├── payment_p2020_02_test.py
│       ├── payment_p2020_03.py
│       ├── payment_p2020_03_test.py
│       ├── payment_p2020_04.py
│       ├── payment_p2020_04_test.py
│       ├── payment_p2020_05.py
│       ├── payment_p2020_05_test.py
│       ├── payment_p2020_06.py
│       ├── payment_p2020_06_test.py
│       ├── payment.py
│       ├── payment_test.py
│       ├── rental.py
│       ├── rental_test.py
│       ├── sales_by_film_category.py
│       ├── sales_by_film_category_test.py
│       ├── sales_by_store.py
│       ├── sales_by_store_test.py
│       ├── staff_list.py
│       ├── staff_list_test.py
│       ├── staff.py
│       ├── staff_test.py
│       ├── store.py
│       └── store_test.py
├── Patches
│   └── README
├── Pipfile
├── README.md
└── setup.py
```

Once created, go to the newly created directory

```
cd pagila
```

## The organisation

```
$ tree -d
.
├── Backups
├── pagila
│   └── public
└── Patches
```

You will now be able to manage your package with the `hop` command.

## Get the status of your package: *`hop`*

```
$ hop 
STATUS

        connection_file_name: pagila
        package_name: pagila
        
CURRENT RELEASE: 0.0.0: 2021-09-03 at 11:54:22+02:00
No new release to apply after 0.0.0.
Next possible releases: 0.0.1, 0.1.0, 1.0.0.
hop --help to get help.
```

## Patch your model: *`hop patch`*

```
$ hop patch
No new release to apply after 0.0.0.
Next possible releases: 0.0.1, 0.1.0, 1.0.0.
```

The patch system will try to find a next suitable patch to apply from the
last release number. If the last patch is X.Y.Z, `hop patch` will try in order
X.Y.<Z+1>, X.<Y+1>.Z, <X+1>.Y.Z.


To prepare a new patch, run `hop patch -p <patch_level>` where patch_level is one
of ['patch', 'minor', 'major']. The command will create a directory in 
`Patches/X/Y/Z` with a CHANGELOG.md description file. You can add in this
directory a series of patches scripts.
The scripts are applied in alphabetical order and can only be of two types:


* SQL with .sql extension
* Python with .py extension

If there is a suitable patch to apply, hop will create a branch `hop_<release>`,
backup the database in `Backups/<dbname>-<release>.sql`, apply the patch and
update the Python code.

In development, you will frequently need to adjust a patch.
To replay a patch, simply run `hop patch` again.

To revert to the previous patch run `hop patch -r`.
If your git repo is not clean, `hop patch` will complain. You can use `hop patch -f`
to avoid the warning.

You can use git as you wish during this phase.
## Generate a release (CI): *`hop release`* NotImplented

* `hop release -a` for alpha
* `hop release -c` for release candidate
* `hop release -p` for production

## Test your code

Each `hop patch` should test and report any error.

The package is test ready. For each module there is a test

```
$ pytest pagila/
================= test session starts =================
platform linux -- Python 3.8.5, pytest-6.2.5, py-1.10.0, pluggy-1.0.0
rootdir: /home/joel/Dev/halfORM_packager/tmp/pagila
collected 28 items                                    

pagila/public/actor_info_test.py .              [  3%]
pagila/public/actor_test.py .                   [  7%]
pagila/public/address_test.py .                 [ 10%]
pagila/public/category_test.py .                [ 14%]
pagila/public/city_test.py .                    [ 17%]
pagila/public/country_test.py .                 [ 21%]
pagila/public/customer_list_test.py .           [ 25%]
pagila/public/customer_test.py .                [ 28%]
pagila/public/film_actor_test.py .              [ 32%]
pagila/public/film_category_test.py .           [ 35%]
pagila/public/film_list_test.py .               [ 39%]
pagila/public/film_test.py .                    [ 42%]
pagila/public/inventory_test.py .               [ 46%]
pagila/public/language_test.py .                [ 50%]
pagila/public/nicer_but_slower_film_list_test.py . [ 53%]
                                                [ 53%]
pagila/public/payment_p2020_01_test.py .        [ 57%]
pagila/public/payment_p2020_02_test.py .        [ 60%]
pagila/public/payment_p2020_03_test.py .        [ 64%]
pagila/public/payment_p2020_04_test.py .        [ 67%]
pagila/public/payment_p2020_05_test.py .        [ 71%]
pagila/public/payment_p2020_06_test.py .        [ 75%]
pagila/public/payment_test.py .                 [ 78%]
pagila/public/rental_test.py .                  [ 82%]
pagila/public/sales_by_film_category_test.py .  [ 85%]
pagila/public/sales_by_store_test.py .          [ 89%]
pagila/public/staff_list_test.py .              [ 92%]
pagila/public/staff_test.py .                   [ 96%]
pagila/public/store_test.py .                   [100%]

================= 28 passed in 0.18s ==================
```

            

Raw data

            {
    "_id": null,
    "home_page": "https://github.com/collorg/halfORM_dev",
    "name": "half-orm-dev",
    "maintainer": null,
    "docs_url": null,
    "requires_python": null,
    "maintainer_email": null,
    "keywords": "postgres, relation-object mapping",
    "author": "Jo\u00ebl Ma\u00efzi",
    "author_email": "joel.maizi@collorg.org",
    "download_url": "https://files.pythonhosted.org/packages/6e/71/267893f00dc7ffe67b111c8909cd5333356f27b7734695122435a0de49f5/half_orm_dev-0.16.0a1.tar.gz",
    "platform": null,
    "description": "# halfORM packager (early alpha stage)\n\n> **\ud83d\udce2 Project Evolution Notice**\n>\n> **halfORM_dev is being redesigned to integrate with halfORM 0.16's new extension system.**\n>\n> This project will be refactored as `half-orm-dev` to provide development tools through the unified `half_orm` CLI interface. The core functionality (project management, database patches, code generation) will remain the same, but the integration and command structure will be modernized.\n>\n> **Current Status:**\n> - halfORM core 0.16 with extension is about to be released\n> - halfORM_dev refactoring will start soon\n> - New `half-orm-dev` extension planned for Q3 2025\n>\n> **What's Changing:**\n> - Commands will integrate with `half_orm dev` instead of standalone `hop`\n> - Extension auto-discovery and security model\n> - Simplified installation and configuration\n> - Consistent CLI experience across all halfORM tools\n>\n> **For Current Users:**\n> The existing halfORM_dev will continue to work as-is. The new extension will provide a migration path when ready.\n>\n> **Stay Updated:**\n> Follow progress in [halfORM Discussions](https://github.com/collorg/halfORM/discussions) and [halfORM Issues](https://github.com/collorg/halfORM/issues).\n\n---\n\nTHIS DOC IS A WORK IN PROGRESS...\n\nThis package allows you to patch/test a PostgreSQL model and its associated\nPython code using the `hop` command.\n\nIt is based on the [half_orm](https://github.com/collorg/halfORM)\nPostgreSQL &#8594; Python relation object mapper.\n\n\n## Installation\n\nRun `pip install half_orm_dev`.\n\n## help\n\n```\n$ hop --help\nUsage: hop [OPTIONS] COMMAND [ARGS]...\n\n  Generates/Synchronises/Patches a python package from a PostgreSQL database\n\nOptions:\n  -v, --version\n  --help         Show this message and exit.\n\nCommands:\n  new     Creates a new hop project named <package_name>.\n  patch   Applies the next patch\n  test    Tests some common pitfalls.\n  update  Updates the Python code with the changes made to the model.\n  ```\n\n## Create a new package for your database: *`hop new`*\n\n```\nhop new <package name>\n```\n\n**WARNING!** The `hop new` command will add to your database\ntwo new schemas: `half_orm_meta` and \"`half_orm_meta.view`\".\nThe table `half_orm_meta.release` will containt the patch history\nof your model (see `hop patch` bellow).\n\n\n```\n$ hop new pagila\nHALFORM_CONF_DIR: /home/joel/.halform\nUsing '/home/joel/.halform/pagila' file for connexion.\nInitializing git with a 'main' branch.\nInitializing the patch system for the 'pagila' database.\nPatch system initialized at release '0.0.0'.\n\nThe hop project 'pagila' has been created.\n```\n\nThe tree command shows you the repartition of the modules in your package.\n\n```\n$ tree pagila\npagila\n\u251c\u2500\u2500 Backups\n\u2502   \u2514\u2500\u2500 pagila-pre-patch.sql\n\u251c\u2500\u2500 pagila\n\u2502   \u251c\u2500\u2500 base_test.py\n\u2502   \u251c\u2500\u2500 db_connector.py\n\u2502   \u251c\u2500\u2500 __init__.py\n\u2502   \u2514\u2500\u2500 public\n\u2502       \u251c\u2500\u2500 actor_info.py\n\u2502       \u251c\u2500\u2500 actor_info_test.py\n\u2502       \u251c\u2500\u2500 actor.py\n\u2502       \u251c\u2500\u2500 actor_test.py\n\u2502       \u251c\u2500\u2500 address.py\n\u2502       \u251c\u2500\u2500 address_test.py\n\u2502       \u251c\u2500\u2500 category.py\n\u2502       \u251c\u2500\u2500 category_test.py\n\u2502       \u251c\u2500\u2500 city.py\n\u2502       \u251c\u2500\u2500 city_test.py\n\u2502       \u251c\u2500\u2500 country.py\n\u2502       \u251c\u2500\u2500 country_test.py\n\u2502       \u251c\u2500\u2500 customer_list.py\n\u2502       \u251c\u2500\u2500 customer_list_test.py\n\u2502       \u251c\u2500\u2500 customer.py\n\u2502       \u251c\u2500\u2500 customer_test.py\n\u2502       \u251c\u2500\u2500 film_actor.py\n\u2502       \u251c\u2500\u2500 film_actor_test.py\n\u2502       \u251c\u2500\u2500 film_category.py\n\u2502       \u251c\u2500\u2500 film_category_test.py\n\u2502       \u251c\u2500\u2500 film_list.py\n\u2502       \u251c\u2500\u2500 film_list_test.py\n\u2502       \u251c\u2500\u2500 film.py\n\u2502       \u251c\u2500\u2500 film_test.py\n\u2502       \u251c\u2500\u2500 __init__.py\n\u2502       \u251c\u2500\u2500 inventory.py\n\u2502       \u251c\u2500\u2500 inventory_test.py\n\u2502       \u251c\u2500\u2500 language.py\n\u2502       \u251c\u2500\u2500 language_test.py\n\u2502       \u251c\u2500\u2500 nicer_but_slower_film_list.py\n\u2502       \u251c\u2500\u2500 nicer_but_slower_film_list_test.py\n\u2502       \u251c\u2500\u2500 payment_p2020_01.py\n\u2502       \u251c\u2500\u2500 payment_p2020_01_test.py\n\u2502       \u251c\u2500\u2500 payment_p2020_02.py\n\u2502       \u251c\u2500\u2500 payment_p2020_02_test.py\n\u2502       \u251c\u2500\u2500 payment_p2020_03.py\n\u2502       \u251c\u2500\u2500 payment_p2020_03_test.py\n\u2502       \u251c\u2500\u2500 payment_p2020_04.py\n\u2502       \u251c\u2500\u2500 payment_p2020_04_test.py\n\u2502       \u251c\u2500\u2500 payment_p2020_05.py\n\u2502       \u251c\u2500\u2500 payment_p2020_05_test.py\n\u2502       \u251c\u2500\u2500 payment_p2020_06.py\n\u2502       \u251c\u2500\u2500 payment_p2020_06_test.py\n\u2502       \u251c\u2500\u2500 payment.py\n\u2502       \u251c\u2500\u2500 payment_test.py\n\u2502       \u251c\u2500\u2500 rental.py\n\u2502       \u251c\u2500\u2500 rental_test.py\n\u2502       \u251c\u2500\u2500 sales_by_film_category.py\n\u2502       \u251c\u2500\u2500 sales_by_film_category_test.py\n\u2502       \u251c\u2500\u2500 sales_by_store.py\n\u2502       \u251c\u2500\u2500 sales_by_store_test.py\n\u2502       \u251c\u2500\u2500 staff_list.py\n\u2502       \u251c\u2500\u2500 staff_list_test.py\n\u2502       \u251c\u2500\u2500 staff.py\n\u2502       \u251c\u2500\u2500 staff_test.py\n\u2502       \u251c\u2500\u2500 store.py\n\u2502       \u2514\u2500\u2500 store_test.py\n\u251c\u2500\u2500 Patches\n\u2502   \u2514\u2500\u2500 README\n\u251c\u2500\u2500 Pipfile\n\u251c\u2500\u2500 README.md\n\u2514\u2500\u2500 setup.py\n```\n\nOnce created, go to the newly created directory\n\n```\ncd pagila\n```\n\n## The organisation\n\n```\n$ tree -d\n.\n\u251c\u2500\u2500 Backups\n\u251c\u2500\u2500 pagila\n\u2502   \u2514\u2500\u2500 public\n\u2514\u2500\u2500 Patches\n```\n\nYou will now be able to manage your package with the `hop` command.\n\n## Get the status of your package: *`hop`*\n\n```\n$ hop \nSTATUS\n\n        connection_file_name: pagila\n        package_name: pagila\n        \nCURRENT RELEASE: 0.0.0: 2021-09-03 at 11:54:22+02:00\nNo new release to apply after 0.0.0.\nNext possible releases: 0.0.1, 0.1.0, 1.0.0.\nhop --help to get help.\n```\n\n## Patch your model: *`hop patch`*\n\n```\n$ hop patch\nNo new release to apply after 0.0.0.\nNext possible releases: 0.0.1, 0.1.0, 1.0.0.\n```\n\nThe patch system will try to find a next suitable patch to apply from the\nlast release number. If the last patch is X.Y.Z, `hop patch` will try in order\nX.Y.<Z+1>, X.<Y+1>.Z, <X+1>.Y.Z.\n\n\nTo prepare a new patch, run `hop patch -p <patch_level>` where patch_level is one\nof ['patch', 'minor', 'major']. The command will create a directory in \n`Patches/X/Y/Z` with a CHANGELOG.md description file. You can add in this\ndirectory a series of patches scripts.\nThe scripts are applied in alphabetical order and can only be of two types:\n\n\n* SQL with .sql extension\n* Python with .py extension\n\nIf there is a suitable patch to apply, hop will create a branch `hop_<release>`,\nbackup the database in `Backups/<dbname>-<release>.sql`, apply the patch and\nupdate the Python code.\n\nIn development, you will frequently need to adjust a patch.\nTo replay a patch, simply run `hop patch` again.\n\nTo revert to the previous patch run `hop patch -r`.\nIf your git repo is not clean, `hop patch` will complain. You can use `hop patch -f`\nto avoid the warning.\n\nYou can use git as you wish during this phase.\n## Generate a release (CI): *`hop release`* NotImplented\n\n* `hop release -a` for alpha\n* `hop release -c` for release candidate\n* `hop release -p` for production\n\n## Test your code\n\nEach `hop patch` should test and report any error.\n\nThe package is test ready. For each module there is a test\n\n```\n$ pytest pagila/\n================= test session starts =================\nplatform linux -- Python 3.8.5, pytest-6.2.5, py-1.10.0, pluggy-1.0.0\nrootdir: /home/joel/Dev/halfORM_packager/tmp/pagila\ncollected 28 items                                    \n\npagila/public/actor_info_test.py .              [  3%]\npagila/public/actor_test.py .                   [  7%]\npagila/public/address_test.py .                 [ 10%]\npagila/public/category_test.py .                [ 14%]\npagila/public/city_test.py .                    [ 17%]\npagila/public/country_test.py .                 [ 21%]\npagila/public/customer_list_test.py .           [ 25%]\npagila/public/customer_test.py .                [ 28%]\npagila/public/film_actor_test.py .              [ 32%]\npagila/public/film_category_test.py .           [ 35%]\npagila/public/film_list_test.py .               [ 39%]\npagila/public/film_test.py .                    [ 42%]\npagila/public/inventory_test.py .               [ 46%]\npagila/public/language_test.py .                [ 50%]\npagila/public/nicer_but_slower_film_list_test.py . [ 53%]\n                                                [ 53%]\npagila/public/payment_p2020_01_test.py .        [ 57%]\npagila/public/payment_p2020_02_test.py .        [ 60%]\npagila/public/payment_p2020_03_test.py .        [ 64%]\npagila/public/payment_p2020_04_test.py .        [ 67%]\npagila/public/payment_p2020_05_test.py .        [ 71%]\npagila/public/payment_p2020_06_test.py .        [ 75%]\npagila/public/payment_test.py .                 [ 78%]\npagila/public/rental_test.py .                  [ 82%]\npagila/public/sales_by_film_category_test.py .  [ 85%]\npagila/public/sales_by_store_test.py .          [ 89%]\npagila/public/staff_list_test.py .              [ 92%]\npagila/public/staff_test.py .                   [ 96%]\npagila/public/store_test.py .                   [100%]\n\n================= 28 passed in 0.18s ==================\n```\n",
    "bugtrack_url": null,
    "license": "GNU General Public License v3 (GPLv3)",
    "summary": "half_orm development Framework.",
    "version": "0.16.0a1",
    "project_urls": {
        "Homepage": "https://github.com/collorg/halfORM_dev"
    },
    "split_keywords": [
        "postgres",
        " relation-object mapping"
    ],
    "urls": [
        {
            "comment_text": null,
            "digests": {
                "blake2b_256": "e9c29ff2e2d2ff56043ad837ab657f1d3c9723b9d4566b62831734842ee17f65",
                "md5": "0f5c7694e7640fb0cb7f2faf2282e201",
                "sha256": "023ab47f13af66e058497ffd178c53df808c6257449e90351d50bf09b24a6a4e"
            },
            "downloads": -1,
            "filename": "half_orm_dev-0.16.0a1-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "0f5c7694e7640fb0cb7f2faf2282e201",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": null,
            "size": 37460,
            "upload_time": "2025-08-18T09:49:25",
            "upload_time_iso_8601": "2025-08-18T09:49:25.778271Z",
            "url": "https://files.pythonhosted.org/packages/e9/c2/9ff2e2d2ff56043ad837ab657f1d3c9723b9d4566b62831734842ee17f65/half_orm_dev-0.16.0a1-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": null,
            "digests": {
                "blake2b_256": "6e71267893f00dc7ffe67b111c8909cd5333356f27b7734695122435a0de49f5",
                "md5": "17af23e738a8e5ecc4973c067acbdbb5",
                "sha256": "dccfe8921d827e87f5b455090eb585eb68ea429cae40e4ba76177b27df19c606"
            },
            "downloads": -1,
            "filename": "half_orm_dev-0.16.0a1.tar.gz",
            "has_sig": false,
            "md5_digest": "17af23e738a8e5ecc4973c067acbdbb5",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": null,
            "size": 31464,
            "upload_time": "2025-08-18T09:49:27",
            "upload_time_iso_8601": "2025-08-18T09:49:27.062751Z",
            "url": "https://files.pythonhosted.org/packages/6e/71/267893f00dc7ffe67b111c8909cd5333356f27b7734695122435a0de49f5/half_orm_dev-0.16.0a1.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2025-08-18 09:49:27",
    "github": true,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "github_user": "collorg",
    "github_project": "halfORM_dev",
    "travis_ci": false,
    "coveralls": false,
    "github_actions": true,
    "lcname": "half-orm-dev"
}
        
Elapsed time: 0.64747s