Coder Social home page Coder Social logo

django-dde's Introduction

Django Distributed Exporter (DDE)

Asynchronous and Distributed Data Exporter from a Django QuerySet

DDE main goal is to get data from a QuerySet and export to an output format (currently CSV only) using Celery for task distribution.

Installation

pip install django-dde

Requirements

DDE uses Celery to manage its tasks. Currently our broker defaults to Redis so be sure to install the dependencies need, for more information click here.

File management is dealt using Django's Default Storage. For more information on how to use it please click here.

We developed DDE using Django 1.11 and Python 3.5. Other versions are pending tests. Let us know if works in your virtual environment.

Usage

First of all:

pip install django-dde

Excelent! Now you must ensure that in your settings.py you have these configurations:

EXPORTER_FROM_EMAIL = '[email protected]'

Now you have to configure a periodic task using Celery, please refere to this link.

Now in the code:

from exporter.models import Exporter

exporter = Exporter.objects.create_exporter(
    queryset=Model.objects.queryset, # Change Model to your Model
    email=example@mail.com, # E-mail that will receive the link to the exporter,
    limit_per_task=100, # How many entries each task will proccess
)

And that's it! Simple, right?

Development setup

Installing our dependencies in your virtual environment is pretty straight foward:

pip install -r requirements/development.txt

But you can use our Docker to test DDE. This method already install all dependencies on a container, creates a Redis container and you ready to go. We already configured some shortcuts to help:

make build # Builds docker image, be sure to run this first
make build-no-cache # Build/Rebuilds (cleaning cache) docker image

make tests # Run all tests
make bash # Enters Docker's Bash

make help # Shows the available commands

Release History

  • 0.1
    • Initial version

Meta

Stored E-commerce

Distributed under the MIT license. See LICENSE for more information.

https://github.com/stored

Contributing

  1. Fork it (https://github.com/yourname/yourproject/fork)
  2. Create your feature branch (git checkout -b feature/fooBar)
  3. Commit your changes (git commit -am 'Add some fooBar')
  4. Push to the branch (git push origin feature/fooBar)
  5. Create a new Pull Request

Remember: Every feature created or fixed must have a test written and/or fixed.

django-dde's People

Contributors

rafaelcassau avatar viniciuscainelli avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar

django-dde's Issues

Remove ExporterStatusException and use KeyError

Currently que got a Custom Exception (ExporterStatusException) which verifies if the status that will be set is valid. The right is to to raise a KeyError Exception and remove ExporterStatusException for better standardization.


Atualmente nos temos uma Custom Exception (ExporterStatusException) que verifica se o status que será setado é válido. Precisamos remover esta custom exception e utilizar o KeyError no lugar para padronizar.

Add Travis

Bugs won't find themselves alone.


Bugs não se encontram sozinhos.

Add general filename preffix / Adicionar prefixo geral para nome do arquivo

Files outputed by DDE uses the Queryset's Model to generate the filename, we need to have a filename to preffix and/or replace this.

--

Arquivos gerados pelo DDE usam o Model do Queryset para buscar um nome e colocar no nome do arquivo, seria excelente ter um prefixo (ou até mesmo trocar o nome do arquivo).

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.