Skip to content

Commit

Permalink
Merge pull request #314 from ej2/0.9.4
Browse files Browse the repository at this point in the history
0.9.4 Release
  • Loading branch information
ej2 authored Aug 29, 2023
2 parents 9d7e4a5 + e9d8606 commit 5d29d1f
Show file tree
Hide file tree
Showing 54 changed files with 340 additions and 457 deletions.
6 changes: 6 additions & 0 deletions CHANGELOG.rst
Original file line number Diff line number Diff line change
@@ -1,5 +1,11 @@
Changelog
=========
* 0.9.4 (August 29, 2023)
* Removed python 2 compatible decorators
* Removed python 2 dependencies
* Fixed issue with MarkupInfo field on AccountBasedExpenseLineDetail
* Removed test files from package

* 0.9.3 (March 7, 2023)
* Added support for Recurring Transaction
* Added support for optional query params
Expand Down
2 changes: 1 addition & 1 deletion MANIFEST.in
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
include README.md
include LICENSE
recursive-include tests *
recursive-exclude tests *
1 change: 0 additions & 1 deletion Makefile
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@

publish: clean
python setup.py sdist
twine upload dist/*
Expand Down
5 changes: 2 additions & 3 deletions Pipfile
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,8 @@ urllib3 = ">=1.26.5"
bleach = ">=3.3.0"
intuit-oauth = "==1.2.4"
rauth = ">=0.7.3"
requests = ">=2.26.0"
simplejson = ">=3.17.0"
six = ">=1.14.0"
requests = ">=2.31.0"
simplejson = ">=3.19.1"
nose = "*"
coverage = "*"
twine = "*"
Expand Down
569 changes: 289 additions & 280 deletions Pipfile.lock

Large diffs are not rendered by default.

8 changes: 8 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ python-quickbooks
[![Python package](https://github.com/ej2/python-quickbooks/actions/workflows/python-package.yml/badge.svg)](https://github.com/ej2/python-quickbooks/actions/workflows/python-package.yml)
[![Coverage Status](https://coveralls.io/repos/github/ej2/python-quickbooks/badge.svg?branch=master)](https://coveralls.io/github/ej2/python-quickbooks?branch=master)
[![](https://img.shields.io/badge/License-MIT-yellow.svg)](https://github.com/ej2/python-quickbooks/blob/master/LICENSE)
[![PyPI](https://img.shields.io/pypi/v/python-quickbooks)](https://pypi.org/project/python-quickbooks/)

A Python 3 library for accessing the Quickbooks API. Complete rework of
[quickbooks-python](https://github.com/troolee/quickbooks-python).
Expand All @@ -14,6 +15,13 @@ You can find additional examples of usage in [Integration tests folder](https://

For information about contributing, see the [Contributing Page](https://github.com/ej2/python-quickbooks/blob/master/contributing.md).

Installation
------------

```bash
pip install python-quickbooks
```

QuickBooks OAuth
------------------------------------------------

Expand Down
6 changes: 3 additions & 3 deletions dev_requirements.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
coverage==6.4.2
ipdb==0.13.9
mock==2.0.0
coverage==7.3.0
ipdb==0.13.13
mock==5.1.0
nose==1.3.7
14 changes: 4 additions & 10 deletions quickbooks/mixins.py
Original file line number Diff line number Diff line change
@@ -1,9 +1,8 @@
from future.moves.urllib.parse import quote
from urllib.parse import quote

try: import simplejson as json
except ImportError: import json

import six
from .utils import build_where_clause, build_choose_clause
from .client import QuickBooks
from .exceptions import QuickbooksException
Expand Down Expand Up @@ -70,14 +69,9 @@ def to_dict(obj, classkey=None):
elif hasattr(obj, "__iter__") and not isinstance(obj, str):
return [to_dict(v, classkey) for v in obj]
elif hasattr(obj, "__dict__"):
if six.PY2:
data = dict([(key, to_dict(value, classkey))
for key, value in obj.__dict__.iteritems()
if not callable(value) and not key.startswith('_')])
else:
data = dict([(key, to_dict(value, classkey))
for key, value in obj.__dict__.items()
if not callable(value) and not key.startswith('_')])
data = dict([(key, to_dict(value, classkey))
for key, value in obj.__dict__.items()
if not callable(value) and not key.startswith('_')])

if classkey is not None and hasattr(obj, "__class__"):
data[classkey] = obj.__class__.__name__
Expand Down
2 changes: 0 additions & 2 deletions quickbooks/objects/account.py
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
from six import python_2_unicode_compatible
from .base import Ref, QuickbooksManagedObject, QuickbooksTransactionEntity


@python_2_unicode_compatible
class Account(QuickbooksManagedObject, QuickbooksTransactionEntity):
"""
QBO definition: Account is a component of a Chart Of Accounts, and is part of a Ledger. Used to record a total
Expand Down
2 changes: 0 additions & 2 deletions quickbooks/objects/attachable.py
Original file line number Diff line number Diff line change
@@ -1,10 +1,8 @@
from six import python_2_unicode_compatible
from .base import Ref, QuickbooksManagedObject, QuickbooksTransactionEntity, AttachableRef
from ..client import QuickBooks
from ..mixins import DeleteMixin


@python_2_unicode_compatible
class Attachable(DeleteMixin, QuickbooksManagedObject, QuickbooksTransactionEntity):
"""
QBO definition: This page covers the Attachable, Upload, and Download resources used for attachment management. Attachments are supplemental information linked to a transaction or Item object. They can be files, notes, or a combination of both.
Expand Down
10 changes: 0 additions & 10 deletions quickbooks/objects/base.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
from six import python_2_unicode_compatible
from ..mixins import ToDictMixin, ToJsonMixin, FromJsonMixin, ListMixin, ReadMixin, UpdateMixin


Expand All @@ -24,7 +23,6 @@ class QuickbooksReadOnlyObject(QuickbooksBaseObject, ReadMixin, ListMixin):
pass


@python_2_unicode_compatible
class MetaData(FromJsonMixin):
def __init__(self):
self.CreateTime = ""
Expand All @@ -44,7 +42,6 @@ def to_linked_txn(self):
return linked_txn


@python_2_unicode_compatible
class Address(QuickbooksBaseObject):
def __init__(self):
self.Id = None
Expand All @@ -65,7 +62,6 @@ def __str__(self):
return "{0} {1}, {2} {3}".format(self.Line1, self.City, self.CountrySubDivisionCode, self.PostalCode)


@python_2_unicode_compatible
class PhoneNumber(ToJsonMixin, FromJsonMixin, ToDictMixin):
def __init__(self):
self.FreeFormNumber = ""
Expand All @@ -74,7 +70,6 @@ def __str__(self):
return self.FreeFormNumber


@python_2_unicode_compatible
class EmailAddress(QuickbooksBaseObject):
def __init__(self):
self.Address = ""
Expand All @@ -83,7 +78,6 @@ def __str__(self):
return self.Address


@python_2_unicode_compatible
class WebAddress(QuickbooksBaseObject):
def __init__(self):
self.URI = ""
Expand All @@ -92,7 +86,6 @@ def __str__(self):
return self.URI


@python_2_unicode_compatible
class Ref(QuickbooksBaseObject):
def __init__(self):
self.value = ""
Expand All @@ -103,7 +96,6 @@ def __str__(self):
return self.name


@python_2_unicode_compatible
class CustomField(QuickbooksBaseObject):
def __init__(self):
self.DefinitionId = ""
Expand All @@ -115,7 +107,6 @@ def __str__(self):
return self.Name


@python_2_unicode_compatible
class LinkedTxn(QuickbooksBaseObject):
qbo_object_name = "LinkedTxn"

Expand All @@ -129,7 +120,6 @@ def __str__(self):
return str(self.TxnId)


@python_2_unicode_compatible
class CustomerMemo(QuickbooksBaseObject):
def __init__(self):
super(CustomerMemo, self).__init__()
Expand Down
2 changes: 0 additions & 2 deletions quickbooks/objects/batchrequest.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
from six import python_2_unicode_compatible
from ..mixins import ToJsonMixin, FromJsonMixin


Expand All @@ -8,7 +7,6 @@ class BatchOperation(object):
DELETE = "delete"


@python_2_unicode_compatible
class FaultError(FromJsonMixin):
qbo_object_name = "Error"

Expand Down
4 changes: 0 additions & 4 deletions quickbooks/objects/bill.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
from six import python_2_unicode_compatible

from quickbooks.objects.detailline import DetailLine, ItemBasedExpenseLine, AccountBasedExpenseLine, \
TDSLine
from .base import Ref, LinkedTxn, QuickbooksManagedObject, QuickbooksTransactionEntity, \
Expand All @@ -8,7 +6,6 @@
from ..mixins import DeleteMixin


@python_2_unicode_compatible
class Bill(DeleteMixin, QuickbooksManagedObject, QuickbooksTransactionEntity, LinkedTxnMixin):
"""
QBO definition: A Bill entity is an AP transaction representing a request-for-payment from a third party for
Expand Down Expand Up @@ -79,4 +76,3 @@ def to_ref(self):
ref.value = self.Id

return ref

4 changes: 0 additions & 4 deletions quickbooks/objects/billpayment.py
Original file line number Diff line number Diff line change
@@ -1,10 +1,8 @@
from six import python_2_unicode_compatible
from .base import QuickbooksBaseObject, Ref, LinkedTxn, QuickbooksManagedObject, LinkedTxnMixin, \
QuickbooksTransactionEntity
from ..mixins import DeleteMixin


@python_2_unicode_compatible
class CheckPayment(QuickbooksBaseObject):
class_dict = {
"BankAccountRef": Ref
Expand Down Expand Up @@ -33,7 +31,6 @@ def __init__(self):
self.CCAccountRef = None


@python_2_unicode_compatible
class BillPaymentLine(QuickbooksBaseObject):
list_dict = {
"LinkedTxn": LinkedTxn
Expand All @@ -50,7 +47,6 @@ def __str__(self):
return str(self.Amount)


@python_2_unicode_compatible
class BillPayment(DeleteMixin, QuickbooksManagedObject, QuickbooksTransactionEntity, LinkedTxnMixin):
"""
QBO definition: A BillPayment entity represents the financial transaction of payment
Expand Down
4 changes: 0 additions & 4 deletions quickbooks/objects/budget.py
Original file line number Diff line number Diff line change
@@ -1,9 +1,7 @@
from six import python_2_unicode_compatible
from .base import QuickbooksBaseObject, Ref, QuickbooksTransactionEntity, \
QuickbooksReadOnlyObject


@python_2_unicode_compatible
class BudgetDetail(QuickbooksBaseObject):
class_dict = {
"AccountRef": Ref,
Expand All @@ -26,7 +24,6 @@ def __str__(self):
return str(self.Amount)


@python_2_unicode_compatible
class Budget(QuickbooksReadOnlyObject, QuickbooksTransactionEntity):
"""
QBO definition: The Budget endpoint allows you to retrieve the current state of budgets already set up in the user's
Expand Down Expand Up @@ -56,4 +53,3 @@ def __init__(self):

def __str__(self):
return self.Name

12 changes: 6 additions & 6 deletions quickbooks/objects/changedatacapture.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,14 +2,14 @@


class CDCResponse(FromJsonMixin):
qbo_object_name = "CDCResponse"
qbo_object_name = "CDCResponse"

def __init__(self):
super(CDCResponse, self).__init__()
def __init__(self):
super(CDCResponse, self).__init__()


class QueryResponse(FromJsonMixin, ObjectListMixin):
qbo_object_name = "QueryResponse"
qbo_object_name = "QueryResponse"

def __init__(self):
super(QueryResponse, self).__init__()
def __init__(self):
super(QueryResponse, self).__init__()
2 changes: 0 additions & 2 deletions quickbooks/objects/company_info.py
Original file line number Diff line number Diff line change
@@ -1,9 +1,7 @@
from six import python_2_unicode_compatible
from .base import Address, PhoneNumber, EmailAddress, WebAddress, \
QuickbooksManagedObject, Ref, MetaData


@python_2_unicode_compatible
class CompanyInfo(QuickbooksManagedObject):
"""
QBO definition: The CompanyInfo entity contains basic company information.
Expand Down
2 changes: 0 additions & 2 deletions quickbooks/objects/companycurrency.py
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
from six import python_2_unicode_compatible
from .base import QuickbooksManagedObject, QuickbooksTransactionEntity, Ref, CustomField, MetaData


@python_2_unicode_compatible
class CompanyCurrency(QuickbooksManagedObject, QuickbooksTransactionEntity):
"""
QBO definition: Applicable only for those companies that enable multicurrency, a companycurrency object
Expand Down
2 changes: 0 additions & 2 deletions quickbooks/objects/creditcardpayment_entity.py
Original file line number Diff line number Diff line change
@@ -1,9 +1,7 @@
from six import python_2_unicode_compatible
from .base import Ref, QuickbooksManagedObject, QuickbooksTransactionEntity, LinkedTxnMixin, MetaData
from ..mixins import DeleteMixin


@python_2_unicode_compatible
class CreditCardPayment(DeleteMixin, QuickbooksManagedObject, QuickbooksTransactionEntity, LinkedTxnMixin):
"""
QBO definition: A Represents a financial transaction to record a Credit Card balance payment
Expand Down
3 changes: 0 additions & 3 deletions quickbooks/objects/creditmemo.py
Original file line number Diff line number Diff line change
@@ -1,13 +1,10 @@
from six import python_2_unicode_compatible

from quickbooks.objects.detailline import SalesItemLine, SubtotalLine, DiscountLine, DescriptionOnlyLine, DetailLine
from .base import Address, EmailAddress, Ref, CustomField, CustomerMemo, QuickbooksManagedObject, \
LinkedTxnMixin, QuickbooksTransactionEntity
from .tax import TxnTaxDetail
from ..mixins import DeleteMixin


@python_2_unicode_compatible
class CreditMemo(DeleteMixin, QuickbooksTransactionEntity, QuickbooksManagedObject, LinkedTxnMixin):
"""
QBO definition: The CreditMemo is a financial transaction representing a refund or credit of payment or part
Expand Down
2 changes: 0 additions & 2 deletions quickbooks/objects/customer.py
Original file line number Diff line number Diff line change
@@ -1,9 +1,7 @@
from six import python_2_unicode_compatible
from .base import Address, PhoneNumber, EmailAddress, WebAddress, Ref, QuickbooksManagedObject, \
QuickbooksTransactionEntity


@python_2_unicode_compatible
class Customer(QuickbooksManagedObject, QuickbooksTransactionEntity):
"""
QBO definition: A customer is a consumer of the service or product that your business offers. The Customer object
Expand Down
2 changes: 0 additions & 2 deletions quickbooks/objects/customertype.py
Original file line number Diff line number Diff line change
@@ -1,9 +1,7 @@
from six import python_2_unicode_compatible
from .base import Address, PhoneNumber, EmailAddress, WebAddress, MetaData, QuickbooksReadOnlyObject, \
QuickbooksTransactionEntity


@python_2_unicode_compatible
class CustomerType(QuickbooksReadOnlyObject, QuickbooksTransactionEntity):
"""
QBO definition: Customer types allow categorizing customers in ways that are meaningful to the business.
Expand Down
2 changes: 0 additions & 2 deletions quickbooks/objects/department.py
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
from six import python_2_unicode_compatible
from .base import QuickbooksManagedObject, QuickbooksTransactionEntity, Ref


@python_2_unicode_compatible
class Department(QuickbooksManagedObject, QuickbooksTransactionEntity):
"""
QBO definition: The Department entity provides a way to track different segments of the business, divisions, or
Expand Down
3 changes: 0 additions & 3 deletions quickbooks/objects/deposit.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
from six import python_2_unicode_compatible
from .base import QuickbooksBaseObject, Ref, LinkedTxn, QuickbooksManagedObject, LinkedTxnMixin, \
QuickbooksTransactionEntity, CustomField, AttachableRef
from ..mixins import DeleteMixin
Expand Down Expand Up @@ -35,7 +34,6 @@ def __init__(self):
self.PaymentMethodRef = None


@python_2_unicode_compatible
class DepositLine(QuickbooksBaseObject):
class_dict = {
"DepositToAccountRef": Ref,
Expand Down Expand Up @@ -63,7 +61,6 @@ def __str__(self):
return str(self.Amount)


@python_2_unicode_compatible
class Deposit(DeleteMixin, QuickbooksManagedObject, QuickbooksTransactionEntity, LinkedTxnMixin):
"""
QBO definition: A deposit object is a transaction that records one or more deposits of the following types:
Expand Down
Loading

0 comments on commit 5d29d1f

Please sign in to comment.