avadev / avatax-rest-v2-python-sdk Goto Github PK
View Code? Open in Web Editor NEWSales Tax API SDK for Python and AvaTax REST
Home Page: https://developer.avalara.com/sdk/
License: Apache License 2.0
Sales Tax API SDK for Python and AvaTax REST
Home Page: https://developer.avalara.com/sdk/
License: Apache License 2.0
Hello, I'm using Python, and trying to use the API.
I've got a Sandbox account, and I used pip to install Avalara.
However, the following code does not work: TypeError: 'str' object is not callable - it's looking at print(response.text())
Any suggestions?
from avalara import AvataxClient
client = AvataxClient('my test app',
'ver 0.0',
'my test machine',
'sandbox')
response = client.ping()
print(response.text())
print(response.json())
print(response.status_code())
print(response.raw())
Would like to know what changed from version to version. Important to know whether updating will break my application.
Just having a commit history isn't very friendly for humans.
I don't believe the Apache license is implemented correctly on this SDK. It is also missing from some of the distributed source files.
For people to be able to use and redistribute the SDK in their own code it needs to implement the Apache license correctly. I have open a pull request to address this. #67
Installed this package via pip yesterday and got an import error using from client import AvataxClient. from avalara import AvataxClient works.
Happy to move this elsewhere if there's a formal process for submitting issues.
The TransactionBuilder doesn't support the taxIncluded
attribute which is required
on a per-line item basis if used. See full docs here: https://developer.avalara.com/avatax/dev-guide/customizing-transaction/using-tax-included/
As a user of the transaction builder I would like to be able to use something like the following
builder.with_line(amount=100, quantity=1, tax_code=MY_TAX_CODE, tax_included=True)
or (less ideal)
(
builder
.with_line(amount=100, quantity=1, tax_code=MY_TAX_CODE)
.with_tax_included()
)
One can work around this by abandoning the TransactionBuilder or by breaking into the model a bit.
This could be done with conditions for item info, but a simple pass for all items is:
for item in builder.create_model["items"]:
item["taxIncluded"] = True
It's worth noting two items related to this:
Suggestion for improving might be to do three, backwards-compatible steps to align all three:
with_exempt_line
calls with_line
with minimal alteration (quantity=1 for backwards compatibility, tax_code=None)tax_included
to with_line
I'd be happy to PR if you would be amenable.
It's a little confusing that the package is just client
. This seems potentially prone to causing name collisions, and also hurts readability of code using this library.
It seems like it would be better if the import instead looked like e.g.:
from avalara import AvataxClient
When a ConnectionError is raised using the AvataxClient (at least during an adjust_transaction
) the following code errors because the ava_log_entry
only contains an error key and no execution_time
key...
> if ava_log_entry["execution_time"] is None:
E KeyError: 'execution_time'
From my reading, if running the wrapped func at line 39 raises an Exception the ava_log_entry
will have no "execution_time" key.
Forgive me if I've missing something here, this is showing up in our unit tests and I'm no pythonista/pythoneer
https://developer.avalara.com/excise/
It would be great if we could use this module with Avatax Excise as well.
I'm trying to use line number shipping-1
. Why? Not sure. That seems to be what the 1st party Avalara Shopify app does. And I need to mirror that.
ac = AvataxClient('Tax App 123', 'ver 2022.09')
tb = TransactionBuilder(ac, 'COMANY_CODE_ABC', 'SalesOrder', 'CUSTOMER_XYZ')
tb.with_line(amount=10, quantity=2, item_code='FREIGHT', tax_code='FR020800', line_number='shipping-1')
File "/usr/local/lib/python3.8/site-packages/avalara/transaction_builder_methods.py", line 153, in with_line
self.line_num += 1
TypeError: can only concatenate str (not "int") to str
Hey does this work on Python2.7.14?
SDK API call query_users
claims about parameters in documentation (as well as in REST), but actually doesn't involve several of them:
https://github.com/avadev/AvaTax-REST-V2-Python-SDK/blob/master/src/client_methods.py#L6426-L6447
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.