Django Excel Fixture
Django-excel-fixture is an easy way to import, export and test using .xlsx file.
Motivation
Excel is a must in the corporate world. It is an easy to use and highly powerful application, currently being used by millions of users (maybe more than a billion user). Django-excel-fixture provides a way to import, export data using excel file (.xlsx); and also use it as test fixture.
Installation
To install it, simply:
$ pip install django-excel-fixture
Then add it to your INSTALLED_APPS on your settings.py:
INSTALLED_APPS = (
#...
'django_excel_fixture',
)
Usage
Exporting data from database:
If you already have some data in the database, to export it to a .xlsx file:
$ python manage.py dumpdata --format xlsx --output myfilename.xlsx
It is also possible to select a specific model:
$ python manage.py dumpdata myapp1.MyModelName --format xlsx --output myfilename.xlsx
- If you leave out the output option, the table is dumped to stdout in CSV format.
- There will be sheets only for table with data
Importing data into the database:
To manually load the data from the Excel file, use:
$ python manage.py loaddata myfilename.xlsx
Using as test fixture:
To use the fixture in a test, just add to the test class:
class MyTestCase(TestCase):
fixtures = ['myfilename.xlsx']
def ...
- No performance optimization has been made. Caution is advised.
Excel file format
- Currently, it is only compatible with .xlxs format.
- Every sheet is a model. The sheet title represents the model's identification.
- Every column represents a field.
- Every row represents a object (database entry).
Contribution
git clone git@github.com:SKisContent/django-excel-fixture.git
cd django-excel-fixture
python -m venv .venv
source .venv/scripts/activate
pip install -r requirements.txt
python runtests.py
Authors
License
The MIT License.
Metadata
Release files for django-excel-fixture 0.1
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 |
|---|---|---|---|---|
| django-excel-fixture-0.1.tar.gz | 6.6 kB | Without provenance | Details for django-excel-fixture-0.1.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| django_excel_fixture-0.1-py3-none-any.whl | Python 3 | none | any | Details for django_excel_fixture-0.1-py3-none-any.whl |
Total release size: 14.8 kB
Release files / django-excel-fixture-0.1.tar.gz
| Download URL | django-excel-fixture-0.1.tar.gz |
|---|---|
| Size | 6.6 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
1d47c2146b8e7ee7830a512dd807fc01cb0ec3f099d1a9a97f1869df2db1e95a
|
|
BLAKE2b-256 checksum How to use checksums |
2f64cbd080e3f5c58461d942d556fbcfa87188355ae12f8af1882e4f36cdc5f5
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/2.0.0 pkginfo/1.5.0.1 requests/2.22.0 setuptools/40.8.0 requests-toolbelt/0.9.1 tqdm/4.36.1 CPython/3.7.3
|
Release files / django_excel_fixture-0.1-py3-none-any.whl
| Download URL | django_excel_fixture-0.1-py3-none-any.whl |
|---|---|
| Size | 8.2 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
3b68232ee3380241c7c07e148bc24f20d1cc02cfa321ecbcba935aa4e5000e0d
|
|
BLAKE2b-256 checksum How to use checksums |
825a55f8821adabe65ecb2343ce95e115fa62ead3931183651b1f9c0bad37319
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/2.0.0 pkginfo/1.5.0.1 requests/2.22.0 setuptools/40.8.0 requests-toolbelt/0.9.1 tqdm/4.36.1 CPython/3.7.3
|
Security for django-excel-fixture 0.1
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.