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.
- qjoin is a simple and efficient way to join and process data
- qjoin is a steroid extension of the
zipfunction in python - qjoin works on all iterators, whether lists of dictionaries, objects or sqlalchemy or django models
Project links
Installation
pip install qjoin
Usage
Here are examples of how qjoin will be used in the future.
# 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.
# 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.
docker-compose build
docker-compose run app
Try with gitpod
gitpod can be used as an IDE. You can load the code inside to try the code.
The latest version
You can find the latest version to ...
git clone https://github.com/FabienArcellier/qjoin.git
Contributing
If you want to discuss about it, contact us through discord
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
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.
Metadata
Release files for qjoin 0.1.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| qjoin-0.1.0.tar.gz | 6.1 kB | Without provenance | Details for qjoin-0.1.0.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| qjoin-0.1.0-py3-none-any.whl | Python 3 | none | any | Details for qjoin-0.1.0-py3-none-any.whl |
Total release size: 13.4 kB
Release files / qjoin-0.1.0.tar.gz
| Download URL | qjoin-0.1.0.tar.gz |
|---|---|
| Size | 6.1 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
c6b4e3984ccdf14cb6ade902f64944143cdba5886e9b8395258f07e796cb8648
|
|
BLAKE2b-256 checksum How to use checksums |
a029f3f7daf7b989c8c4c77a40ce6192cf6b64f8df49c738fefa6facbcc76a23
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/4.0.2 CPython/3.10.12
|
Release files / qjoin-0.1.0-py3-none-any.whl
| Download URL | qjoin-0.1.0-py3-none-any.whl |
|---|---|
| Size | 7.2 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
a939ec57411b5b5d0595106f56437295ebc2c7fdcc103e0652f122ad99711900
|
|
BLAKE2b-256 checksum How to use checksums |
04a3b38b3feef0ebcd2d399be1e74e4a70000044c27118c2157e67a199838a9b
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/4.0.2 CPython/3.10.12
|
Security for qjoin 0.1.0
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.