Bhanu Prasanna commited on
Commit
4cd0338
1 Parent(s): 55ee061
.idea/.gitignore ADDED
@@ -0,0 +1,8 @@
 
 
 
 
 
 
 
 
 
1
+ # Default ignored files
2
+ /shelf/
3
+ /workspace.xml
4
+ # Editor-based HTTP Client requests
5
+ /httpRequests/
6
+ # Datasource local storage ignored files
7
+ /dataSources/
8
+ /dataSources.local.xml
.idea/CapiPortV2.iml ADDED
@@ -0,0 +1,8 @@
 
 
 
 
 
 
 
 
 
1
+ <?xml version="1.0" encoding="UTF-8"?>
2
+ <module type="PYTHON_MODULE" version="4">
3
+ <component name="NewModuleRootManager">
4
+ <content url="file://$MODULE_DIR$" />
5
+ <orderEntry type="jdk" jdkName="data_science" jdkType="Python SDK" />
6
+ <orderEntry type="sourceFolder" forTests="false" />
7
+ </component>
8
+ </module>
.idea/inspectionProfiles/Project_Default.xml ADDED
@@ -0,0 +1,39 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <component name="InspectionProjectProfileManager">
2
+ <profile version="1.0">
3
+ <option name="myName" value="Project Default" />
4
+ <inspection_tool class="PyPackageRequirementsInspection" enabled="true" level="WARNING" enabled_by_default="true">
5
+ <option name="ignoredPackages">
6
+ <value>
7
+ <list size="26">
8
+ <item index="0" class="java.lang.String" itemvalue="pandas" />
9
+ <item index="1" class="java.lang.String" itemvalue="numpy" />
10
+ <item index="2" class="java.lang.String" itemvalue="referencing" />
11
+ <item index="3" class="java.lang.String" itemvalue="protobuf" />
12
+ <item index="4" class="java.lang.String" itemvalue="validators" />
13
+ <item index="5" class="java.lang.String" itemvalue="python-dateutil" />
14
+ <item index="6" class="java.lang.String" itemvalue="python-dotenv" />
15
+ <item index="7" class="java.lang.String" itemvalue="MarkupSafe" />
16
+ <item index="8" class="java.lang.String" itemvalue="jsonschema-specifications" />
17
+ <item index="9" class="java.lang.String" itemvalue="rpds-py" />
18
+ <item index="10" class="java.lang.String" itemvalue="Pygments" />
19
+ <item index="11" class="java.lang.String" itemvalue="zipp" />
20
+ <item index="12" class="java.lang.String" itemvalue="urllib3" />
21
+ <item index="13" class="java.lang.String" itemvalue="jsonschema" />
22
+ <item index="14" class="java.lang.String" itemvalue="beautifulsoup4" />
23
+ <item index="15" class="java.lang.String" itemvalue="pyarrow" />
24
+ <item index="16" class="java.lang.String" itemvalue="importlib_metadata" />
25
+ <item index="17" class="java.lang.String" itemvalue="pymongo" />
26
+ <item index="18" class="java.lang.String" itemvalue="tornado" />
27
+ <item index="19" class="java.lang.String" itemvalue="tzdata" />
28
+ <item index="20" class="java.lang.String" itemvalue="rich" />
29
+ <item index="21" class="java.lang.String" itemvalue="attrs" />
30
+ <item index="22" class="java.lang.String" itemvalue="watchdog" />
31
+ <item index="23" class="java.lang.String" itemvalue="cachetools" />
32
+ <item index="24" class="java.lang.String" itemvalue="pytz" />
33
+ <item index="25" class="java.lang.String" itemvalue="idna" />
34
+ </list>
35
+ </value>
36
+ </option>
37
+ </inspection_tool>
38
+ </profile>
39
+ </component>
.idea/inspectionProfiles/profiles_settings.xml ADDED
@@ -0,0 +1,6 @@
 
 
 
 
 
 
 
1
+ <component name="InspectionProjectProfileManager">
2
+ <settings>
3
+ <option name="USE_PROJECT_PROFILE" value="false" />
4
+ <version value="1.0" />
5
+ </settings>
6
+ </component>
.idea/misc.xml ADDED
@@ -0,0 +1,7 @@
 
 
 
 
 
 
 
 
1
+ <?xml version="1.0" encoding="UTF-8"?>
2
+ <project version="4">
3
+ <component name="Black">
4
+ <option name="sdkName" value="data_science" />
5
+ </component>
6
+ <component name="ProjectRootManager" version="2" project-jdk-name="data_science" project-jdk-type="Python SDK" />
7
+ </project>
.idea/modules.xml ADDED
@@ -0,0 +1,8 @@
 
 
 
 
 
 
 
 
 
1
+ <?xml version="1.0" encoding="UTF-8"?>
2
+ <project version="4">
3
+ <component name="ProjectModuleManager">
4
+ <modules>
5
+ <module fileurl="file://$PROJECT_DIR$/.idea/CapiPortV2.iml" filepath="$PROJECT_DIR$/.idea/CapiPortV2.iml" />
6
+ </modules>
7
+ </component>
8
+ </project>
.idea/vcs.xml ADDED
@@ -0,0 +1,6 @@
 
 
 
 
 
 
 
1
+ <?xml version="1.0" encoding="UTF-8"?>
2
+ <project version="4">
3
+ <component name="VcsDirectoryMappings">
4
+ <mapping directory="" vcs="Git" />
5
+ </component>
6
+ </project>
utilities/py/mongodb.py ADDED
@@ -0,0 +1,29 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ from pymongo import MongoClient
2
+ import socket
3
+ from dotenv import load_dotenv
4
+ import os
5
+ import urllib
6
+
7
+ load_dotenv()
8
+ def mongodb_push_data (company_name_to_symbol, number_of_symbols):
9
+ username = urllib.parse.quote_plus(os.environ.get("USERNAME"))
10
+ password = urllib.parse.quote_plus(os.environ.get("PASSWORD"))
11
+
12
+ MONGO_DB_URI = "mongodb+srv://%s:%s@capiport.xtnx5it.mongodb.net/" % (username, password)
13
+
14
+ client = MongoClient (MONGO_DB_URI)
15
+ if "capiport" in client. list_database_names():
16
+ db = client ["capiport"]
17
+ else:
18
+ db = client ["capiport"]
19
+ collection = db ["stocks they picked"]
20
+ hostname = socket.gethostname()
21
+ ip_address = socket. gethostbyname(hostname)
22
+ data = {
23
+ "hostname": hostname,
24
+ "stocks_picked": company_name_to_symbol,
25
+ 'number_of_stocks_picked': number_of_symbols,
26
+ "ip_address": ip_address
27
+ }
28
+ collection. insert_one(data)
29
+ client. close ()