tpulse-py
Tinkoff social pulse api wrapper
Installation
pip install tpulse
Usage example
get_user_info()
>>> from tpulse import TinkoffPulse
>>> from pprint import pp
>>> pulse = TinkoffPulse()
>>>
>>> user_info = pulse.get_user_info("tomcapital")
>>> pp(user_info)
{'id': 'bfbc4cc2-7f98-472e-8f5f-a14bdd6fc4db',
'type': 'personal',
'nickname': 'TomCapital',
'status': 'open',
'image': '22ac448f-e271-463c-beb1-f035c7987f17',
'block': False,
'description': 'Эксклюзивная аналитика тут: https://t.me/tomcapital\n'
'\n'
'Связь: https://t.me/TomCapCat\n'
'\n'
'growth stocks strategy\n'
'\n'
'Ты должен изучить правила игры. Затем начать играть лучше, '
'чем кто-либо другой.',
'followersCount': 39704,
'followingCount': 13,
'isLead': False,
'serviceTags': [{'id': 'popular'}],
'statistics': {'totalAmountRange': {'lower': 3000000, 'upper': None},
'yearRelativeYield': -5.68,
'monthOperationsCount': 98},
'subscriptionDomains': None,
'popularHashtags': [],
'donationActive': True,
'isVisible': True,
'baseTariffCategory': 'unauthorized',
'strategies': [{'id': 'a48ee1fc-4eaa-47a3-a75c-a362d3c95cdf',
'title': 'Tactical Investing',
'riskProfile': 'moderate',
'relativeYield': 3.93,
'baseCurrency': 'usd',
'score': 4,
'portfolioValues': [...],
'characteristics': [{'id': 'recommended-base-money-position-quantity',
'value': '1\xa0100 $',
'subtitle': 'советуем вложить'},
{'id': 'slaves-count',
'value': '111',
'subtitle': 'подписаны'}]},
{'id': 'ff41c693-78dd-4c2e-b566-858770d6d2e0',
'title': 'Aggressive investing',
'riskProfile': 'aggressive',
'relativeYield': -8.19,
'baseCurrency': 'usd',
'score': 3,
'portfolioValues': [...],
'characteristics': [{'id': 'recommended-base-money-position-quantity',
'value': '1\xa0000 $',
'subtitle': 'советуем вложить'},
{'id': 'slaves-count',
'value': '17',
'subtitle': 'подписаны'}]}]}
get_posts_by_user_id()
>>> user_posts = pulse.get_posts_by_user_id("bfbc4cc2-7f98-472e-8f5f-a14bdd6fc4db")
>>> pp(user_posts)
...
>>> pp(user_posts["items"][0])
{'id': '2ab5457c-aa9d-4a9b-b7ea-7af49459f0f9',
'text': 'Множество акций испытали массивную коррекцию за последние несколько '
'недель, особенно это касается growth-историй (компаний, чей '
'потенциал и денежные потоки должны раскрыться в будущем). На '
'фондовый рынок обрушилась целая лавина плохих новостей (высказывания '
'Пауэлла, тейперинг, Omicron и тд), и, на мой взгляд, мы увидели '
'некую чрезмерную реакцию рынка.\n'
'\n'
'Часто, когда фондовый рынок заранее корректируется и закладывает те '
'или иные негативные события в оценку активов, то уже непосредственно '
'по факту наступления этих самых событий, рынок, как правило, '
'успевает переварить их, и, наоборот, раллирует. Особенно, если '
'случилась избыточная или даже паническая реакция на негатив.\n'
'\n'
'Марко Коланович, главный стратег JPMorgan, оценивает вероятность '
'шорт-сквиз ралли в ближайшие недели, как высокую, и я, пожалуй, буду '
'придерживаться такой же точки зрения.',
'likesCount': 42,
'commentsCount': 10,
'isLiked': False,
'inserted': '2021-12-22T15:22:38.016128+03:00',
'isEditable': False,
'instruments': [],
'profiles': [],
'serviceTags': [],
'profileId': 'bfbc4cc2-7f98-472e-8f5f-a14bdd6fc4db',
'nickname': 'TomCapital',
'image': '22ac448f-e271-463c-beb1-f035c7987f17',
'postImages': [],
'hashtags': [],
'owner': {'id': 'bfbc4cc2-7f98-472e-8f5f-a14bdd6fc4db',
'nickname': 'TomCapital',
'image': '22ac448f-e271-463c-beb1-f035c7987f17',
'donationActive': False,
'block': False,
'serviceTags': [{'id': 'popular'}]},
'reactions': {'totalCount': 42,
'myReaction': None,
'counters': [{'type': 'like', 'count': 42}]},
'content': {'type': 'simple',
'text': '',
'instruments': [],
'hashtags': [],
'profiles': [],
'images': [],
'strategies': []},
'baseTariffCategory': 'unauthorized',
'isBookmarked': False,
'status': 'published'}
get_posts_by_ticker()
>>> ticker_posts = pulse.get_posts_by_ticker("AAPL")
>>> pp(ticker_posts)
...
>>> pp(ticker_posts["items"][5])
{'id': '320b8e15-fe8c-46e9-b29b-12ef278be135',
'text': '{$AAPL} продажу поставил на 176 $',
'likesCount': 0,
'commentsCount': 6,
'isLiked': False,
'inserted': '2021-12-23T11:54:50.603445+03:00',
'isEditable': False,
'instruments': [{'type': 'share',
'ticker': 'AAPL',
'lastPrice': 176.02,
'currency': 'usd',
'image': 'US0378331005.png',
'briefName': 'Apple',
'dailyYield': None,
'relativeDailyYield': 0.0,
'price': 175.34,
'relativeYield': 0.39}],
'profiles': [],
'serviceTags': [],
'profileId': '436a1012-3c5d-4c84-879b-a4e434f43230',
'nickname': 'TNEO',
'image': 'fc85fbc9-ef4a-4045-905d-bd6fb581689c',
'postImages': [],
'hashtags': [],
'owner': {'id': '436a1012-3c5d-4c84-879b-a4e434f43230',
'nickname': 'TNEO',
'image': 'fc85fbc9-ef4a-4045-905d-bd6fb581689c',
'donationActive': False,
'block': False,
'serviceTags': []},
'reactions': {'totalCount': 0, 'myReaction': None, 'counters': []},
'content': {'type': 'simple',
'text': '',
'instruments': [{'type': 'share',
'ticker': 'AAPL',
'lastPrice': 176.02,
'currency': 'usd',
'image': 'US0378331005.png',
'briefName': 'Apple',
'dailyYield': None,
'relativeDailyYield': 0.0,
'price': 175.34,
'relativeYield': 0.39}],
'hashtags': [],
'profiles': [],
'images': [],
'strategies': []},
'baseTariffCategory': 'unauthorized',
'isBookmarked': False,
'status': 'published'}
Metadata
Release files for tpulse 0.1.9
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| tpulse-0.1.9.tar.gz | 8.4 kB | Without provenance | Details for tpulse-0.1.9.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| tpulse-0.1.9-py3-none-any.whl | Python 3 | none | any | Details for tpulse-0.1.9-py3-none-any.whl |
Total release size: 14.8 kB
Release files / tpulse-0.1.9.tar.gz
| Download URL | tpulse-0.1.9.tar.gz |
|---|---|
| Size | 8.4 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
c1065bdc5b241cbaf4a8ff4baf02121d3f427837c34031a746b4be97f2338136
|
|
BLAKE2b-256 checksum How to use checksums |
b9c82213e57c22b337f336137239f3de16dd85663b1de61d134f8f8ead039a77
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
python-requests/2.26.0
|
Release files / tpulse-0.1.9-py3-none-any.whl
| Download URL | tpulse-0.1.9-py3-none-any.whl |
|---|---|
| Size | 6.4 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
ebe89eb466bdb4663ff4e6c82b02a2b0f54e44b62d013fa95993ac50f36e134d
|
|
BLAKE2b-256 checksum How to use checksums |
ed32f47241450ff530a2717c06d2204f9d87c1c2da43b48eff8e5c8e76089f96
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
python-requests/2.26.0
|
Security for tpulse 0.1.9
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.