Skip to main content

The social ethosa library for Python

Project description

social_ethosa

The social ethosa library using Python.

Get vk access token here: https://vkhost.github.io/ (choose the Kate mobile.)

install: pip install social-ethosa --upgrade

usage:

from social_ethosa.vkcom import *

token = 'Your token here'

vk = Vk(token=token) # if you want auth to user
vk = Vk(token=Group_Access_Token, group_id='id your group') # if you want auth to group

@vk.on_message_new # handler new messages
def get_message(obj):
  peer_id = obj.peer_id
  message = obj.text
  vk.messages.send(message='hello vkcom!', peer_id=peer_id, random_id=0)

@vk.on_error # errors handler
def get_error(error):
  print(error.msg) # Example: No module named 'aa'
  print(error.line) # Example: 1
  print(error.code) # Example: ModuleNotFoundError

need help? no problem!

print(vk.help())
print()
print(vk.help('messages'))
print()
print(vk.help('messages.send'))

You can also use Smile to get smiley codes!

print(Smile('Улыбка'))
print(Smile('Красная книга'))
print(Smile().smiles) # it return ALL SMILEY CODES!

Example audio message:

from social_ethosa.vkcom import *

token = 'user token here'

vk = Vk(token=token, debug=True, lang='ru')

file = 'mil_tokyo1.ogg'
vk.uploader.getUploadUrl('audio_message', peer_id=1234567890)
response = vk.uploader.uploadFile(file=file)

audio_message = f'doc{response["audio_message"]["owner_id"]}_{response["audio_message"]["id"]}'

vk.messages.send(peer_id=1234567890, message='test uploader', attachment=audio_message, random_id=random.randint(0, 1000))

Example photo in message:

from social_ethosa.vkcom import *

token = 'user token here'

vk = Vk(token=token, debug=True, lang='ru')

file = 'b.png'
vk.uploader.getUploadUrl('message_photo')
response = vk.uploader.uploadFile(file=file)

photo = f'photo{response["owner_id"]}_{response["id"]}'

vk.messages.send(peer_id=1234567890, message='test uploader', attachment=photo, random_id=random.randint(0, 1000))

working with audio:

from social_ethosa.vkcom import *

login = '71234567890'
password = 'hi_i_passowrd'

audio = VkAudio(login=login, password=password, debug=True, lang='ru')

print(audio.get()) # return your audios
print(audio.get(123)) # return audios of user with id 123
print(audio.getCount()) # return count of your audios
print(audio.getCount(123)) # return count audios of user with id 123
pprint(audio.getById(owner_id=-148928912, audio_id=456239018)) # return audio-148928912_456239018
pprint(audio.search('minecraft')) # return dictionary with audios list, playlists list, artists list

Project details


Release history Release notifications | RSS feed

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

social-ethosa-0.1.31.tar.gz (12.1 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

social_ethosa-0.1.31-py3-none-any.whl (13.8 kB view details)

Uploaded Python 3

File details

Details for the file social-ethosa-0.1.31.tar.gz.

File metadata

  • Download URL: social-ethosa-0.1.31.tar.gz
  • Upload date:
  • Size: 12.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.13.0 pkginfo/1.5.0.1 requests/2.22.0 setuptools/41.2.0 requests-toolbelt/0.9.1 tqdm/4.32.1 CPython/3.7.2

File hashes

Hashes for social-ethosa-0.1.31.tar.gz
Algorithm Hash digest
SHA256 848cd6b28ae5af591a70cb399dfd0789e028086acaa922ed07bae314d05f4ffa
MD5 283fb564bc8dbc1d1ee354c341b433c3
BLAKE2b-256 a35e03674507fc25acc4dbaf7cea0663ce0600bbc4bbd8c25fc07dfd8cdd3509

See more details on using hashes here.

File details

Details for the file social_ethosa-0.1.31-py3-none-any.whl.

File metadata

  • Download URL: social_ethosa-0.1.31-py3-none-any.whl
  • Upload date:
  • Size: 13.8 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.13.0 pkginfo/1.5.0.1 requests/2.22.0 setuptools/41.2.0 requests-toolbelt/0.9.1 tqdm/4.32.1 CPython/3.7.2

File hashes

Hashes for social_ethosa-0.1.31-py3-none-any.whl
Algorithm Hash digest
SHA256 9c3da2c14f556db630dcbc532f5e69b652b7fbf4af279dcc4e0ddf0eec971fa9
MD5 0679f96775a5415b2869a75aa6ad69b1
BLAKE2b-256 d861821191f9bcafc125fb6321008bf0739e249e05fb9a9446f9c1e487fbc514

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page