Package: qjoin
qjoinqjoin 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.qjoin is a simple and efficient way to join and process dataqjoin is a steroid extension of thezipfunction in pythonqjoin works on all iterators, whether lists of dictionaries, objects or sqlalchemy or django modelsProject linksPyPI ReleasesDocumentationSource codeIssue trackerChatInstallationpipinstallqjoinUsageHere are examples of how qjoin will be used in the future.# Basic usageqjoin.on(persons).join(cities,key="city").all()person_infos=qjoin.on(persons).join(cities,left="city",right="city").all()forperson,cityinperson_infos:print(f'{person}-{city}')person_infos=qjoin.on(persons)\.join(cities,left=lambdap:p.city,right=lambdac:c.city)\.join(cars,left=lambdap:p.car,right=lambdac:c.car)\.all()forperson,city,carinperson_infos:print(f'{person}-{city}-{car}')# Advanced transformationqjoin.on(persons)\.join(cities,left=lambdap:p.city,right=lambdac:c.city)\.join(cars,left=lambdap:p.car,right=lambdac:c.car)\.as_aggregate(Aggregate,['person','city','cars'])TODOThe following syntaxes are to be implemented and documented. You want to discuss it, participate or suggest other syntaxes, join us ondiscord.# Advanced transformationqjoin.on(persons)\.join(cities,left=lambdap:p.city,right=lambdac:c.city)\.join(cars,left=lambdap:p.car,right=lambdac:c.car)\.as_aggregate(Aggregate,lambdap,ci,ca:Aggregate(p,ci,ca))qjoin.on(persons)\.join(cities,left=lambdap:p.city,right=lambdac:c.city)\.as_lookup(lambdap:p.name)qjoin.on(persons)\.join(cities,left=lambdap:p.city,right=lambdac:c.city)\.as_multilookup(lambdap,c:c.city)# Advancedqjoin.on(persons)\.join(cities,left=lambdap:p.city,right=lambdac:c.city,scan_strategy=qjoin.RIGHT_LOOKUP).join(cars,left=lambdap:p.car,right=lambdac:c.car,default=Car(car='unknown',constructor='unknown'))\.as_aggregate(Aggregate,lambdap,ci,ca:Aggregate(p,ci,ca))Try with dockerYou can run this template with docker. The manufactured image can be distributed and used to deploy your application to a production environment.docker-composebuild
docker-composerunappTry with gitpodgitpodcan be used as an IDE. You can load the code inside to try the code.The latest versionYou can find the latest version to ...gitclonehttps://github.com/FabienArcellier/qjoin.gitContributingIf you want to discuss about it, contact us throughdiscordContributing 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 inCONTRIBUTING.mdLicenseMIT LicenseCopyright (c) 2023-2023 Fabien ArcellierPermission 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.