Giter Club home page Giter Club logo

Comments (4)

pjbull avatar pjbull commented on June 27, 2024 1

I agree this approach has worked well. I think the .env workflow may need some explanation in the docs so I'll open a separate issue for that.

from cookiecutter-data-science.

isms avatar isms commented on June 27, 2024

Here's how we've done this so far, just as one data point:

  • A script (or scripts) in src/data/ will do all of the ETL. Right now in the template there is an example stub called make_dataset.py but it could be anything - you could have multiple files for interfacing with various systems or even multiple directories if things start to get too busy in src/. As you mentioned, adding a folder for saved SQL queries might be a good way to keep things tidy.
  • That script dumps its output somewhere in the data/ directory.
  • Optional: rule in the Makefile specifying the target (output) and dependencies (input files, such as the .py and .sql/.hql files).
  • The project secrets (including database credentials) live in a file only on your machine called .env in the top level directory, which is in .gitignored by default to keep it out of version control. If you look at the stub make_dataset.py, it uses a package called python-dotenv to load up all the entries in this file as environment variables, so they are accessible with os.environ.get or whatever is language-appropriate.

Here's an example .env:

DATABASE_URL=postgres://username:password@localhost:5432/dbname
AWS_ACCESS_KEY=myaccesskey
AWS_SECRET_ACCESS_KEY=mysecretkey
...

Meta discussion:

  • One of the core "opinions" of the project is that all code lives in src/ and everything in the data/ directory is just data.
  • Another opinion is that end users should be liberal in adding folders to suit their needs but the template should be conservative in making those choices permanent.

Thoughts?

from cookiecutter-data-science.

jbrambleDC avatar jbrambleDC commented on June 27, 2024

completely agree with that approach. I think that works quite well.

from cookiecutter-data-science.

isms avatar isms commented on June 27, 2024

See #18 for .env issue - closing this issue for now but still very open to receiving comments.

from cookiecutter-data-science.

Related Issues (20)

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.