luigi
=====
Luigi is a simple Django app to be able to link Django to the workflow manager luigi.
Quick start
-----------
1. Add 'django_luigi' to you INSTALLED_APPS settings like this::
INSTALLED_APP = [...
'django_luigi',
]
2. Create your `app` and `models` in Django as usual
3. Run `python manage.py migrate` to create the models.
You can know create objects in your luigi pipeline.
Assuming a django model Test in the test app with two CharField, item1, and item2, properly migrated
.. code-block:: python
from django.db import models
class Test(models.Model):
item1 = models.CharField(max_length=120)
item2 = models.CharField(max_length=120)
Here is a minimal example of a job to copy data to database using Django :
.. code-block:: python
import luigi
from django_luigi.django import ToORM
class TestTask(ToORM):
django_root = 'path_to_your_django_root' # Where manage.py is
settings_path = 'my_site.settings'
model = 'Test'
app = 'test'
def rows(self):
for row in [("item1", "property1"), ("item2", "property2")]:
yield row
if __name__ == '__main__':
task = TestTask()
luigi.build([task], local_scheduler=True)
In the above examples, the data that needs to be copied was directly provided by
overriding the rows method. Alternately, if the data comes from another task, the
modified example would look as shown below:
.. code-block:: python
import luigi
from django_luigi.django import ToORM
from luigi.mock import MockTarget
class BaseTask(luigi.Task):
def output(self):
return MockTarget("BaseTask")
def run(self):
out = self.output().open("w")
TASK_LIST = ["item%d\\tproperty%d\\n" % (i, i) for i in range(1,3)]
for task in TASK_LIST:
out.write(task)
out.close()
class TestTask(ToORM):
django_root = 'path_to_your_django_root' # Where manage.py is
settings_path = 'my_site.settings'
model = 'Test'
app = 'test'
def requires(self):
return BaseTask()
if __name__ == '__main__':
task1, task2 = TestTask(), BaseTask()
luigi.build([task1, task2], local_scheduler=True)
Metadata
Release files for django-luigi 0.2.5
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-luigi-0.2.5.tar.gz | 5.6 kB | Without provenance | Details for django-luigi-0.2.5.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| django_luigi-0.2.5-py2-none-any.whl | Python 2 | none | any | Details for django_luigi-0.2.5-py2-none-any.whl |
Total release size: 14.3 kB
Release files / django-luigi-0.2.5.tar.gz
| Download URL | django-luigi-0.2.5.tar.gz |
|---|---|
| Size | 5.6 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
f7ca58bb6b27b5488bc75356e4f4901fb3c5c1c098ccbc76d816a2ac49ab3c1b
|
|
BLAKE2b-256 checksum How to use checksums |
a799555da8988505c906fa7dcd4a06f3a136fddd03adff66498299d62e85c522
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/1.12.1 pkginfo/1.4.2 requests/2.19.1 setuptools/38.5.1 requests-toolbelt/0.8.0 tqdm/4.23.4 CPython/3.6.7
|
Release files / django_luigi-0.2.5-py2-none-any.whl
| Download URL | django_luigi-0.2.5-py2-none-any.whl |
|---|---|
| Size | 8.7 kB |
| Tags | Python 2 |
|
SHA-256 checksum How to use checksums |
68f8ab85c51b0685f5fe816a01650174bf6661d0de13a31f2b57e011b5858cc8
|
|
BLAKE2b-256 checksum How to use checksums |
d70b8813ba4538dc59e0a67893bb8c8c1813c30e8e13998b0dca1f799634abe3
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/1.12.1 pkginfo/1.4.2 requests/2.19.1 setuptools/38.5.1 requests-toolbelt/0.8.0 tqdm/4.23.4 CPython/3.6.7
|
Security for django-luigi 0.2.5
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.