investfly-sdk 1.0__py3-none-any.whl → 1.2__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- investfly/__init__.py +5 -0
- investfly/api/IndicatorApiClient.py +24 -0
- investfly/api/InvestflyApiClient.py +27 -1
- investfly/api/MarketDataApiClient.py +4 -0
- investfly/api/PortfolioApiClient.py +4 -0
- investfly/api/RestApiClient.py +7 -2
- investfly/api/StrategyApiClient.py +45 -0
- investfly/api/__init__.py +17 -0
- investfly/cli/InvestflyCli.py +217 -0
- investfly/models/CommonModels.py +31 -0
- investfly/models/Indicator.py +89 -14
- investfly/models/MarketData.py +13 -2
- investfly/models/MarketDataIds.py +3 -1
- investfly/models/PortfolioModels.py +11 -0
- investfly/models/SecurityUniverseSelector.py +9 -1
- investfly/models/StrategyModels.py +62 -1
- investfly/models/TradingStrategy.py +67 -16
- investfly/models/__init__.py +9 -1
- investfly/samples/strategies/SmaCrossOverTemplate.py +1 -1
- investfly_sdk-1.2.dist-info/METADATA +194 -0
- investfly_sdk-1.2.dist-info/RECORD +39 -0
- {investfly_sdk-1.0.dist-info → investfly_sdk-1.2.dist-info}/WHEEL +1 -1
- investfly_sdk-1.2.dist-info/entry_points.txt +2 -0
- investfly/cli/CliApiClient.py +0 -46
- investfly/cli/commands.py +0 -78
- investfly_sdk-1.0.dist-info/METADATA +0 -53
- investfly_sdk-1.0.dist-info/RECORD +0 -38
- investfly_sdk-1.0.dist-info/entry_points.txt +0 -2
- {investfly_sdk-1.0.dist-info → investfly_sdk-1.2.dist-info}/LICENSE.txt +0 -0
- {investfly_sdk-1.0.dist-info → investfly_sdk-1.2.dist-info}/top_level.txt +0 -0
investfly/cli/commands.py
DELETED
@@ -1,78 +0,0 @@
|
|
1
|
-
import argparse
|
2
|
-
import pickle
|
3
|
-
import os.path
|
4
|
-
|
5
|
-
from investfly.cli.CliApiClient import CliApiClient
|
6
|
-
|
7
|
-
def main():
|
8
|
-
# Check to see if user already has a session active
|
9
|
-
if os.path.exists('/tmp/loginSession'):
|
10
|
-
tmpfile = open('/tmp/loginSession', 'rb')
|
11
|
-
restApi = pickle.load(tmpfile)
|
12
|
-
tmpfile.close()
|
13
|
-
else:
|
14
|
-
restApi = CliApiClient("https://api.investfly.com")
|
15
|
-
|
16
|
-
# CLI Commands
|
17
|
-
parser = argparse.ArgumentParser()
|
18
|
-
subparser = parser.add_subparsers(dest='command')
|
19
|
-
|
20
|
-
parser_login = subparser.add_parser('login', help='Login to Investfly')
|
21
|
-
parser_login.add_argument('-u', '--username', required='true', help='Input username')
|
22
|
-
parser_login.add_argument('-p', '--password', required='true', help='Input user password')
|
23
|
-
|
24
|
-
subparser.add_parser('whoami', help='View your user information')
|
25
|
-
|
26
|
-
subparser.add_parser('logout', help='Logout')
|
27
|
-
|
28
|
-
parser_strategy = subparser.add_parser('strategy', help='View all your current strategies')
|
29
|
-
parser_strategy.add_argument('-id', help='Provide the Strategy ID')
|
30
|
-
parser_strategy.add_argument('-o', '--output-file', help='Provide a location to save the output file of a custom strategy (Requires Strategy ID)')
|
31
|
-
parser_strategy.add_argument('-u', '--update-file', help='Provide the file location to update the script of a custom strategy (Requires Strategy ID)')
|
32
|
-
|
33
|
-
args = parser.parse_args()
|
34
|
-
|
35
|
-
# If user is logging in, create a new login session and save it locally
|
36
|
-
if args.command == 'login':
|
37
|
-
restApi.login(args.username, args.password)
|
38
|
-
tmpFile = open('/tmp/loginSession', 'ab')
|
39
|
-
pickle.dump(restApi, tmpFile)
|
40
|
-
tmpFile.close()
|
41
|
-
|
42
|
-
elif args.command == 'logout':
|
43
|
-
restApi.logout()
|
44
|
-
os.remove('/tmp/loginSession')
|
45
|
-
|
46
|
-
elif args.command == 'whoami':
|
47
|
-
restApi.getStatus()
|
48
|
-
|
49
|
-
elif args.command == 'strategy':
|
50
|
-
if all(e is None for e in [args.id, args.output_file, args.update_file]):
|
51
|
-
restApi.getStrategies()
|
52
|
-
elif (args.output_file is not None) and (args.id is not None):
|
53
|
-
try:
|
54
|
-
code = restApi.saveStrategy(args.id)
|
55
|
-
file = open(args.output_file, "w")
|
56
|
-
file.write(code)
|
57
|
-
file.close()
|
58
|
-
print('File successfully saved to '+args.output_file)
|
59
|
-
except Exception as e:
|
60
|
-
print(e)
|
61
|
-
elif (args.update_file is not None) and (args.id is not None):
|
62
|
-
try:
|
63
|
-
file = open(args.update_file, "r")
|
64
|
-
code = file.read()
|
65
|
-
restApi.updateStrategy(args.id, code)
|
66
|
-
file.close()
|
67
|
-
except Exception as e:
|
68
|
-
print(e)
|
69
|
-
else:
|
70
|
-
parser_strategy.print_help()
|
71
|
-
|
72
|
-
|
73
|
-
else:
|
74
|
-
parser.print_help()
|
75
|
-
|
76
|
-
|
77
|
-
if __name__ == '__main__':
|
78
|
-
main()
|
@@ -1,53 +0,0 @@
|
|
1
|
-
Metadata-Version: 2.1
|
2
|
-
Name: investfly-sdk
|
3
|
-
Version: 1.0
|
4
|
-
Summary: Investfly SDK
|
5
|
-
Author-email: "Investfly.com" <admin@investfly.com>
|
6
|
-
License: The MIT License (MIT)
|
7
|
-
|
8
|
-
Copyright (c) 2023+ Investfly, Finverse LLC
|
9
|
-
|
10
|
-
Permission is hereby granted, free of charge, to any person obtaining a copy
|
11
|
-
of this software and associated documentation files (the "Software"), to deal
|
12
|
-
in the Software without restriction, including without limitation the rights
|
13
|
-
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
14
|
-
copies of the Software, and to permit persons to whom the Software is
|
15
|
-
furnished to do so, subject to the following conditions:
|
16
|
-
|
17
|
-
The above copyright notice and this permission notice shall be included in all
|
18
|
-
copies or substantial portions of the Software.
|
19
|
-
|
20
|
-
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
21
|
-
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
22
|
-
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
23
|
-
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
24
|
-
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
25
|
-
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
26
|
-
SOFTWARE.
|
27
|
-
Project-URL: Homepage, https://www.investfly.com
|
28
|
-
Classifier: Programming Language :: Python :: 3
|
29
|
-
Classifier: License :: OSI Approved :: MIT License
|
30
|
-
Classifier: Operating System :: OS Independent
|
31
|
-
Requires-Python: >=3.7
|
32
|
-
Description-Content-Type: text/markdown
|
33
|
-
License-File: LICENSE.txt
|
34
|
-
Requires-Dist: certifi ==2023.7.22
|
35
|
-
Requires-Dist: charset-normalizer ==3.2.0
|
36
|
-
Requires-Dist: idna ==3.4
|
37
|
-
Requires-Dist: pandas ==2.0.3
|
38
|
-
Requires-Dist: pandas-stubs ==2.0.3.230814
|
39
|
-
Requires-Dist: pandas-ta ==0.3.14b0
|
40
|
-
Requires-Dist: python-dateutil ==2.8.2
|
41
|
-
Requires-Dist: pytz ==2023.3
|
42
|
-
Requires-Dist: requests ==2.31.0
|
43
|
-
Requires-Dist: types-requests ==2.31.0.2
|
44
|
-
Requires-Dist: six ==1.16.0
|
45
|
-
Requires-Dist: tzdata ==2023.3
|
46
|
-
Requires-Dist: urllib3 ==1.26.15
|
47
|
-
Requires-Dist: numpy ==1.26.4
|
48
|
-
|
49
|
-
# About
|
50
|
-
|
51
|
-
Python-SDK to work with Investfly API.
|
52
|
-
[Investfly](https://www.investfly.com)
|
53
|
-
|
@@ -1,38 +0,0 @@
|
|
1
|
-
investfly/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
2
|
-
investfly/api/InvestflyApiClient.py,sha256=dHAWBaMPCPLVYvpzHGAwHisUeDcGN0yDwZC3Jl4LYew,799
|
3
|
-
investfly/api/MarketDataApiClient.py,sha256=XmGIt5RK0-70cHTDF24g3YXqqxCNyzMzBIVhz1-7ZqY,460
|
4
|
-
investfly/api/PortfolioApiClient.py,sha256=FVPjFz_eVLVXs-yPRefIcPoNiR3_WWzG7L0Dht60Z2o,1693
|
5
|
-
investfly/api/RestApiClient.py,sha256=QRLkvsnzmIgBRnh1_sBxKJtS8oE03YcT3FUA1LRFkuo,3029
|
6
|
-
investfly/api/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
7
|
-
investfly/cli/CliApiClient.py,sha256=PJe85_9jkMFBtKH5PNw3jtWjjk14DNTR089LA_IT5Fg,1482
|
8
|
-
investfly/cli/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
9
|
-
investfly/cli/commands.py,sha256=foVs0kXuFCWRFOgvk_iWxdIB-xODVjal00pIWCw_0Mg,2826
|
10
|
-
investfly/models/CommonModels.py,sha256=OrwgqCiDL_HJfZTJeeVVsHUuRSDm6Ehk9xpnFy5AB5I,1663
|
11
|
-
investfly/models/Indicator.py,sha256=FqiuiJJXCHUQtxf1AGUhIv2oYy3705D9MT3aVrJpX_s,6879
|
12
|
-
investfly/models/MarketData.py,sha256=h7mefNLmAtLL8z75CQy0FZsSazKnsaWULt4B4Bh2uhw,5786
|
13
|
-
investfly/models/MarketDataIds.py,sha256=ITrMVC0EjC58Xf7nlLG-GIwN46vWmNzegFZFW8GXT0E,3124
|
14
|
-
investfly/models/ModelUtils.py,sha256=pnrVIDM26LqK0Wuw7gTs0c97lCLIV_fm0EUtlEfT7j4,964
|
15
|
-
investfly/models/PortfolioModels.py,sha256=JvqZiH0g3w9qGqEXywpgqasM9olV3n6kjH7bfy9t0Z0,8462
|
16
|
-
investfly/models/SecurityFilterModels.py,sha256=4baTBBI-XOKh8uTpvqVvk3unD-xHoyooO3dd5lKWbXA,5806
|
17
|
-
investfly/models/SecurityUniverseSelector.py,sha256=z4V5Ng0DQ8DVy8FeuB_7swAYO7rmSK6HfJc7vA1NCq8,8111
|
18
|
-
investfly/models/StrategyModels.py,sha256=j9IuGnLO0g_po95-6AteZnvy9wdNR4EJ_lF-rkn3Q3w,3585
|
19
|
-
investfly/models/TradingStrategy.py,sha256=dbsQ0wAY7M6s3yUpjp5cXp2X3tZwaUFB48pW-79C5D8,2825
|
20
|
-
investfly/models/__init__.py,sha256=YVr7PakHt-g7pRmihFqYrvxNMwYE-rlDymFGp4neUdE,1071
|
21
|
-
investfly/samples/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
22
|
-
investfly/samples/indicators/IndicatorTemplate.py,sha256=X0AlStLnL1SBSnTwrtW_sthm00tmuN5V7N-GrtiarmM,4454
|
23
|
-
investfly/samples/indicators/NewsSentiment.py,sha256=fcpAqOcNWmqYsP-xwJquCX_6G7Ntr3A1-m31eJHAUOE,65095
|
24
|
-
investfly/samples/indicators/RsiOfSma.py,sha256=kiLvMhrsbc_lV0EEpERGW2im19u5XmyJk88aTDGSBis,1719
|
25
|
-
investfly/samples/indicators/SmaEmaAverage.py,sha256=9pp3TtEKJADD_bfufwrWlwMswlTLoN7Nj6BC_jJ1sRs,1749
|
26
|
-
investfly/samples/indicators/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
27
|
-
investfly/samples/strategies/SmaCrossOverStrategy.py,sha256=szjmnqQN8O7CRIS1vc-fRONKg4Dy1d59dZhiSEpEJAI,1699
|
28
|
-
investfly/samples/strategies/SmaCrossOverTemplate.py,sha256=UUQjDkwQ4sn_ohMcW_J3rIietMIx69CX6gK6HuIFF-A,8164
|
29
|
-
investfly/samples/strategies/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
30
|
-
investfly/utils/CommonUtils.py,sha256=lCXAdI8-6PgbutcXJqUmSfuuLXp82FcnlxNVjCJpqLU,2631
|
31
|
-
investfly/utils/PercentBasedPortfolioAllocator.py,sha256=oKaSjq5L_3NfRo2iayepCZtZnCevsx4XpsxFfZMTnV8,1684
|
32
|
-
investfly/utils/__init__.py,sha256=2BqXoOQElv-GIU6wvmf2aaAABAcNny2TETcj7kf9rzM,129
|
33
|
-
investfly_sdk-1.0.dist-info/LICENSE.txt,sha256=Jmd2U7G7Z1oNdnRERRzFXN6C--bEo_K56j4v9EpJSTg,1090
|
34
|
-
investfly_sdk-1.0.dist-info/METADATA,sha256=sjsQYBDhYkB77JBgbIFhj9sIr9KqffIropVjo0miif8,2239
|
35
|
-
investfly_sdk-1.0.dist-info/WHEEL,sha256=mguMlWGMX-VHnMpKOjjQidIo1ssRlCFu4a4mBpz1s2M,91
|
36
|
-
investfly_sdk-1.0.dist-info/entry_points.txt,sha256=4PPHKy66mm-HrogzgqGKP7l9zCury-wY84H4KAymloY,62
|
37
|
-
investfly_sdk-1.0.dist-info/top_level.txt,sha256=dlEJ2OGWA3prqMvXELeydS5RTdpSzh7hz1LwR3NMc7A,10
|
38
|
-
investfly_sdk-1.0.dist-info/RECORD,,
|
File without changes
|
File without changes
|