Closed kuatroka closed 3 years ago
Hey @kuatroka thanks a lot for opening this issue. I recently revisited this project and fixed a bunch of errors, but the changes are only on the develop
branch of the GitLab repo: https://gitlab.com/briancaffey/sec-filings-app. I'll be testing those changes and then pushing to GitHub. Sorry for the confusion, and please get in touch if you have any other questions about the project. I'll probably be doing some more work on it this weekend.
For your specific questions:
latest
flower image, which supports celery v5Thanks Brian. I'll try it with the gitlab code. I do have WSL 2 with docker, so I'm preemptively worried about the outcome. Thanks for the note on the docker logs.
"...and please get in touch if you have any other questions about the project..." I do have some questions and also can offer my help if needed. I'm not a great coder (only basic Python), but I do can test as I'm an insufferable inconsistencies finder.
If you need ideas for new or improved functionalities, please let me know as the main reason how I found this project is because I was looking for something similar to start my own investment insights automated helper. I got tons of ideas and some of them are very much related with what can be done analysing 13F filings. So if you wish, I'll be happy to share some. Below also see a couple of questions, if I may. I have see your application on heroku, so I'm not sure about all the functionalities and please bear with me if my questions are self-evident
Does the current version of the app have the option to load all or certain filings for all years and companies?
If yes to the above, do you somehow identify if the .txt filing is of an XML format or not, so you parse it or park it in case of an older, non-xml filing?
Is there any type of a functionality that turns on/off the ingestion of new filings or maybe there is a feature that downloads new filing in real-time as soon as they appear on the SEC site?
Did you figure out how the amendments work, so the data is corrected for the past filings?
Did you figure out all the different dates in the filings(CONFORMED PERIOD OF REPORT, EFFECTIVENESS DATE, DATE AS OF CHANGE, etc..)
I'm going to stop here as I might have tons more questions :)
I have just finished installing the app locally. This time it fared better. I can now see the frontend, but it still seems to have some ironing out to do and probably it's on my part, but I'm struggling with these errors.
The containers don't run and when I try to restart them, it doesn't help
Here is the full log since running docker-compose up
. (Since it's a lot of lines, please let me know if you'd rather me not posting it here in the future)
@kuatroka Nice! Thanks for sharing the logs, looks like you are close. Did you copy the contents of the .env.template
file into .env
? It looks like the backend and celery containers are failing because there is no SECRET_KEY
environment variable. That should fix the issue you are experience, hopefully. Don't worry about posting a lot of logs! If you want to, you can wrap long logs in a <summary>
tag like this:
<details>
<summary>My logs</summary>
Logs...
More logs..
</details>
If you need ideas for new or improved functionalities, please let me know as the main reason how I found this project is because I was looking for something similar to start my own investment insights automated helper.
Awesome! Yes, please do share. I'm going to open up GitHub Discussion for this repo. That would be a better place for discussing what 13F analysis features would be worth considering for this project. I'm all ears! I have less experience with SEC data and more with programming.
Does the current version of the app have the option to load all or certain filings for all years and companies?
Currently the way I load in data is one master.idx
at a time using the Django admin. This weekend I'll work on documenting this a little bit better, it isn't very clear at this point. Basically what I do is add a filing list in the Django admin with a Quarter (1, 2, 3 or 4) a date (like 2020-01-01) and a year. Then I have an action for processing the filing list, which will go through each 13F filing in the list and download that filing and then process it (using celery). This is what parses the XML and then creates holdings objects that are mostly what drive the API data.
If yes to the above, do you somehow identify if the .txt filing is of an XML format or not, so you parse it or park it in case of an older, non-xml filing?
The files that I parse are all of the same format, I think. It seems to be XML wrapped in pseudo XML or something, so I parse out the XML the same way for each 13F filing.
Is there any type of a functionality that turns on/off the ingestion of new filings or maybe there is a feature that downloads new filing in real-time as soon as they appear on the SEC site?
This could be implemented, but I don't have this now. There are also other APIs that can help with this, or celery tasks can be scheduled to regularly check for new filings / updates.
Did you figure out how the amendments work, so the data is corrected for the past filings?
Not really, I have thought about this a little bit, so it would be an important improvement going forward. Now I just process all of the files, and I was thinking that I could update the queries to mark which filings are from amendment files, or something like that.
Did you figure out all the different dates in the filings(CONFORMED PERIOD OF REPORT, EFFECTIVENESS DATE, DATE AS OF CHANGE, etc..)
I haven't looked into these different dates yet. I'm using dates that are attached to the Quarter/Year of the filing list files. If these dates are important then it would be good to update the models to use those as well.
Thanks for the log tip. I amended the previous post
I missed the .env.template part. I copied it and was able to install it. So I'm getting closer! Still have issues though. I can now see the site and all the containers are running, but there is no data, nor I seem to be able to log in to the admin page where I guess I need to initiate the data load from. Neither I can access the "API Documentation" part.
See a couple of gifs below
Awesome! Yes, please do share. I'm going to open up GitHub Discussion for this repo. That would be a better place for discussing what 13F analysis features would be worth considering for this project. I'm all ears! I have less experience with SEC data and more with programming.
Will do. I'm not that familiar with SEC, I just do have some ideas about some actual financial features that might help in automation of an investment decision. Basically I want to automate what I currently do manually and SEC has a lot of possibly interesting data that need to be brought to right format > analysed > connected with other data sources > some AI/NLP pass on it > generate some investment leads and insight > present it in an awesome UI..... > many more features...
Anyway, too many ideas to explain. I'll go one by one because a lot of data engineering is needed. So if you like my ideas we can tackle them one by one.
A log from the last docker-compose up
when all the containers got to run. Maybe it'll help identifying why I'm getting the 404 on Admin page or can't really log in?
It's a shame the log doesn't want to get copied in the same easy format as I see it in my IDE
I updated the code and README with instructions on how to generate an admin user and how to create data @kuatroka
That's great. I would also suggest to add to this guide an explicit step with "copy to the newly created .env file the content from .env.template file before running the docker-compose up command" .
I've completed the step where I create the backend superuser and it goes well, but in the UI page, when I go to the "Admin" tab, I'm still getting the "404" error, so I can't use the new credentials to load the data.
@kuatroka OK, you are very close now. You are trying to access the /admin
route, but you are making the request from the frontend app. The frontend app can be accessed on port 8080
, but what you want to do is access the /admin
route from http://localhost/admin
. Accessing localhost
(port 80) will make requests to the nginx
container. nginx will route requests to either the backend
container (if the request path starts with /api
or /admin
or the frontend dev server (all other requests are sent to the frontend). So you can access the Django admin by either going to http://localhost/admin/
or http://localhost:8000/admin/
. http://localhost:8080/admin/
will not work.
Thanks Brian. The problem got sorted when, as per your suggestion in Discussions, I remapped nginx container's port from 80:80 to 8089:80
Hi Brian, thanks for sharing this project. I'm trying to run it locally so I can play with it and maybe extend it(I'm a beginner dev, but I have a lot of conceptual ideas about possible new realistically helpful features) and I'm facing multiple issues with nginx, backend, frontend, celery parts when standing the app up.
Log
``` docker-compose up Starting redis ... Starting redis ... done Starting mailhog ... done Starting postgres ... done Starting frontend ... done Starting backend ... done Starting flower ... done Starting celery ... done Starting nginx ... done Attaching to redis-commander, postgres, redis, frontend, mailhog, flower, celery, backend, nginx flower | [I 211014 16:08:05 command:134] Visit me at http://localhost:5555 flower | [I 211014 16:08:05 command:141] Broker: redis://redis:6379/1 flower | [I 211014 16:08:05 command:142] Registered tasks: flower | ['celery.accumulate', flower | 'celery.backend_cleanup', flower | 'celery.chain', flower | 'celery.chord', flower | 'celery.chord_unlock', flower | 'celery.chunks', flower | 'celery.group', flower | 'celery.map', flower | 'celery.starmap'] flower | [I 211014 16:08:05 mixins:229] Connected to redis://redis:6379/1 frontend | /usr/local/bin/docker-entrypoint.sh: exec: line 8: /app/start_dev.sh: not found mailhog | 2021/10/14 16:08:04 Using in-memory storage mailhog | 2021/10/14 16:08:04 [SMTP] Binding to address: 0.0.0.0:1025 mailhog | [HTTP] Binding to address: 0.0.0.0:8025 mailhog | 2021/10/14 16:08:04 Serving under http://0.0.0.0:8025/ mailhog | Creating API v1 with WebPath: mailhog | Creating API v2 with WebPath: postgres | 2021-10-14 16:08:04.032 UTC [1] LOG: listening on IPv4 address "0.0.0.0", port 5432 postgres | 2021-10-14 16:08:04.032 UTC [1] LOG: listening on IPv6 address "::", port 5432 postgres | 2021-10-14 16:08:04.037 UTC [1] LOG: listening on Unix socket "/var/run/postgresql/.s.PGSQL.5432" postgres | 2021-10-14 16:08:04.054 UTC [25] LOG: database system was shut down at 2021-10-14 00:33:05 UTC redis | 1:C 14 Oct 2021 16:08:03.869 # oO0OoO0OoO0Oo Redis is starting oO0OoO0OoO0Oo redis | 1:C 14 Oct 2021 16:08:03.869 # Redis version=6.2.6, bits=64, commit=00000000, modified=0, pid=1, just started redis | 1:C 14 Oct 2021 16:08:03.869 # Warning: no config file specified, using the default config. In order to specify a config file use redis-server /path/to/redis.conf redis | 1:M 14 Oct 2021 16:08:03.870 * monotonic clock: POSIX clock_gettime redis | 1:M 14 Oct 2021 16:08:03.872 * Running mode=standalone, port=6379. redis | 1:M 14 Oct 2021 16:08:03.872 # WARNING: The TCP backlog setting of 511 cannot be enforced because /proc/sys/net/core/somaxconn is set to the lower value of 128. redis | 1:M 14 Oct 2021 16:08:03.872 # Server initialized redis | 1:M 14 Oct 2021 16:08:03.872 # WARNING overcommit_memory is set to 0! Background save may fail under low memory condition. To fix this issue add 'vm.overcommit_memory = 1' to /etc/sysctl.conf and then reboot or run the command 'sysctl vm.overcommit_memory=1' for this to take effect. redis | 1:M 14 Oct 2021 16:08:03.873 * Loading RDB produced by version 6.2.6 redis | 1:M 14 Oct 2021 16:08:03.873 * RDB age 56098 seconds redis | 1:M 14 Oct 2021 16:08:03.873 * RDB memory usage when created 0.77 Mb redis | 1:M 14 Oct 2021 16:08:03.873 # Done loading RDB, keys loaded: 1, keys expired: 0. redis | 1:M 14 Oct 2021 16:08:03.873 * DB loaded from disk: 0.001 seconds redis | 1:M 14 Oct 2021 16:08:03.873 * Ready to accept connections postgres | 2021-10-14 16:08:04.067 UTC [1] LOG: database system is ready to accept connections frontend exited with code 127 redis-commander | Creating custom redis-commander config '/redis-commander/config/local-production.json'. redis-commander | node ./bin/redis-commander --redis-host redis redis-commander | Using scan instead of keys redis-commander | No Save: false redis-commander | listening on 0.0.0.0:8081 redis-commander | access with browser at http://127.0.0.1:8081 redis-commander | Redis Connection redis:6379 using Redis DB #0 redis-commander | node ./bin/redis-commander --redis-host redis redis-commander | Using scan instead of keys redis-commander | No Save: false redis-commander | listening on 0.0.0.0:8081 redis-commander | access with browser at http://127.0.0.1:8081 redis-commander | setUpConnection (R:redis:6379:0) Redis error Error: getaddrinfo EAI_AGAIN redis redis-commander | at GetAddrInfoReqWrap.onlookup [as oncomplete] (dns.js:66:26) redis-commander | setUpConnection (R:redis:6379:0) Redis error Error: getaddrinfo EAI_AGAIN redis redis-commander | at GetAddrInfoReqWrap.onlookup [as oncomplete] (dns.js:66:26) redis-commander | setUpConnection (R:redis:6379:0) Redis error Error: getaddrinfo EAI_AGAIN redis redis-commander | at GetAddrInfoReqWrap.onlookup [as oncomplete] (dns.js:66:26) redis-commander | setUpConnection (R:redis:6379:0) Redis error Error: getaddrinfo EAI_AGAIN redis redis-commander | at GetAddrInfoReqWrap.onlookup [as oncomplete] (dns.js:66:26) redis-commander | setUpConnection (R:redis:6379:0) Redis error Error: getaddrinfo EAI_AGAIN redis redis-commander | at GetAddrInfoReqWrap.onlookup [as oncomplete] (dns.js:66:26) redis-commander | setUpConnection (R:redis:6379:0) Redis error Error: getaddrinfo EAI_AGAIN redis redis-commander | at GetAddrInfoReqWrap.onlookup [as oncomplete] (dns.js:66:26) redis-commander | setUpConnection (R:redis:6379:0) Redis error Error: getaddrinfo EAI_AGAIN redis redis-commander | at GetAddrInfoReqWrap.onlookup [as oncomplete] (dns.js:66:26) redis-commander | setUpConnection (R:redis:6379:0) Redis error Error: getaddrinfo EAI_AGAIN redis redis-commander | at GetAddrInfoReqWrap.onlookup [as oncomplete] (dns.js:66:26) redis-commander | setUpConnection (R:redis:6379:0) Redis error Error: getaddrinfo EAI_AGAIN redis redis-commander | at GetAddrInfoReqWrap.onlookup [as oncomplete] (dns.js:66:26) redis-commander | setUpConnection (R:redis:6379:0) Redis error Error: getaddrinfo EAI_AGAIN redis redis-commander | at GetAddrInfoReqWrap.onlookup [as oncomplete] (dns.js:66:26) redis-commander | setUpConnection (R:redis:6379:0) Redis error Error: getaddrinfo EAI_AGAIN redis redis-commander | at GetAddrInfoReqWrap.onlookup [as oncomplete] (dns.js:66:26) redis-commander | setUpConnection (R:redis:6379:0) Redis error Error: getaddrinfo EAI_AGAIN redis redis-commander | at GetAddrInfoReqWrap.onlookup [as oncomplete] (dns.js:66:26) redis-commander | setUpConnection (R:redis:6379:0) Redis error Error: getaddrinfo EAI_AGAIN redis redis-commander | at GetAddrInfoReqWrap.onlookup [as oncomplete] (dns.js:66:26) redis-commander | setUpConnection (R:redis:6379:0) Redis error Error: getaddrinfo EAI_AGAIN redis redis-commander | at GetAddrInfoReqWrap.onlookup [as oncomplete] (dns.js:66:26) redis-commander | setUpConnection (R:redis:6379:0) Redis error Error: getaddrinfo EAI_AGAIN redis redis-commander | at GetAddrInfoReqWrap.onlookup [as oncomplete] (dns.js:66:26) redis-commander | setUpConnection (R:redis:6379:0) Redis error Error: getaddrinfo EAI_AGAIN redis redis-commander | at GetAddrInfoReqWrap.onlookup [as oncomplete] (dns.js:66:26) redis-commander | setUpConnection (R:redis:6379:0) Redis error Error: getaddrinfo EAI_AGAIN redis redis-commander | at GetAddrInfoReqWrap.onlookup [as oncomplete] (dns.js:66:26) redis-commander | setUpConnection (R:redis:6379:0) Redis error Error: getaddrinfo EAI_AGAIN redis redis-commander | at GetAddrInfoReqWrap.onlookup [as oncomplete] (dns.js:66:26) redis-commander | setUpConnection (R:redis:6379:0) Redis error Error: getaddrinfo EAI_AGAIN redis redis-commander | at GetAddrInfoReqWrap.onlookup [as oncomplete] (dns.js:66:26) redis-commander | setUpConnection (R:redis:6379:0) Redis error Error: getaddrinfo EAI_AGAIN redis redis-commander | at GetAddrInfoReqWrap.onlookup [as oncomplete] (dns.js:66:26) redis-commander | setUpConnection (R:redis:6379:0) Redis error Error: getaddrinfo EAI_AGAIN redis redis-commander | at GetAddrInfoReqWrap.onlookup [as oncomplete] (dns.js:66:26) redis-commander | setUpConnection (R:redis:6379:0) Redis error Error: getaddrinfo EAI_AGAIN redis redis-commander | at GetAddrInfoReqWrap.onlookup [as oncomplete] (dns.js:66:26) redis-commander | setUpConnection (R:redis:6379:0) Redis error Error: getaddrinfo EAI_AGAIN redis redis-commander | at GetAddrInfoReqWrap.onlookup [as oncomplete] (dns.js:66:26) redis-commander | setUpConnection (R:redis:6379:0) Redis error Error: getaddrinfo EAI_AGAIN redis redis-commander | at GetAddrInfoReqWrap.onlookup [as oncomplete] (dns.js:66:26) redis-commander | setUpConnection (R:redis:6379:0) Redis error Error: getaddrinfo EAI_AGAIN redis redis-commander | at GetAddrInfoReqWrap.onlookup [as oncomplete] (dns.js:66:26) redis-commander | setUpConnection (R:redis:6379:0) Redis error Error: getaddrinfo EAI_AGAIN redis redis-commander | at GetAddrInfoReqWrap.onlookup [as oncomplete] (dns.js:66:26) redis-commander | setUpConnection (R:redis:6379:0) Redis error Error: getaddrinfo EAI_AGAIN redis redis-commander | at GetAddrInfoReqWrap.onlookup [as oncomplete] (dns.js:66:26) redis-commander | setUpConnection (R:redis:6379:0) Redis error Error: getaddrinfo EAI_AGAIN redis redis-commander | at GetAddrInfoReqWrap.onlookup [as oncomplete] (dns.js:66:26) redis-commander | setUpConnection (R:redis:6379:0) Redis error Error: getaddrinfo EAI_AGAIN redis redis-commander | at GetAddrInfoReqWrap.onlookup [as oncomplete] (dns.js:66:26) redis-commander | setUpConnection (R:redis:6379:0) Redis error Error: getaddrinfo EAI_AGAIN redis redis-commander | at GetAddrInfoReqWrap.onlookup [as oncomplete] (dns.js:66:26) redis-commander | setUpConnection (R:redis:6379:0) Redis error Error: getaddrinfo EAI_AGAIN redis redis-commander | at GetAddrInfoReqWrap.onlookup [as oncomplete] (dns.js:66:26) redis-commander | setUpConnection (R:redis:6379:0) Redis error Error: getaddrinfo EAI_AGAIN redis redis-commander | at GetAddrInfoReqWrap.onlookup [as oncomplete] (dns.js:66:26) redis-commander | setUpConnection (R:redis:6379:0) Redis error Error: getaddrinfo EAI_AGAIN redis redis-commander | at GetAddrInfoReqWrap.onlookup [as oncomplete] (dns.js:66:26) redis-commander | setUpConnection (R:redis:6379:0) Redis error Error: getaddrinfo EAI_AGAIN redis redis-commander | at GetAddrInfoReqWrap.onlookup [as oncomplete] (dns.js:66:26) redis-commander | setUpConnection (R:redis:6379:0) Redis error Error: getaddrinfo EAI_AGAIN redis redis-commander | at GetAddrInfoReqWrap.onlookup [as oncomplete] (dns.js:66:26) redis-commander | setUpConnection (R:redis:6379:0) Redis error Error: getaddrinfo EAI_AGAIN redis redis-commander | at GetAddrInfoReqWrap.onlookup [as oncomplete] (dns.js:66:26) redis-commander | setUpConnection (R:redis:6379:0) Redis error Error: getaddrinfo EAI_AGAIN redis redis-commander | at GetAddrInfoReqWrap.onlookup [as oncomplete] (dns.js:66:26) redis-commander | setUpConnection (R:redis:6379:0) Redis error Error: getaddrinfo EAI_AGAIN redis redis-commander | at GetAddrInfoReqWrap.onlookup [as oncomplete] (dns.js:66:26) redis-commander | setUpConnection (R:redis:6379:0) Redis error Error: getaddrinfo EAI_AGAIN redis redis-commander | at GetAddrInfoReqWrap.onlookup [as oncomplete] (dns.js:66:26) redis-commander | setUpConnection (R:redis:6379:0) Redis error Error: getaddrinfo EAI_AGAIN redis redis-commander | at GetAddrInfoReqWrap.onlookup [as oncomplete] (dns.js:66:26) redis-commander | setUpConnection (R:redis:6379:0) Redis error Error: getaddrinfo EAI_AGAIN redis redis-commander | at GetAddrInfoReqWrap.onlookup [as oncomplete] (dns.js:66:26) redis-commander | setUpConnection (R:redis:6379:0) Redis error Error: getaddrinfo EAI_AGAIN redis redis-commander | at GetAddrInfoReqWrap.onlookup [as oncomplete] (dns.js:66:26) redis-commander | setUpConnection (R:redis:6379:0) Redis error Error: getaddrinfo EAI_AGAIN redis redis-commander | at GetAddrInfoReqWrap.onlookup [as oncomplete] (dns.js:66:26) redis-commander | setUpConnection (R:redis:6379:0) Redis error Error: getaddrinfo EAI_AGAIN redis redis-commander | at GetAddrInfoReqWrap.onlookup [as oncomplete] (dns.js:66:26) redis-commander | setUpConnection (R:redis:6379:0) Redis error Error: getaddrinfo EAI_AGAIN redis redis-commander | at GetAddrInfoReqWrap.onlookup [as oncomplete] (dns.js:66:26) redis-commander | Redis Connection redis:6379 using Redis DB #0 backend | Traceback (most recent call last): backend | File "manage.py", line 22, inThanks