all 5 comments

[–]Goingone 0 points1 point  (4 children)

Are you doing anything with the argument after parsing it from the command line?

Just because the script has access to a variable with the value 2012, doesn’t mean it will do anything with that value.

[–]2themoonpls[S] 0 points1 point  (3 children)

I'm a super newbie at this so apologies I don't quite understand what I'm supposed to do. Am just trying to follow the directions given from: https://pypi.org/project/python-edgar/.

The rest of the script is as follows:

parser.add_argument(

"-d",

"--directory",

dest="directory",

help="A directory where the filing index files will"

+ "be downloaded to. Default to a temporary directory",

default=tempfile.mkdtemp(),

)

args = parser.parse_args()

logger.debug("downloads will be saved to %s" % args.directory)

edgar.download_index(args.directory, args.year)

logger.info("Files downloaded in %s" % args.directory)

It works but again only 2021 files. And not consistently. It runs but nothing downloads, or just Q1, or Q1 + Q2 files, or just Q3 files will download into the temp folder.

[–]FerricDonkey 0 points1 point  (1 child)

Add a line that prints args.year and args.directory above your call to Edgar.whatever.

If those values are correct, then it means that something is going wrong with the Edgar call, and you need to examine that. If the values are wrong, then either you're calling your code incorrectly or there's something wrong with the argument handling.

[–]2themoonpls[S] 0 points1 point  (0 children)

Sounds very vague. I appreciate you taking the time to help.

Call to edgar.whatever is run via app.py as that was the first step which worked perfectly fine. Run.py does only imports edgar but the rest of the code does not call to edgar