qjoin


Nameqjoin JSON
Version 0.1.0 PyPI version JSON
download
home_page
Summaryqjoin is a data manipulation library that provides simple and efficient joining and collection processing functionality
upload_time2023-08-27 10:14:43
maintainer
docs_urlNone
authorFabien Arcellier
requires_python>=3.8,<4.0
licenseMIT
keywords
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage No coveralls.
            ## qjoin

[![pypi](https://img.shields.io/pypi/v/qjoin.svg?label=version)](https://pypi.org/project/qjoin/)
[![python](https://img.shields.io/pypi/pyversions/qjoin.svg)](https://pypi.org/project/qjoin/)
[![CI tests](https://github.com/FabienArcellier/qjoin/actions/workflows/main.yml/badge.svg)](https://github.com/FabienArcellier/qjoin/actions/workflows/main.yml)
[![discord](https://img.shields.io/badge/discord-qjoin-5865F2?logo=discord&logoColor=white)](https://discord.gg/nMn9YPRGSY)
[![Documentation Status](https://readthedocs.org/projects/qjoin/badge/?version=latest)](https://qjoin.readthedocs.io/en/latest/?badge=latest)
![license](https://img.shields.io/pypi/l/qjoin
)

qjoin is a data manipulation library that provides simple and efficient joining and collection processing functionality. It simplifies and optimizes the process of joining different entities and provides methods for aggregating, organizing, and sorting data.

![principle diagram](https://github.com/FabienArcellier/qjoin/raw/master/docs/principle.png)

* qjoin is a simple and efficient way to join and process data
* qjoin is a steroid extension of the `zip` function in python
* qjoin works on all iterators, whether lists of dictionaries, objects or sqlalchemy or django models

## Project links

* [PyPI Releases](https://pypi.org/project/qjoin/)
* [Documentation](https://qjoin.readthedocs.io/en/latest/)
* [Source code](https://github.com/FabienArcellier/qjoin)
* [Issue tracker](https://github.com/FabienArcellier/qjoin/issues)
* [Chat](https://discord.gg/nMn9YPRGSY)

## Installation

```bash
pip install qjoin
```

## Usage

Here are examples of how qjoin will be used in the future.

```python
# Basic usage
qjoin.on(persons).join(cities, key="city").all()

person_infos = qjoin.on(persons).join(cities, left="city", right="city").all()
for person, city in person_infos:
    print(f'{person} - {city}')

person_infos = qjoin.on(persons) \
    .join(cities, left=lambda p: p.city, right=lambda c: c.city) \
    .join(cars, left=lambda p: p.car, right=lambda c: c.car) \
    .all()

for person, city, car in person_infos:
    print(f'{person} - {city} - {car}')

# Advanced transformation

qjoin.on(persons) \
    .join(cities, left=lambda p: p.city, right=lambda c: c.city) \
    .join(cars, left=lambda p: p.car, right=lambda c: c.car) \
    .as_aggregate(Aggregate, ['person', 'city', 'cars'])
```

#### TODO

The following syntaxes are to be implemented and documented. You want to discuss it, participate or suggest other syntaxes, join us on [discord](https://discord.gg/nMn9YPRGSY).

```python
# Advanced transformation

qjoin.on(persons) \
    .join(cities, left=lambda p: p.city, right=lambda c: c.city) \
    .join(cars, left=lambda p: p.car, right=lambda c: c.car) \
    .as_aggregate(Aggregate, lambda p, ci, ca: Aggregate(p, ci, ca))


qjoin.on(persons) \
    .join(cities, left=lambda p: p.city, right=lambda c: c.city) \
    .as_lookup(lambda p: p.name)

qjoin.on(persons) \
    .join(cities, left=lambda p: p.city, right=lambda c: c.city) \
    .as_multilookup(lambda p, c: c.city)

# Advanced

qjoin.on(persons) \
    .join(cities, left=lambda p: p.city, right=lambda c: c.city, scan_strategy=qjoin.RIGHT_LOOKUP)
    .join(cars, left=lambda p: p.car, right=lambda c: c.car, default=Car(car='unknown', constructor='unknown')) \
    .as_aggregate(Aggregate, lambda p, ci, ca: Aggregate(p, ci, ca))
```


### Try with docker

You can run this template with docker. The manufactured image can be distributed and used to deploy your application to a production environment.

```bash
docker-compose build
docker-compose run app
```

### Try with gitpod

[gitpod](https://www.gitpod.io/) can be used as an IDE. You can load the code inside to try the code.

[![Open in Gitpod](https://gitpod.io/button/open-in-gitpod.svg)](https://gitpod.io/#https://github.com/FabienArcellier/qjoin.git)

## The latest version

You can find the latest version to ...

```bash
git clone https://github.com/FabienArcellier/qjoin.git
```

## Contributing

If you want to discuss about it, contact us through [discord](https://discord.gg/nMn9YPRGSY)

Contributing to this project is done through merge request (pull request in github). You can contribute to this project by discovering bugs, opening issues or submitting merge request.

more in [CONTRIBUTING.md](./CONTRIBUTING.md)

## License

MIT License

Copyright (c) 2023-2023 Fabien Arcellier

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.


            

Raw data

            {
    "_id": null,
    "home_page": "",
    "name": "qjoin",
    "maintainer": "",
    "docs_url": null,
    "requires_python": ">=3.8,<4.0",
    "maintainer_email": "",
    "keywords": "",
    "author": "Fabien Arcellier",
    "author_email": "fabien.arcellier@gmail.com",
    "download_url": "https://files.pythonhosted.org/packages/a0/29/f3f7daf7b989c8c4c77a40ce6192cf6b64f8df49c738fefa6facbcc76a23/qjoin-0.1.0.tar.gz",
    "platform": null,
    "description": "## qjoin\n\n[![pypi](https://img.shields.io/pypi/v/qjoin.svg?label=version)](https://pypi.org/project/qjoin/)\n[![python](https://img.shields.io/pypi/pyversions/qjoin.svg)](https://pypi.org/project/qjoin/)\n[![CI tests](https://github.com/FabienArcellier/qjoin/actions/workflows/main.yml/badge.svg)](https://github.com/FabienArcellier/qjoin/actions/workflows/main.yml)\n[![discord](https://img.shields.io/badge/discord-qjoin-5865F2?logo=discord&logoColor=white)](https://discord.gg/nMn9YPRGSY)\n[![Documentation Status](https://readthedocs.org/projects/qjoin/badge/?version=latest)](https://qjoin.readthedocs.io/en/latest/?badge=latest)\n![license](https://img.shields.io/pypi/l/qjoin\n)\n\nqjoin is a data manipulation library that provides simple and efficient joining and collection processing functionality. It simplifies and optimizes the process of joining different entities and provides methods for aggregating, organizing, and sorting data.\n\n![principle diagram](https://github.com/FabienArcellier/qjoin/raw/master/docs/principle.png)\n\n* qjoin is a simple and efficient way to join and process data\n* qjoin is a steroid extension of the `zip` function in python\n* qjoin works on all iterators, whether lists of dictionaries, objects or sqlalchemy or django models\n\n## Project links\n\n* [PyPI Releases](https://pypi.org/project/qjoin/)\n* [Documentation](https://qjoin.readthedocs.io/en/latest/)\n* [Source code](https://github.com/FabienArcellier/qjoin)\n* [Issue tracker](https://github.com/FabienArcellier/qjoin/issues)\n* [Chat](https://discord.gg/nMn9YPRGSY)\n\n## Installation\n\n```bash\npip install qjoin\n```\n\n## Usage\n\nHere are examples of how qjoin will be used in the future.\n\n```python\n# Basic usage\nqjoin.on(persons).join(cities, key=\"city\").all()\n\nperson_infos = qjoin.on(persons).join(cities, left=\"city\", right=\"city\").all()\nfor person, city in person_infos:\n    print(f'{person} - {city}')\n\nperson_infos = qjoin.on(persons) \\\n    .join(cities, left=lambda p: p.city, right=lambda c: c.city) \\\n    .join(cars, left=lambda p: p.car, right=lambda c: c.car) \\\n    .all()\n\nfor person, city, car in person_infos:\n    print(f'{person} - {city} - {car}')\n\n# Advanced transformation\n\nqjoin.on(persons) \\\n    .join(cities, left=lambda p: p.city, right=lambda c: c.city) \\\n    .join(cars, left=lambda p: p.car, right=lambda c: c.car) \\\n    .as_aggregate(Aggregate, ['person', 'city', 'cars'])\n```\n\n#### TODO\n\nThe following syntaxes are to be implemented and documented. You want to discuss it, participate or suggest other syntaxes, join us on [discord](https://discord.gg/nMn9YPRGSY).\n\n```python\n# Advanced transformation\n\nqjoin.on(persons) \\\n    .join(cities, left=lambda p: p.city, right=lambda c: c.city) \\\n    .join(cars, left=lambda p: p.car, right=lambda c: c.car) \\\n    .as_aggregate(Aggregate, lambda p, ci, ca: Aggregate(p, ci, ca))\n\n\nqjoin.on(persons) \\\n    .join(cities, left=lambda p: p.city, right=lambda c: c.city) \\\n    .as_lookup(lambda p: p.name)\n\nqjoin.on(persons) \\\n    .join(cities, left=lambda p: p.city, right=lambda c: c.city) \\\n    .as_multilookup(lambda p, c: c.city)\n\n# Advanced\n\nqjoin.on(persons) \\\n    .join(cities, left=lambda p: p.city, right=lambda c: c.city, scan_strategy=qjoin.RIGHT_LOOKUP)\n    .join(cars, left=lambda p: p.car, right=lambda c: c.car, default=Car(car='unknown', constructor='unknown')) \\\n    .as_aggregate(Aggregate, lambda p, ci, ca: Aggregate(p, ci, ca))\n```\n\n\n### Try with docker\n\nYou can run this template with docker. The manufactured image can be distributed and used to deploy your application to a production environment.\n\n```bash\ndocker-compose build\ndocker-compose run app\n```\n\n### Try with gitpod\n\n[gitpod](https://www.gitpod.io/) can be used as an IDE. You can load the code inside to try the code.\n\n[![Open in Gitpod](https://gitpod.io/button/open-in-gitpod.svg)](https://gitpod.io/#https://github.com/FabienArcellier/qjoin.git)\n\n## The latest version\n\nYou can find the latest version to ...\n\n```bash\ngit clone https://github.com/FabienArcellier/qjoin.git\n```\n\n## Contributing\n\nIf you want to discuss about it, contact us through [discord](https://discord.gg/nMn9YPRGSY)\n\nContributing to this project is done through merge request (pull request in github). You can contribute to this project by discovering bugs, opening issues or submitting merge request.\n\nmore in [CONTRIBUTING.md](./CONTRIBUTING.md)\n\n## License\n\nMIT License\n\nCopyright (c) 2023-2023 Fabien Arcellier\n\nPermission is hereby granted, free of charge, to any person obtaining a copy\nof this software and associated documentation files (the \"Software\"), to deal\nin the Software without restriction, including without limitation the rights\nto use, copy, modify, merge, publish, distribute, sublicense, and/or sell\ncopies of the Software, and to permit persons to whom the Software is\nfurnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in all\ncopies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\nIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\nFITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\nAUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\nLIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\nOUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\nSOFTWARE.\n\n",
    "bugtrack_url": null,
    "license": "MIT",
    "summary": "qjoin is a data manipulation library that provides simple and efficient joining and collection processing functionality",
    "version": "0.1.0",
    "project_urls": {
        "Chat": "https://discord.gg/nMn9YPRGSY",
        "Documentation": "https://qjoin.readthedocs.io/en/latest/",
        "Issue Tracker": "https://github.com/FabienArcellier/qjoin/issues",
        "Source code": "https://github.com/FabienArcellier/qjoin"
    },
    "split_keywords": [],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "04a3b38b3feef0ebcd2d399be1e74e4a70000044c27118c2157e67a199838a9b",
                "md5": "4cf3c4a2d584807b5032f4948103071f",
                "sha256": "a939ec57411b5b5d0595106f56437295ebc2c7fdcc103e0652f122ad99711900"
            },
            "downloads": -1,
            "filename": "qjoin-0.1.0-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "4cf3c4a2d584807b5032f4948103071f",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": ">=3.8,<4.0",
            "size": 7250,
            "upload_time": "2023-08-27T10:14:41",
            "upload_time_iso_8601": "2023-08-27T10:14:41.872011Z",
            "url": "https://files.pythonhosted.org/packages/04/a3/b38b3feef0ebcd2d399be1e74e4a70000044c27118c2157e67a199838a9b/qjoin-0.1.0-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "a029f3f7daf7b989c8c4c77a40ce6192cf6b64f8df49c738fefa6facbcc76a23",
                "md5": "c52a86db32ab6bac56ea53d5dd1fa5e0",
                "sha256": "c6b4e3984ccdf14cb6ade902f64944143cdba5886e9b8395258f07e796cb8648"
            },
            "downloads": -1,
            "filename": "qjoin-0.1.0.tar.gz",
            "has_sig": false,
            "md5_digest": "c52a86db32ab6bac56ea53d5dd1fa5e0",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": ">=3.8,<4.0",
            "size": 6125,
            "upload_time": "2023-08-27T10:14:43",
            "upload_time_iso_8601": "2023-08-27T10:14:43.228114Z",
            "url": "https://files.pythonhosted.org/packages/a0/29/f3f7daf7b989c8c4c77a40ce6192cf6b64f8df49c738fefa6facbcc76a23/qjoin-0.1.0.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2023-08-27 10:14:43",
    "github": true,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "github_user": "FabienArcellier",
    "github_project": "qjoin",
    "travis_ci": false,
    "coveralls": false,
    "github_actions": true,
    "lcname": "qjoin"
}
        
Elapsed time: 0.10556s