r/pythonhelp • • Jan 19 '19

Struggling to "fire" some python code from GitHub

I'm struggling to run some python code from GitHub. I've been writing my own very simple code but I'm nowhere near competent enough to see what I'm doing wrong with someone else's code.

I use the Spyder IDE through Anaconda and don't run code from the command prompt in Windows.

I'm trying to convert Charities Commission BCP files (contained within a Zip file) to CSV. There is Python code on Github to do exactly that here: https://github.com/ncvo/charity-commission-extract

The guide to the code says to run the command "python /path/to/script/import.py /path/to/download/zip/RegPlusExtract_February_2015.zip" at the command prompt (which I've tried and failed to do - assume as I only have the Anaconda / Spyder install).

I've opened import.py in the Spyder IDE and have import.py, bcp.py and the current, December extract all in the same folder. I assume that I can amend a line in import.py to point to the December extract but I can't see which one and now I'm stuck.

Any help very gratefully received.

3 Upvotes

3 comments sorted by

2

u/ryanrocket Jan 19 '19

You cant run that command from the Windows command prompt because windows does not have a built in python module like linux does.

Moving on... i looked at the repo and it states in the README that you run import.py first inorder to configure the scripts... then run the bcp.py file. Make sure to edit the file path within the python script.

1

u/alurkymclurker Jan 19 '19

Thank you for taking the time to read and respond.

Where is the file path I need to edit? Assume in import.py? Which line is it on?

1

u/ryanrocket Jan 20 '19

Here is a snippet from the README file on the repo. You simply open a terminal, navigate to the directory, and run the command below. Before you run the command, make sure you update the part that says “/path/to/script/“ and “/path/to/download/zip/“ to their actual directory. If you need any other clarification read the README file on the repo on GitHub.

  1. Download the Charity register extract ZIP file using the link above.

  2. Open the command line and navigate to the folder where you want to store the file

  3. Run the command ’python /path/to/script/import.py /path/to/download/zip/RegPlusExtract_February_2015.zip’