Giter Site home page Giter Site logo

pydata-london-2022-sqlalchemy-tutorial's Introduction

SQLAlchemy and you โ€“ making SQL the best thing since sliced bread

Are you writing SQL strings in your code? Have you only used ORMs and want to start getting more control over your SQL?

SQLAlchemy is the gold-standard for working with SQL in Python and this tutorial will get you comfortable working in it, so you can take advantage of its power.

We will go through Core and ORM abstractions, so you'll be comfortable navigating through the different layers and be able to fully use the power of Python when writing your SQL

Project setup

If you have your own, preferred setup for installing packages - go right ahead and use that. There's a requirements.txt and an environment.yml file you can use. Alternatively, if you have docker and docker compose installed, you can use the provided docker-compose setup

Docker compose

docker compose up -d
docker compose logs jupyter

In the logs you should see a URL that looks similar to

http://127.0.0.1:8888/lab?token=39ec5120ee84b090487a822b991269732a264629c894803e

Copy-paste that into your browser, you should be able to login to the Jupyter instance

Conda-based

If you have Anaconda distribution installed, you can run the following

conda env create

This will install all the packages defined in the environment.yml file into an environment named sqlalchemy-tutorial.

To activate this environment, run

conda activate sqlalchemy-tutorial

Virtualenv-based

This tutorial was written in 3.9.13 - ensure that you have at least 3.9.X installed on your machine

To create a new virtualenv run

python -m venv venv

To activate the virtualenv - run one of the following:

Windows

./venv/Scripts/activate

MacOS/Linux

source venv/bin/activate

You'll then need to install the packages

python -m pip install -r requirements.txt

After you've installed the packages run jupyter lab to start the Jupyter lab server

pydata-london-2022-sqlalchemy-tutorial's People

Contributors

andersbogsnes avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

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.