Skip to main content

The social ethosa library for Python

Project description

social ethosa

A Python library that uses requests

Get started

Installation: pip install --upgrade social-ethosa
Import:

from social_ethosa import *

Vkcom

vk = Vk(token="Your token is here", group_id=12345, debug=True, lang="en")
# the group_id parameter should be used if you are going to log in through a group.
# In this example, we will use group authorization.

@vk.on_message_new
# This decorator is an event handler that executes the function passed to it on a new message
# The decorator's name is taken from the official names, but with the prefix " on_"
# https://vk.com/dev/groups_events
def getMessage(message):
  text = message.text
  peer_id = message.peer_id
  from_id = message.from_id
  attachments = message.attachments

using the file Uploader:

vk.uploader.getUploadUrl("message_photo") # getting a link to upload files
# you can also pass other arguments (argument=value)
# to get the rest of the UploadUrl names, use the function
# uploader.getAllTypes

upload files:

response = vk.uploader.uploadFile("path") # you can also pass other arguments (argument=value)

Some audio methods are also available in my library:

login = "89007003535"
password = "qwertyuiop"

audio = Audio(login=login, password=password, debug=1)
audios = audio.get()
# Since the audio methods are not available in the official API, I had to make a parser of the site

Using Yandex api:

TOKEN = "translate token"
yt = YTranslator(token=TOKEN)
text = "Пайтон - хороший язык программирования"
response = yt.translate(text=text, lang="en") # Text translation
print(response)

Using the TraceMoe api:

tracemoe = TraceMoe() # initialization for future use
# In directory with script there is screenshot from anime " a. png"
response = tracemoe.search("a.png", False, 1)
# param 1 - path to image or image url
# param 2 - True, if param 1 is link
# param 3 - filter search

Image did not load

If the anime is found, you should get a video preview of the found moment:

video = tracemoe.getVideo(response, mute=0) # The mute parameter must be 1 if you want to get video without sound
tracemoe.writeFile("file.mp4", video)
# param 1 is a path to write file
# param 2 is a video received by the get Video method

Project details


Release history Release notifications | RSS feed

This version

0.2.2

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.2.2.tar.gz (22.2 kB view hashes)

Uploaded Source

Built Distribution

social_ethosa-0.2.2-py3-none-any.whl (25.3 kB view hashes)

Uploaded Python 3

Supported by

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