superfell / beatbox Goto Github PK
View Code? Open in Web Editor NEWBeatbox is an easy to use Python Library for accessing the Salesforce.com API
Home Page: http://www.pocketsoap.com/beatbox/
License: GNU General Public License v2.0
Beatbox is an easy to use Python Library for accessing the Salesforce.com API
Home Page: http://www.pocketsoap.com/beatbox/
License: GNU General Public License v2.0
Hello,
Is it possible to update the batchsize attribute of the service?
In addition I've noticed that in some tables (Oportunity,Task) the chunk size is different than the default value 500 and the data is being pulled in chunks of 200. Can it be changed?
Thanks,
Itay
Hi,
I've noticed that SoqlXplorer is generally about 2-3 times faster at saving query results than the export.py
demo - but I also see a large variance in times for both so it could just be transient network conditions or some other factor. Neither use much CPU or bandwidth so I'm wondering if there's something at the Salesforce end (maybe a different API?) that might explain the difference.
Thanks.
see issue #32 for details.
Have to use beatbox._beatbox.Client()
to get a client.
Reproduced on Windows running Python 2.7.9, Ubuntu running Python 2.7.6, beatbox v32.1 on both, installed via pip.
>>> import beatbox
>>> svc = beatbox.Client()
Traceback (most recent call last):
File "<pyshell#44>", line 1, in <module>
svc = beatbox.Client()
AttributeError: 'module' object has no attribute 'Client'
>>> svc = beatbox._beatbox.Client() #This works
>>>
I'm currently in transition changing our code from 2.7 to 3.7 and I found that beatbox required an update. I updated, it and fixed the calls, but now I'm getting response of a full string, instead of a json list. I use to have a code that did this.
row = {}
response = json.dumps(response)
jsonParser = json.loads(response)
row['Status'] = "Success"
row['IDNumber'] = jsonParser["IDNumber"]
But looks like the output is only showing only full string plus a true boolean at the front of it.
I looked at issue 51, and attempted using the code given by superfell, but the sorting of the columns was completely out of wack, rec[0] had true,rec[1] were empty, and rec[2] had the full string, rec[3] had the third column, rec[4] had the 4th column.
FullString example output:
AccountIDAccountNameIDNumberStatus
Is there any release planned for Beatbox? Mainly I miss python 3 support in the current pypi release. Is there anything I can do to help?
Result of commands executed with beatbox on python 3.6 is a string combined from all fields, for inscante AccountStatusNameOK etc.
In python 2.7 result is returned as list.
This requires adding support for the LoginScopeHeader
really need some unit tests, especially now that we're supporting both python 2 & 3.
Once we have tests, should also setup travis to run them
I use demo.py
for tests. Your original current source fails on an empty Salesforce instance or if no Account "New Account" has been present before running the demo.
Traceback (most recent call last):
File "demo.py", line 235, in <module>
demo.retrieve()
File "demo.py", line 154, in retrieve
print str(acc[beatbox._tSObjectNS.Id]) + " : " + str(acc[beatbox._tSObjectNS.Name])
File "/home/.../Beatbox/xmltramp.py", line 143, in __getitem__
raise KeyError, n
KeyError: ('urn:sobject.partner.soap.sforce.com', 'Id')
It is because beatbox.Client.retrive
returns directly one xmltramp.Element
instead of a list of length 1.
The backward compatible solution is to modify only the demo.py so that it is tested if the result is a list or an Element :
def retrieve(self):
print("\nretrieve")
accounts = svc.retrieve("id, name", "Account", self.__theIds)
+ if not beatbox.islst(accounts):
+ accounts = [accounts]
for acc in accounts:
... but this is not a demo of advisable clean code.
A more natural solution would be to return a list of elements by beatbox.Client.retrieve
if the ids
parameter is a list, otherwise to return an element if an Id is used directly without list.
def retrieve(self, fields, sObjectType, ids):^M
return RetrieveRequest(self.__serverUrl, self.sessionId, fields, sObjectType, ids
- ).post(self.__conn)
+ ).post(self.__conn, islst(ids))
The best solution is probably to add a retrive
method to IterClient class and also to write an example with IterClient to the documentation because that class is very useful. It will be both natural and backward compatible. What do you mean?
Hi, I have followed your instructions in the readme for the TLS 1.0 abandonment... After checking that my python version is 2.7.10 and upgrading openssl to version 1.0.2g I am still receiving a TLS connection error on authentication.
I also tried the fix detailed here: https://urllib3.readthedocs.io/en/latest/security.html#pyopenssl but it did not affect anything.
Any help is appreciated.
The default gzipRequest is set to True, but it doesn't work in python3. Got an error TypeError: string argument expected, got 'bytes' when executing self.fileobj.write(b'\037\213'
in file gzip.py.
In python3, BytesIo should be used instead of StringIO, and thus a potential fix would be changing self.__buf = StringIO("")
to self.__buf = BytesIO(b"")
in file beatbox.py at line 283
Hi.
Just wondering which version of the GPL applies, the README just says "Beatbox is released under the GPL."
Hi,
What is the required namespace for retrieving the returned objects from this method?
When I try the following (as explained in http://www.pocketsoap.com/beatbox/) :
sf = beatbox._tPartnerNS
svc = beatbox.Client()
svc.login(username, password)
res_tables = svc.describeGlobal()
tables_list = res_tables[sf.types:]
I don't get any results in tables_list.
Should I address another field in sf?
Thanks in advance!
Itay
For example, the EmailHeader: triggerAutoResponseEmail
Hello,
When I'm trying to pull Address fields (ShippingAddress, BillingAddress, Address etc.) from any table in Salesforce I run into an error in function query in module python_client (the failure is in function _extractRecord which is being called by function query).
Is that a known issue? Is it because of the name Address? How should I pull those fields?
Thanks a lot in advance!
Itay
I keep getting a Query Time Out error when trying to bring back the whole table of "Case History" not sure if the api used in Beatbox is not the right place. Do I need to investigate the bulk api? Or another way to troubleshoot?
I have a small collection of monkey patches I put into our internal version of beatbox to add methods that return iterators for the collection returning calls that wrap the need to use queryMore, and alternate forms of upsert,insert and delete that take generators and chunk them into blocks of size batchSize.
How would you feel about a PR for adding these methods onto the Client or an iterClient subclass?
Trying to install Beatbox from this repository, I get:
Running setup.py install for beatbox
Sorry: IndentationError: unexpected indent (beatbox.py, line 39)
It would be nice to have this functionality available in beatbox.
Error when trying to login.
Here is the issue on google code. Applying the recommended 'patch' does not seem to work.
https://code.google.com/p/salesforce-beatbox/issues/detail?id=14
I'm trying to update (using the update method) a custom field value to set it to Null/Empty on a Contact object but this doesn't seem to work. I've tried setting the value to None, '' (empty string), 'null' and both failed to clear or reset the value for the field (by looking in the Contact profile in the Salesforce UI).
Is there a way to set a custom field value to Null? Is this even supported?
Thanks
The version of Beatbox in Pypi is 20.0 http://pypi.python.org/pypi/beatbox/20.0
The version in this repository is 0.94.
The code seems to have been heavily re factored between these two versions.
The code within 20.0 hsa a copyright of 2006, while the one here is from 2006-2012
Which is the correct version to use? If it is 0.94, why isn't this version in Pypi? Why did the version number drop from 20.0 to 0.94? If it is 20.0, why is this repo out of date?
Salesforce going to do overall change at the 3rd of Dec
what they called - Refresh Instances.
Is it going to affect the use of Beatbox?
Do we need to change of upgrade something>
Thanks!
Is the manifest.in file left over from ez_setup ? or is still used somehow? if so it needs the reference to readme.md fixing.
Starting 2016 Salesforce is disabling TLS 1.0 support, review the possible impact
https://help.salesforce.com/HTViewSolution?id=000221207&language=en_US
Forgive me if this isn't the appropriate avenue to post this comment.
Is it possible to "bulkify" any of the create, update, upsert, delete, or undelete methods to avoid the following error: "EXCEEDED_ID_LIMIT: record limit reached. cannot submit more than 200 records into this call"
I know that Lexi Loader handles gracefully. I have created a wrapper around Beatbox to split my sObjects into lists of 200 or less as a workaround.
Please read salesforce-python-client/pyforce#35 for more information, the PR should be the same as that one, I can make it if you'd like but this repo seems to not get updated much.
I attempted to increase the batchsize, but I'm trying to get all the values since the values could increase or decreased based on he batch size. I attempted to use queryAll or querymore. But they both failed. I also attempted to use the following documentation, but doesn't seem to function with this version of beatbox. Can you provide me some insight on how I can get all the rows to show up.
http://tomhayden3.com/2013/08/04/salesforce-python/
Can you add support for setting timeout in beatbox as parameter to the constructor ?
I just came across this https://www.salesforceben.com/rip-notes-attachments-say-hello-to-files/ and I was wondering if the existing beatbox create
method will support the new SFDC Files. The article says that sfdc will be sunsetting Notes & Attachments in the near future
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.