lionheart / requests-cloudkit Goto Github PK
View Code? Open in Web Editor NEWApple CloudKit Python library.
License: Apache License 2.0
Apple CloudKit Python library.
License: Apache License 2.0
Last commit 60ac87e isn't in pip
Hi, I couldn't get requests-cloudkit
to install under Python 3.
$ pip3 install requests-cloudkit
Collecting requests-cloudkit
Using cached requests-cloudkit-0.1.5.tar.gz
Complete output from command python setup.py egg_info:
Traceback (most recent call last):
File "<string>", line 1, in <module>
File "/private/var/folders/v3/7yxzprtn5cs4rjy2yj5lf67c0000gn/T/pip-build-zpmhjvdq/requests-cloudkit/setup.py", line 15, in <module>
execfile("requests_cloudkit/metadata.py", metadata)
NameError: name 'execfile' is not defined
----------------------------------------
Command "python setup.py egg_info" failed with error code 1 in /private/var/folders/v3/7yxzprtn5cs4rjy2yj5lf67c0000gn/T/pip-build-zpmhjvdq/requests-cloudkit/
Well execfile
doesn't exist in Python 3, but are there other things that would stop the requests-cloudkit from being installed?
After the most basic setup, as included in the README.md:
>>> import requests
>>> from requests_cloudkit import CloudKitAuth
>>> auth = CloudKitAuth(key_id=YOUR_KEY_ID, key_file_name=YOUR_PRIVATE_KEY_PATH)
>>> requests.get("https://api.apple-cloudkit.com/database/[version]/[container]/[environment]/public/zones/list", auth=auth)
I am getting the following error:
File "/opt/anaconda3/[...]/lib/python3.7/site-packages/requests_cloudkit/cloudkit.py", line 45, in make_signature
signature = "{}:{}:{}".format(formatted_date, self.encode_body(body), path)
File "/opt/anaconda3/[...]/lib/python3.7/site-packages/requests_cloudkit/cloudkit.py", line 62, in encode_body
h = hashlib.sha256(body)
TypeError: Unicode-objects must be encoded before hashing
I have tried encoding the body
variable within the encode_body()
method, but that did not change anything. I have also tried multiple key files and multiple containers, still no change (All of these work normally with CloudKitJS or my custom Java wrapper).
Hi,
Can this library be used to access icloud drive files? If so, what would I need to do? It's difficult to understand the difference between cloudkit and icloud drive (if there is any...)
Thanks
The warning appears during requests when doing unit tests via unittest
package:
/venv/lib/python3.7/site-packages/requests_cloudkit/cloudkit.py:78:
ResourceWarning: unclosed file <_io.TextIOWrapper name='credentials/CloudKitKeyDev.pem' mode='r' encoding='UTF-8'>
return open(self.key_file_name).read()
ResourceWarning: Enable tracemalloc to get the object allocation traceback
I keep getting Strings must be encoded before hashing
when I try to do r = cloudkit.POST.public.records.modify(j)
This is a problem only on Windows. On Mac, everything works.
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.