Tool for precise and efficient django model copying
Project description
django-copyist
Tool for precise and efficient copying of Django models instances.
Do you live in fear of the day when PM will come to you and ask to implement a copy feature for your root model, that has a lot of relations and you know that it will be a pain to implement it in a way that will work properly?
Well, fear no more, as django-copyist got you covered
Features
Precision - Copy only what you need in a way that you need with help of custom copy actions.
Readability - With declarative style config - you can easily see what and how is copied, no need to hop between models and parse it in your head.
Efficiency - Unlike some other solutions and naive approaches, copyist is copying your data without recursive hopping between model instances, which gives it a magnitudes of speedup on big data sets.
Flexibility - Copyist covers all steps that are there for data copy, including validation of data, pre-copy and post-copy actions. Copyist also work good with de-normalized data, not judging you for your choices.
Interactive - Copyist provides a way to interact with the copy process, allowing application to see what exactly is going to be done, and propagate that info to end user to decide if he wants to go through with it.
Reusability - With copyist your copy flow is not nailed down to model, allowing you defining different approaches for same model, and at the same time reuse existing configurations.
Motivation
This project was build as in-house tool for project with complex hierarchy of models, where we needed to copy them in a very particular way.
Existing solutions like django-clone were designed in a way that didn’t fit our needs, as they required to modify models and didn’t allow to have full control over the copying process.
This project aims to provide a more flexible and efficient way to copy Django models instances, while not affecting existing codebase.
Quickstart
This pages aims to get you going with django-copyist as quickly as possible.
Installation
To install with pip:
pip install django-copyist
To install with poetry:
poetry add django-copyist
Usage
Project details
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
File details
Details for the file django_copyist-0.1.3.tar.gz
.
File metadata
- Download URL: django_copyist-0.1.3.tar.gz
- Upload date:
- Size: 19.5 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/5.0.0 CPython/3.12.3
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | e462fc468562341789d5bdca5179e371da821a4fd5cc4e4b3ef93b8691b03f89 |
|
MD5 | 85583ddfa32f8bb3f5932ff978eb18eb |
|
BLAKE2b-256 | 7c19c1359eb8f0e26e536c35934dcafc74d676c04da191ffcff43c7429efc542 |
File details
Details for the file django_copyist-0.1.3-py3-none-any.whl
.
File metadata
- Download URL: django_copyist-0.1.3-py3-none-any.whl
- Upload date:
- Size: 21.6 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/5.0.0 CPython/3.12.3
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | b3a4e465db650279c215a0df8747a67d578bebf087f83c5b2094e5c512217fab |
|
MD5 | 8f17e7f6adbaa2008e201c1516bdc88e |
|
BLAKE2b-256 | c8a793d561b719d3b38b86cc7a5faad836b57be0cdba4d972a16458580d76b2a |