3
votes
1answer
42 views

Scraper for parsing email-ID using email sending button

I've written a script in python with POST request which is able to send email using send button and then catch the response of that email and finally parse the ID from that. I don't know whether the ...
5
votes
1answer
31 views

Creating ICS calendar events from JSON-like file

the purpose of this code is to take a Taskwarrior (it's a todo list application) server file that is mostly JSON and create unique ICS calendar events. The logic mostly works: I still see some ...
3
votes
1answer
43 views

JSON Cache Program

I have some code that is intended to be a package (so that it can be accessed via import cachejson). Here is the code for the package: The update variable is ...
17
votes
3answers
2k views

Filtering a large (50gb+) JSON lines file matching CIDR's

I'm trying to speed up a Python script that reads a large log file (JSON lines, 50gb+) and filter out results that match 1 of 2000 CIDR ranges. Logfile 20 million lines ...
1
vote
1answer
34 views

Restructuring a file to JSON

I created a program that parses a Credit Reporting file which is in the Metro 2 file format as described here. Parsing a file is generally trivial but the issue is that in this case, there are no ...
12
votes
2answers
806 views

Current ISS latitude / longitude position

I'm looking into basic API examples and I've got the following to work as I want it to. Is there a better way to determine the direction of latitude and longitude? It feels like I could do it better. ...
4
votes
1answer
82 views

Mapping a CSV with UTF-8 encoding to JSON in Python

I'm not a programmer, just a guy who needs to solve particular things using code. I needed to create a JSON from a CSV with predefined headers. I'm downloading an attachment from JIRA (REST API), ...
5
votes
1answer
87 views

Extracting the IP addresses of Docker containers using JSON API

The following piece of code is imported in another file to get the status of the docker containers. I am printing the required information in a proper tabular form. I am using next() for finding out ...
4
votes
1answer
220 views

Simplify the restructuring of json data

I am trying to ad nested to some flat data, which is nested. Basically this code works the following way: "taglevel":1 tags should be key of the array "taglevel":2 or higher tags should be nested ...
7
votes
1answer
41 views

Track changes inside a directory

I have built a Python 2.7 script to track all file and subdir changes inside a nominated directory. It is used with directories that have multiple levels of subdirectories, hundreds of thousands of ...
3
votes
0answers
64 views

API client for a package shipping system

I would like to implement a higher level design pattern here but I am a bit stumped, How can I improve this code and make it more object oriented? ...
1
vote
1answer
44 views

Get json format from sqlalchemy class

I have written a small tool to generate a json file from sqlalchemy models files to automate the tedious procedure of writing all the sql raws in a json format. The script works, but there are few ...
0
votes
0answers
46 views

How can I make this Python code more efficient? The file operations are too taxing I feel

I have written a code that will parse JSON file from a cuckoo report. The issue is am not a good coder. I have got the program to give me the desired output. The real challenge that I am facing is I ...
5
votes
2answers
171 views

Validating a CSV list of contacts and convert it to JSON - Follow Up

This is a follow up to my original post: I've written a class that takes a file, validates the formatting of the lines from an input file and writes the set of valid lines to an output file. Each ...
3
votes
2answers
70 views

Validating a CSV list of contacts and convert it to JSON

I've written a class that takes a file, validates the formatting of the lines from an input file and writes the set of valid lines to an output file. Each line of the file should have a first name, ...
3
votes
2answers
60 views

TranslateIt class using the Yandex translation service

I wrote a class TranslateIt for translating text files with Yandex.Translate service. I feel the code is rather bulky. Is it ...
5
votes
1answer
74 views

Currency Converter in Python 3

Beginner Python developer here. I was tinkering around with Python and decided to build a currency converter. It takes in input from the user and prints out the converted currency values. The fixer.io ...
3
votes
1answer
79 views

Improving Twitter JSON parser for big data set

I have the following fully working code that imports JSON files, parses the tweets contained in JSONs, records them in a table in a data frame. Considering that per run I currently analyze 1,400 ...
4
votes
1answer
72 views

pyvdp - Python library for Visa Developer Program

I'm coming from PHP and recently started developing in Python. As a part of my self-study course, I developed a small library for access to Visa Developer Program APIs and published it on Github. It ...
10
votes
0answers
142 views

Download images from an image board based on tags and blacklists

This code is meant to download images from an image board to create a local backup. Images are grouped by tags selected by the user and then downloaded using multiprocessing. Normal use of this ...
2
votes
1answer
131 views

JSON pretty print

Here is my simple program to pretty print a JSON object. I'm looking for advice of better pretty print solutions, functional bugs, code style and algorithm time/space complexity improvements. BTW, I ...
5
votes
2answers
102 views

Adding labels and fields to a nested JSON

I have a dataframe: ...
0
votes
0answers
62 views

Generating Django fixtures from .csv

I've written this script to create a Django .json fixture starting from a .csv. The .csv must have 'model' and 'pk' fields. What do you think? ...
3
votes
2answers
92 views

Parsing and saving JSON result from GoEuro API

I am new to python so I decided to write a script that parses a json array and writes data in a file. I wrote the code that does that but I think it can be done way better, So I was hoping to get ...
2
votes
1answer
59 views

Reverse lookup ID by value

Is there a faster way of getting the key of 1 or 2 by using the accs value for my getID function? Unfortunately I cannot use an ...
4
votes
1answer
188 views

Converting Logstash YAML style configuration file into ElasticSearch Logstash JSON style config

I am new in python and have written first code to convert Logstash YAML style configuration file into ElasticSearch Logstash JSON style config. Please have a look at my piece of code and let me know ...
6
votes
3answers
1k views

Determine if a file is either in JSON or XML format

The purpose of this function is to determine if report_input_file is either in JSON format or XML format, this is what I came up with, just want to know if this is ...
2
votes
1answer
228 views

Compare array with Json

Is there any better way to do this? ...
3
votes
3answers
77 views

Reporting test results as JSON and XML

I have two functions now with very similar functionality, and would like to merge them into one more generic function. The only difference between those two functions is that one handles json input ...
6
votes
2answers
122 views

Showing virus scan results from an API and a CSV file

I am utilizing an API module for interacting with virustotal.com in order to get AntiVirus results based of SHA256 hashes. The code I have is working but I feel like it can be improved greatly. I ...
2
votes
1answer
99 views

Simple Python script to sort and make json data unique

I'm retrieving e-mails from a collection of a few hundred *.json files using the following: Python Script ...
1
vote
2answers
210 views

Postman collection parser which injects collection to Jira/xray addon

I'we created an interface that communicates with Postman collection and Jira api more precise the Xray addon for jira. I would much appreciate if you could give me notes on how to improve this code. ...
4
votes
1answer
2k views

Converting embedded JSON into flat table

I am new Python user, who decided to use Python to create simple application that allows for converting json files into flat table and saving the output in cvs format. I was wondering if you could ...
5
votes
2answers
4k views

Script to print weather report from OpenWeatherMap API

This script prints the weather (fetching the information from a public API). If anyone could review my code and answer my question about code structure and how should I code in the right way, I ...
1
vote
1answer
91 views

Foldify - A Python Folder Tree Manager Tool

The goal was to create a tool to help manage folders structures, and allow me to create templates of this folders and store them as a JSON template. The following functionalities have been implemented:...
2
votes
2answers
286 views

Program to edit an address book stored as a JSON file

I was told to come here from Stack Overflow. I'm trying my hand at an address book and the goal is for it to have a bit more of error prevention, for instance for the key "phone" to have 10 digits, ...
0
votes
2answers
261 views

Currency converter in Python 2.7

I'm a beginner and it is my first project in Python 2.7. My goal is writing a script that I can run with two or three arguments. If run with two arguments like ...
1
vote
1answer
175 views

Twitch client that notifies me when a followed streamer comes online

I've been writing code for a little while but I'm a little slapdash. I'd like to get better so I've been having a glance at best practices, other peoples code and reading a whole lot. I'd appreciate ...
12
votes
3answers
84 views

From Q to compiler in less than 30 seconds

As an adjunct to From new Q to compiler in 30 seconds, I've created a Python script to automatically download the markdown from any question on Code Review and save it to a local file using Unix-style ...
1
vote
1answer
300 views

Parsing JSON in one go using state machine solution

I need to parse a simple JSON string (flat JSON, no hierarchy) for keys and values, and there is a system constraint that I cannot use any built-in JSON library and can only read a string once due to ...
3
votes
2answers
246 views

Parsing JSON in one go

I need to parse a simple JSON string (flat JSON, no hierarchy) for keys and values, and there is a system constraint that I cannot use any built-in JSON library and can only read a string once due to ...
0
votes
2answers
156 views

JSON string parsing

I need to parse a simple JSON string (flat JSON, no hierarchy) for keys and values, and there is a system constraint that I cannot use any built-in JSON library and can only read a string once due to ...
3
votes
1answer
506 views

GPSD socket connection and decoding JSON into Python dictionaries

GPS3 is a python 2.7-3.5 interface to GPSD. I've stripped back everything to two classes. ...
1
vote
1answer
407 views

Filters for a JSON collection

I am trying to create a class that parses a JSON and selects all labels, or just a particular label that you prefer to later do a calculation with the value pair extracted off that label. This is ...
1
vote
0answers
90 views

Flask json rpc2.0 extension

I created a simple extension to handle JSON RPC 2.0 requests on flask I would like some feedback regarding usage here is an usage example: ...
2
votes
1answer
504 views

Read decibel level from a USB meter, display it as a live visualization, and send it via FTP

This question was posed to me by someone in my university's athletics department who had a USB sound level meter and a simple Python script which printed the current sound level (he was provided with ...
4
votes
1answer
82 views

A simple parcel checker Python script

My current student accommodation uses a manual paper and pen system for checking if students have mail so I made this simple Python script to help mitigate the problem of manually searching through ...
5
votes
3answers
2k views

Using argparse with parameters defined in config file

I understand that and why using eval is generally considered bad practice in most cases (see e.g. here). Related questions on config files and argparse don't use ...
2
votes
1answer
337 views

Extract data from large JSON and find frequency of contiguous sub lists

I have been writing some code (see component parts here and here) that: Takes a very large JSON (15GB gzipped, ~10million records) Extracts the relevant parts of the JSON into a list of lists Creates ...
4
votes
1answer
3k views

Converting string to dict using Python ast library

I have been trying to convert a string of dictionary objects as given below ...