weboob.capabilities.bill

exception weboob.capabilities.bill.SubscriptionNotFound(msg='Subscription not found')

Bases: weboob.capabilities.base.UserError

Raised when a subscription is not found.

exception weboob.capabilities.bill.DocumentNotFound(msg='Document not found')

Bases: weboob.capabilities.base.UserError

Raised when a document is not found.

class weboob.capabilities.bill.Detail(id=u'', url=NotLoaded, backend=None)

Bases: weboob.capabilities.base.BaseObject, weboob.capabilities.base.Currency

Detail of a subscription
Variables:
  • label – (unicode) label of the detail line
  • infos – (unicode) information
  • datetime – (date, datetime) date information
  • price – (Decimal) Total price, taxes included
  • vat – (Decimal) Value added Tax
  • currency – (unicode) Currency (default: None)
  • quantity – (Decimal) Number of units consumed
  • unit – (unicode) Unit of the consumption
class weboob.capabilities.bill.Document(id=u'', url=NotLoaded, backend=None)

Bases: weboob.capabilities.base.BaseObject

Document.
Variables:
  • date – (date, datetime) The day the document has been sent to the subscriber
  • format – (unicode) file format of the document
  • label – (unicode) label of document
  • type – (unicode) type of document
class weboob.capabilities.bill.Bill(id=u'', url=NotLoaded, backend=None)

Bases: weboob.capabilities.bill.Document, weboob.capabilities.base.Currency

Bill.
Variables:
  • price – (Decimal) Price to pay
  • currency – (unicode) Currency (default: None)
  • vat – (Decimal) VAT included in the price
  • duedate – (date, datetime) The day the bill must be paid
  • startdate – (date, datetime) The first day the bill applies to
  • finishdate – (date, datetime) The last day the bill applies to
  • income – (bool) Boolean to set if bill is income or invoice (default: False)
class weboob.capabilities.bill.Subscription(id=u'', url=NotLoaded, backend=None)

Bases: weboob.capabilities.base.BaseObject

Subscription to a service.
Variables:
  • label – (unicode) label of subscription
  • subscriber – (unicode) Subscriber name or identifier (for companies)
  • validity – (date, datetime) End validity date of the subscription (if any)
  • renewdate – (date, datetime) Reset date of consumption, for time based suscription (monthly, yearly, etc)
class weboob.capabilities.bill.CapDocument

Bases: weboob.capabilities.collection.CapCollection

download_document(id)

Download a document.

Parameters:id – ID of document
Return type:bytes
Raises:DocumentNotFound
download_document_pdf(id)

Download a document, convert it to PDF if it isn’t the document format.

Parameters:id – ID of document
Return type:bytes
Raises:DocumentNotFound
get_balance(subscription)

Get the balance of a subscription.

Parameters:subscription (Subscription) – subscription to get balance
Return type:class:Detail
get_details(subscription)

Get details of a subscription.

Parameters:subscription (Subscription) – subscription to get details
Return type:iter[Detail]
get_document(id)

Get a document.

Parameters:id – ID of document
Return type:Document
Raises:DocumentNotFound
get_subscription(_id)

Get a subscription.

Parameters:_id – ID of subscription
Return type:Subscription
Raises:SubscriptionNotFound
iter_bills(subscription)

Iter bills.

Parameters:subscription (Subscription) – subscription to get bills
Return type:iter[Bill]
iter_bills_history(subscription)

Iter history of a subscription.

Parameters:subscription (Subscription) – subscription to get history
Return type:iter[Detail]
iter_documents(subscription)

Iter documents.

Parameters:subscription (Subscription) – subscription to get documents
Return type:iter[Document]
iter_documents_history(subscription)

Iter history of a subscription.

Parameters:subscription (Subscription) – subscription to get history
Return type:iter[Detail]
iter_resources(objs, split_path)

Iter resources. Will return iter_subscriptions().

iter_subscription()

Iter subscriptions.

Return type:iter[Subscription]