yammer / yam-python Goto Github PK
View Code? Open in Web Editor NEWA python wrapper around the Yammer API.
License: Other
A python wrapper around the Yammer API.
License: Other
I have the following error when trying the authentication sequence after installing the yampy module on python 3.7.5 environnement
AttributeError: module 'yampy' has no attribute 'Authenticator'
any thoughts
Hello there. This module has been updated here on GitHub to support Python 3, but the version of PyPi is months out of date. Could you release a new version of the module on PyPi so you can easily install the module via PIP, without having to reference a GitHub URL?
https://help.github.com/articles/error-remote-head-refers-to-nonexistent-ref-unable-to-checkout/
$ git clone http://github.com/yammer/yam-python.git
Cloning into 'yam-python'...
remote: Counting objects: 679, done.
remote: Total 679 (delta 0), reused 0 (delta 0)
Receiving objects: 100% (679/679), 179.67 KiB | 23.00 KiB/s, done.
Resolving deltas: 100% (317/317), done.
Checking connectivity... done.
warning: remote HEAD refers to nonexistent ref, unable to checkout.
When trying to import yampy in a python script I get an internal import error from Yampy.
Here is the error:
Traceback (most recent call last):
File "C:\Users\raffertd\Desktop\Gamification\yammer_parser.py", line 1, in <mo
dule>
import yampy
File "C:\Python34\lib\site-packages\yampy\__init__.py", line 22, in <module>
from authenticator import Authenticator
ImportError: No module named 'authenticator'
This occurs when simply trying to import yampy
import yampy
Following Quickstart guide, I can get the access_token use authenticator. But when I Try to access data from yammer Use
yammer = yampy.Yammer(access_token=access_token)
yammer.messages.all()
the request always raise Unauthorized exception.
Installing 'yampy'
Downloading/unpacking yampy
Downloading yampy-1.0.tar.gz
Running setup.py egg_info for package yampy
Traceback (most recent call last):
File "", line 16, in
File "c:\users\brianly\appdata\local\temp\pip_build_brianly\yampy\setup.py", line 47, in
test_suite="nose.collector",
File "C:\Python26\lib\distutils\core.py", line 152, in setup
dist.run_commands()
File "C:\Python26\lib\distutils\dist.py", line 975, in run_commands
self.run_command(cmd)
File "C:\Python26\lib\distutils\dist.py", line 995, in run_command
cmd_obj.run()
File "", line 14, in replacement_run
File "C:\Python26\lib\site-packages\distribute-0.6.45-py2.6.egg\setuptools\command\egg_info.py", line 259, in find_sources
mm.run()
File "C:\Python26\lib\site-packages\distribute-0.6.45-py2.6.egg\setuptools\command\egg_info.py", line 327, in run
self.read_template()
File "C:\Python26\lib\site-packages\distribute-0.6.45-py2.6.egg\setuptools\command\sdist.py", line 228, in __read_template_hack
_sdist.read_template(self)
File "C:\Python26\lib\distutils\command\sdist.py", line 336, in read_template
self.filelist.process_template_line(line)
File "C:\Python26\lib\distutils\filelist.py", line 129, in process_template_line
(action, patterns, dir, dir_pattern) = self._parse_template_line(line)
File "C:\Python26\lib\distutils\filelist.py", line 104, in _parse_template_line
dir = convert_path(words[1])
File "C:\Python26\lib\distutils\util.py", line 201, in convert_path
raise ValueError, "path '%s' cannot end with '/'" % pathname
ValueError: path 'yampy/apis/' cannot end with '/'
Complete output from command python setup.py egg_info:
running egg_info
creating pip-egg-info\yampy.egg-info
writing requirements to pip-egg-info\yampy.egg-info\requires.txt
writing pip-egg-info\yampy.egg-info\PKG-INFO
writing top-level names to pip-egg-info\yampy.egg-info\top_level.txt
writing dependency_links to pip-egg-info\yampy.egg-info\dependency_links.txt
writing manifest file 'pip-egg-info\yampy.egg-info\SOURCES.txt'
warning: manifest_maker: standard file '-c' not found
reading manifest file 'pip-egg-info\yampy.egg-info\SOURCES.txt'
reading manifest template 'MANIFEST.in'
Traceback (most recent call last):
File "", line 16, in
File "c:\users\brianly\appdata\local\temp\pip_build_brianly\yampy\setup.py", line 47, in
test_suite="nose.collector",
File "C:\Python26\lib\distutils\core.py", line 152, in setup
dist.run_commands()
File "C:\Python26\lib\distutils\dist.py", line 975, in run_commands
self.run_command(cmd)
File "C:\Python26\lib\distutils\dist.py", line 995, in run_command
cmd_obj.run()
File "", line 14, in replacement_run
File "C:\Python26\lib\site-packages\distribute-0.6.45-py2.6.egg\setuptools\command\egg_info.py", line 259, in find_sources
mm.run()
File "C:\Python26\lib\site-packages\distribute-0.6.45-py2.6.egg\setuptools\command\egg_info.py", line 327, in run
self.read_template()
File "C:\Python26\lib\site-packages\distribute-0.6.45-py2.6.egg\setuptools\command\sdist.py", line 228, in __read_template_hack
_sdist.read_template(self)
File "C:\Python26\lib\distutils\command\sdist.py", line 336, in read_template
self.filelist.process_template_line(line)
File "C:\Python26\lib\distutils\filelist.py", line 129, in process_template_line
(action, patterns, dir, dir_pattern) = self._parse_template_line(line)
File "C:\Python26\lib\distutils\filelist.py", line 104, in _parse_template_line
dir = convert_path(words[1])
File "C:\Python26\lib\distutils\util.py", line 201, in convert_path
raise ValueError, "path '%s' cannot end with '/'" % pathname
Cleaning up...
Command python setup.py egg_info failed with error code 1 in c:\users\brianly\appdata\local\temp\pip_build_brianly\yampy
Storing complete log in C:\Users\brianly\pip\pip.log
'yampy' failed to install. Exit code: 1
It is expected that the messages.all() function should return ALL messages in a network, not just 20. Thus, getting all posts on a network is very convoluted, as you have to get them 20 at a time. You also cannot get all the responses to posts either, you have to use the messages.in_thread() function per thread, which, in large networks, can be a very large task and time consuming.
When trying to receive an access_token from the code received via response_url. The yampy module responds with HTTP 400 Bad Request
import yampy
code = request.GET['code']
authenticator = yampy.Authenticator(
client_id='MY_KEY',
client_secret='MY_SECRET'
)
access_token = authenticator.fetch_access_token(code)
Use post instead of get
https://developer.yammer.com/docs/oauth-2
def fetch_access_data(self, code):
[...]
return client.post(
path="/access_token",
client_id=self._client_id,
client_secret=self._client_secret,
code=code,
)
There is a problem with this line:
Line 80 in 338b0b3
Most of the Yammer /api/v1/ calls will happily accept a .json
suffix, but some will not. The first example I've found is /api/v1/autocomplete/ranked
.
My suggested fix would be to send a Content-Type: application/json
as a request header, rather than blindly appending .json
.
Hi,
Regards,
Hari Shankar
When calling the MessagesAPI.all() call, we do not get any replies, even though threaded='extended' is set. Only root posts are returned.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.