All Questions
18 questions
1
vote
0
answers
41
views
Get the difference between two sets from database
Hello beautiful people!
I have created a script where I have two database functions (Feed and Product) where I have a list of Feeds in a store and a list of Product in the store. What I have done is ...
1
vote
1
answer
195
views
Get Gzip file from endpoint, extract data and add to database
I currently have a script that fires a request to an API endpoint which returns a csv.gzip file - which roughly contains 75,000 rows and 15 columns. I download this ...
4
votes
1
answer
140
views
Django User Model to authenticate using email address and password
This is my second Django project for an actual client and I want some review on one of my important models.
This model will be responsible for authenticating users using their E-Mail Addresses and ...
6
votes
1
answer
839
views
Air Quality/Environment Monitoring Web App using Plotly Dash
Overview & Motivation
This project manages and displays sensor data (temperature, humidity, Air Quality Index). The sensor data is displayed by the sensor manufacturer, PurpleAir, but their tool ...
2
votes
0
answers
32
views
A task to store user's favorited projects in postgres using python
I am not happy with two functions calling get_user() since while testing I mock get_user and to test with get_user_returns_null case, it returns Null for both ...
3
votes
1
answer
78
views
Getting weather and cycling data (yr.no, oslobysykkel)
What I am trying to do, is to get weather data, data about bike trips and populate the postgresql database in order to be able to work with this data from Power BI/Tableau/any other tool.
I have two ...
2
votes
0
answers
36
views
Handling failures in DB transactions
This code is meant to retry the db operation when a DB connection breaks: OperationalError.
A transaction can fail for example when a db is being restarted and a commit fails. Or when a network error ...
3
votes
0
answers
58
views
Django migration script to add metadata
I made a simple django migration that adds two field to our Invoices model : first_payment and first_paying_month.
...
4
votes
0
answers
112
views
Interacting with PostgreSQL attachment and the file system
I have just migrated from Python 2 to Python 3. I have written the following script to fetch all records of a table, ir_attachment, from PostgreSQL. After fetching all the records I check following ...
3
votes
2
answers
1k
views
Importing data into PostgreSQL from remote text file using ftplib class
I need to read a remote file using FTP and process it and insert the processed data to a PostgreSQL database in another server.
The below code is working fine, but i want some advice to modify few ...
1
vote
1
answer
2k
views
Port the data from a TEXT file to Postgres table using Python
I have written the below code to read a huge text file of size 20+ MB and insert the values to a PostgreSQL table. The code is working fine, but I'm facing below issues in the code.
1) The code is ...
5
votes
1
answer
61
views
SQL Bulk status update
Context
I'm a duck retailer. I rent ducks to farmers, and when they don't need them anymore, I get them back. In order to track which ducks I rented to whom, I have a PostGreSQL database that I keep ...
3
votes
0
answers
31
views
Context manager to temporarily drop indexes and constraints on a table
I'm importing millions of rows into a PostgreSQL database using a foreign data wrapper. To speed this up I've written this context manager to DROP all the indexes ...
3
votes
1
answer
4k
views
Fetch, parse, and store JSON in PostgreSQL
I was given a task to read JSON from a URL and then parse it in python. Each field will be assigned to a variable to store the value. The value will then be stored into postgres table.
Example of ...
10
votes
1
answer
385
views
Cryptocurrency notifier - let's get rich (or at least let's try)
We all know that in the last period cryptocurrencies have ushered the era of the next financial revolution. Having that in mind, I thought it'd be useful to know (using Python 3.6) when a certain ...