woob.capabilities.bill

exception SubscriptionNotFound(msg='Subscription not found')[source]

Bases: UserError

Raised when a subscription is not found.

exception DocumentNotFound(msg='Document not found')[source]

Bases: UserError

Raised when a document is not found.

class DocumentTypes[source]

Bases: object

RIB = 'RIB'

French bank account identification document

STATEMENT = 'statement'

Bank statement

CONTRACT = 'contract'

Contract between organisation and subscriber

CERTIFICATE = 'certificate'

Certificate from the organisation to the subscriber

NOTICE = 'notice'

Notice from the organisation to the subscriber

REPORT = 'report'

Informative report

BILL = 'bill'

Bill

KIID = 'kiid'

Key Investor Information Document

IDENTITY = 'identity'

Identity document (e.g. national identity card, driving licence, etc…)

PAYSLIP = 'payslip'

Payslip

OTHER = 'other'
class Detail(id='', url=NotLoaded, backend=None)[source]

Bases: BaseObject, Currency

Detail of a subscription

Variables:
  • url – (str) url

  • label – (str) label of the detail line

  • infos – (str) information

  • datetime – (date, datetime) date information

  • price – (Decimal) Total price, taxes included

  • vat – (Decimal) Value added Tax

  • currency – (str) Currency (default: None)

  • quantity – (Decimal) Number of units consumed

  • unit – (str) Unit of the consumption

class Document(id='', url=NotLoaded, backend=None)[source]

Bases: BaseObject

Document.

Variables:
  • url – (str) url

  • date – (date, datetime) The day the document has been sent to the subscriber

  • format – (str) file format of the document

  • label – (str) label of document

  • type – (str) type of document

  • transactions – (list) List of transaction ID related to the document (default: [])

  • has_file – (bool) Boolean to set if file is available (default: True)

  • number – (str) Number of the document (if present and meaningful for user)

class Bill(*args, **kwargs)[source]

Bases: Document, Currency

Bill.

Variables:
  • url – (str) url

  • date – (date, datetime) The day the document has been sent to the subscriber

  • format – (str) file format of the document

  • label – (str) label of document

  • type – (str) type of document

  • transactions – (list) List of transaction ID related to the document (default: [])

  • has_file – (bool) Boolean to set if file is available (default: True)

  • number – (str) Number of the document (if present and meaningful for user)

  • total_price – (Decimal) Price to pay

  • currency – (str) Currency (default: None)

  • vat – (Decimal) VAT included in the price

  • pre_tax_price – (Decimal) Price without the VAT or other taxes

  • 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

property price
property income
class Subscription(id='', url=NotLoaded, backend=None)[source]

Bases: BaseObject

Subscription to a service.

Variables:
  • url – (str) url

  • label – (str) label of subscription

  • subscriber – (str) 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 subscription (monthly, yearly, etc)

  • is_fake – (bool) Set True if website doesn’t provide a real subscription (default: False)

class CapDocument[source]

Bases: CapCollection, CapCredentialsCheck

accepted_document_types = ()

Tuple of document types handled by the module (DocumentTypes)

check_credentials()[source]

Check that the given credentials are correct by trying to login.

The default implementation of this method check if the class using this capability has a browser, execute its do_login if it has one and then see if no error pertaining to the creds is raised. If any other unexpected error occurs, we don’t know whether the creds are correct or not.

Return type:

bool

iter_subscription()[source]

Iter subscriptions.

Return type:

iter[Subscription]

get_subscription(_id)[source]

Get a subscription.

Parameters:

_id – ID of subscription

Return type:

Subscription

Raises:

SubscriptionNotFound

iter_documents_history(subscription)[source]

Iter history of a subscription.

Parameters:

subscription (Subscription) – subscription to get history

Return type:

iter[Detail]

iter_bills_history(subscription)[source]

Iter history of a subscription.

Parameters:

subscription (Subscription) – subscription to get history

Return type:

iter[Detail]

get_document(id)[source]

Get a document.

Parameters:

id – ID of document

Return type:

Document

Raises:

DocumentNotFound

download_document(id)[source]

Download a document.

Parameters:

id – ID of document

Return type:

bytes

Raises:

DocumentNotFound

download_document_pdf(id)[source]

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

Parameters:

id – ID of document

Return type:

bytes

Raises:

DocumentNotFound

iter_documents(subscription)[source]

Iter documents.

Parameters:

subscription (Subscription) – subscription to get documents

Return type:

iter[Document]

iter_documents_by_types(subscription, accepted_types)[source]

Iter documents with specific types.

Parameters:
  • subscription (Subscription) – subscription to get documents

  • accepted_types ([DocumentTypes]) – list of document types that should be returned

Return type:

iter[Document]

iter_bills(subscription)[source]

Iter bills.

Parameters:

subscription (Subscription) – subscription to get bills

Return type:

iter[Bill]

get_details(subscription)[source]

Get details of a subscription.

Parameters:

subscription (Subscription) – subscription to get details

Return type:

iter[Detail]

get_balance(subscription)[source]

Get the balance of a subscription.

Parameters:

subscription (Subscription) – subscription to get balance

Return type:

class:Detail

iter_resources(objs, split_path)[source]

Iter resources. Will return iter_subscriptions().