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
) urllabel – (
str
) label of the detail lineinfos – (
str
) informationdatetime – (
date
,datetime
) date informationprice – (
Decimal
) Total price, taxes includedvat – (
Decimal
) Value added Taxcurrency – (
str
) Currency (default: None)quantity – (
Decimal
) Number of units consumedunit – (
str
) Unit of the consumption
- class Document(id='', url=NotLoaded, backend=None)[source]¶
Bases:
BaseObject
Document.
- Variables:
url – (
str
) urldate – (
date
,datetime
) The day the document has been sent to the subscriberformat – (
str
) file format of the documentlabel – (
str
) label of documenttype – (
str
) type of documenttransactions – (
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
) urldate – (
date
,datetime
) The day the document has been sent to the subscriberformat – (
str
) file format of the documentlabel – (
str
) label of documenttype – (
str
) type of documenttransactions – (
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 paycurrency – (
str
) Currency (default: None)vat – (
Decimal
) VAT included in the pricepre_tax_price – (
Decimal
) Price without the VAT or other taxesduedate – (
date
,datetime
) The day the bill must be paidstartdate – (
date
,datetime
) The first day the bill applies tofinishdate – (
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
) urllabel – (
str
) label of subscriptionsubscriber – (
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:
- iter_subscription()[source]¶
Iter subscriptions.
- Return type:
iter[
Subscription
]
- get_subscription(_id)[source]¶
Get a subscription.
- Parameters:
_id – ID of subscription
- Return type:
- Raises:
- 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
]
- download_document(id)[source]¶
Download a document.
- Parameters:
id – ID of document
- Return type:
- Raises:
- 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:
- Raises:
- 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 documentsaccepted_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