randomorg / json-rpc-python Goto Github PK
View Code? Open in Web Editor NEWRandom.org JSON-RPC API (Release 4) Python implementation.
License: MIT License
Random.org JSON-RPC API (Release 4) Python implementation.
License: MIT License
Greetings, I've been using this package in my own applications, but I need it to be Python 3.6 compatible. I updated a fork of this repo for this purpose and did some PEP 8 cleanup. I updated the tests and they were all passing on my system before this pull request... I was hoping you might merge these changes if you like what you see. Thanks!
Is it possible to get the results from the playing card shuffler? - https://www.random.org/playing-cards/
If not, what is the best way to utilize that generator in an API type fashion?
I am using this line:
from rdoclient import RandomOrgClient
random_org = RandomOrgClient(MY_TOKEN)
response = random_org.generate_signed_integers(5, 0, 10, replacement=False, user_data={"data":"foo"})
NOTE: I was working a couple of days ago without any issue. Then, I got this.
NOW, I'm getting this error.
Exception in thread Thread-2 (_threaded_request_sending):
Traceback (most recent call last):
File "C:\Users\Walte\AppData\Local\Programs\Python\Python310\lib\threading.py", line 1009, in _bootstrap_inner
self.run()
File "C:\Users\Walte\AppData\Local\Programs\Python\Python310\lib\threading.py", line 946, in run
self._target(*self._args, **self._kwargs)
File "C:\Users\Walte\AppData\Local\Programs\Python\Python310\lib\site-packages\rdoclient\rdoclient.py", line 2717, in _threaded_request_sending
data = self._send_request_core(request['request'])
File "C:\Users\Walte\AppData\Local\Programs\Python\Python310\lib\site-packages\rdoclient\rdoclient.py", line 2768, in _send_request_core
data=json.dumps(request),
File "C:\Users\Walte\AppData\Local\Programs\Python\Python310\lib\json\__init__.py", line 231, in dumps
return _default_encoder.encode(obj)
File "C:\Users\Walte\AppData\Local\Programs\Python\Python310\lib\json\encoder.py", line 199, in encode
chunks = self.iterencode(o, _one_shot=True)
File "C:\Users\Walte\AppData\Local\Programs\Python\Python310\lib\json\encoder.py", line 257, in iterencode
return _iterencode(o, 0)
File "C:\Users\Walte\AppData\Local\Programs\Python\Python310\lib\json\encoder.py", line 179, in default
raise TypeError(f'Object of type {o.__class__.__name__} '
TypeError: Object of type RandomOrgClient is not JSON serializable
PYTHON VERSION: 3.10.1
The service no longer works because of it,
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.